Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ESP8266 only? #1

Open
rjdekker opened this issue Jun 22, 2018 · 4 comments
Open

Use ESP8266 only? #1

rjdekker opened this issue Jun 22, 2018 · 4 comments

Comments

@rjdekker
Copy link
Owner

I'm getting some questions if it is possible to only use an ESP8266-based board without the Arduino.

The thing is that this is what I was aiming for when starting this project. Unfortunately, I could not get SPI communication working with the MHI. The reason is technical and mostly beyond my skills. Running an ESP8266 as a SPI slave (MHI is master) is very poorly documented and some code that I found was impossible for me to get working for this particular scenario.

Some of the things that I ran into:

  • The MHI does not use a slave select line and the ESP8266 SPI library does
  • The MHI's clock is high when idle. The ESP8266 appears to only work with clock low when idle.
  • Cryptic documentation on the ESP's SPI hardware

I still think it's possible but it would cost me too much time to figure out.

In contrast, I had the Arduino working as a SPI slave in no time and the programmatic implementation was delightfully simple compared to the ESP8266.

If anyone knows how to do this, I will be happy to provide you with more detailed information on the SPI protocol.

Cheers, Rob

@SwiCago
Copy link

SwiCago commented Jul 6, 2018

Hey Rob, awesome job figuring out the protocol for the heavies! I wrote the arduino library for the non_heavy units, based on Hadley's python code. Maybe one day we can do a merge of the two librarys, where a user can choose via #define which protocol to use. But first it would need to work on stand alone ESP.
Since the MHI doesn't use SPI SS, why not just pull it low at all times on ESP. The ESP will be the only slave and that is probably why they didn't add SS pin. Second, you say CLK is low when idle, it is possible that you need to pull it up to 5V with a 10k resistor, since that is what I had to do with my TX/RX lines for bone stock esp01. It seems that Mitsu pins are floating when they are not in use. Good luck and let me know if this helped.

@rjdekker
Copy link
Owner Author

rjdekker commented Nov 7, 2018

Hi SwiCago,

Great to hear from you and thank you so much for your input. It was actually your work and Hadley’s that inspired me to get something similar going for the MHIs! It works in the current form but it is still far from a mature library that can run on a single ESP.

Your suggestions are a good starting point for further investigation. Unfortunately, I relocated to another city a while ago and left my beloved heavies including the arduinos to the new owner of my old home. I have therefore no access to a unit for testing purposes. My interest will surely return if and when I will install heavies in my new home. Hopefully somebody else can pick this up in the meantime....

Best,

Rob

@apateluk
Copy link

apateluk commented Jul 1, 2019

Hi Rob,

I am looking to do an ESP8266 only variant. Can you provide more detail on the SPI protocol if possible please ?

I'm struggling to completely follow the outline High-level protocol you have on the repo home page.

[Edit] I've looked through the code and have a couple of clarifying questions:

  1. Are the three frame variants sent continually. i.e. The statement in the documentation about starting a connection is a continual process (rather than only doing it once)
  2. To update settings, it can be sent in any of the three variations of the message, but as long as it happens in the 'clock' hight stage

@ThomasHFWright
Copy link

FYI all there is another project now active using only ESP8266 hardware without the arduino requirement https://github.com/absalom-muc/MHI-AC-Ctrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants