i2c and the NodeMCU
The upgrade to the new i2c communications protocol is not going as well as expected. For not the first time, something that looked like an easy/elegant solution on paper wasn’t feasible. The short version is that while my computers are able to detect and interact with every sensor on the bus, the NodeMCU I’m using is seemingly undetectable. As a test, I added a second NodeMCU to the bus and it wasn’t detectable either
To Summarize:
1) NodeMCU (1) and (2) can detect the Arduino Uno, and all sensors on bus.
2) Arduino Uno can NOT detect either NodeMCU (1) or (2), but CAN detect all sensors on bus
3) NodeMCU(1) and NodeMCU(2) can NOT detect each other
After spending the day reading, testing, and trying to figure out i2c communications, I learned that there are a million and a half tutorial sites that basically parrot of the same how-to info for setting up i2c Arduino/NodeMCU communications, and given the similarities, I doubt most of these people haven’t actually tested it themselves, but just assumed it works because the person they copied it from said (assumed?) it did.
It wasn’t until I went looking past those, into forum discussions (on more credible websites) when I was trying to troubleshoot why it wouldn’t work, that I started seeing more and more people reiterating that the 8266chip in the NodeMCU isn’t really designed for this purpose… apparently it doesn’t know how to receive data properly or something? There are also possible conflicts that can arise due to the difference in power outputs… the NodeMCU is a 3v device, while the Arduino Uno is 5v.
On a side note, it was also through looking at the forums that I saw people being berated for not using pull-up resistors in their i2c circuit designs… funny enough NOT ONE of the tutorials I looked at, or schematics I viewed that were attached to them indicated anything about this apparent requirement. As much as I respect forums, in times like this I’m wondering how many of these virtual experts are barking off “problems” to fix, just to feel smarter/more important in their little lives. The way I see it, if its so fundamentally important to include these resistors, you’d think that at least ONE tutorial somewhere would have at lease suggested doing it… or maybe a commenter on one of the tutorials would have pointed out that glaring mistake… Regardless, adding the pull-ups didn’t make a lick of difference for me.
So, Where to go from here?
Well, from what I was reading, my “best option” is to try and run all of my sensors and devices off of a single NodeMCU and call it a day. As that isn’t really an option, given 1) my TDS sensor doesn’t work with my NodeMCU, 2) the NodeMCU doesn’t have enough pins to connect to all of my devices unless I want to start messing around with DAC units 3) The LCD screen barely lights up when powered by the NodeMCU’s 3v output.
That leads me to my “second best” option… Unfortunately, if I want wifi I’m going to have to suck it up and go back to using the RxTx Serial communications that I dislike so much. Its not ideal, but at least I know the computers can talk that way.