Phoning in Serial Communication
That wasn’t supposed to take so long….
I started this post on Feb 8th, thinking I could quickly test my idea about bypassing i2c, followed by either removing the ( now unneeded) RxTx lines, or recoding how the data is handled between the 2 computers, and swapping out comm lines for a small length of phone cord that can easily be (dis)connected when needed.
That was 12 days ago.
Needless to say, I had a few challenges that needed to be overcome along the way.
Preliminary testing of my i2c workaround wasn’t as good as I hoped, so I’m going to shelve further testing and experimentation of the idea until after the Colonel is back online. It would have been great if I could have squeaked it in, however I’m not going to hold up the build for something that wasn’t on my initial wish list. So, that said I’m going back to using the dreaded Serial UART RxTx communications. After experiencing how awkward my little communication board is for connecting/disconnecting the RxTx lines, I’ve decided to remove the RxTx connection from the board altogether, and instead I’ll be using a repurposed phone filter to connect the comm lines between the Uno and NodeMCU directly.
As previously mentioned, this also left me revisiting my code, So I went back to square one and started looking for decent tutorials that I could tap into and find a better way to do things. I found a nice piece of code that would receive a properly formatted string, and parse it into its constituent parts and place it into a set of data buckets.
Great starting point! I wanted to take it one step further though, and have the first character in the string determine which buckets the rest of the data will be stored in. That took a significant amount of time, first to find the right tutorial then attempting to modify the code to do exactly what I wanted it to do.
In the end I did the sensible thing and posted my code to a forum and asked for help, and a beautiful person using the handle ‘cattledog’ patched it up for me, so it now does exactly what I was hoping it was going to do!
On a related note, once again I have found myself in a place where the forums are talking about things “everyone knows”, which are never included in the tutorials. In this case I’m being told I need a voltage divider coming into the NodeMCU’s Rx pin, as the signal coming from the Uno is 5v, not 3v. I’ve already pulled the resistors I’m going to need for this. Who knows, maybe this 3v - 5v difference is the reason behind the garbage characters I was seeing on the transfer?
(I’ve also pulled out the diodes I wanted to pop on to help regulate the power lines - see if I can’t get it all done at once)
About that voltage divider…
In hindsight, I think there was a reason it wasn’t included in ANY of my tutorials I looked at.
With the thing in place I had NO communication between the computers.
That was another day or 2 to figure out…. Funny, as soon as I tore it off the board communication was reestablished.
Yeah… Gotta love the preachy “Experts”, some times.
While I was on a bit of a roll with the soldering iron, and looking to build some positive mojo after dealing with all of the communication headaches, I decided it would also be a good time to mount the LCD screen so that also added to my build time. Seeing it, I’d say that it was time well spent!