I am at my wits end. I am almost positive this is the result of something stupid that I’m doing, but I just cannot figure it out and it’s making me go nuts!!!
As detailed in posts #150-164 in this thread, I was having issues receiving data from a sensor via RS232 serial interface. I eventually figured out that a null modem adapter was necessary.
I had since moved onto various other parts of the project and finally arrived at the stage where I had to marry all of the hardware components together into one beautiful, integrated application. This is when I realized that I could no longer read data from my sensor via the serial connection. The symptoms were similar to those I noticed before I began using the null modem adapter.
This is absolutely infuriating. Everything is setup exactly how it was when I first successfully read data from the sensor using my RS232 shield and the null modem adapter.
The sensor is sending data just like it always has been, and it is formatted in the exact same way. I can see it in a terminal window when I connect the sensor directly to my computer. Now, however, I can't even get sensorStream.available() to return true in my code. I removed the available() check and read characters from the stream and wrote them to the console. All I am seeing is negative ones.
It was almost like the null modem adapter had gone bad, but that’s virtually impossible. Even so, I tested another null modem adapter with the same results.
I have tried everything I can think of. I have tried the most basic of code (the same code I originally used to successfully read data from this serial stream) and the most basic of circuits (nothing connected except the RS232 shield/module).
I have tried the following combinations (all tried with and without null modem adapter and jumpered to various pins for rx/tx):
Uno + RS232 shield Uno + RS232 module (not a shield) Mega + RS232 shield Mega + RS232 module (not a shield)
I have also tried multiple different baud rates (to no avail), though 9600 was working just fine before the universe became devoid of logic.
I have no other ideas. This has stopped my progress dead in its tracks, and it’s so discouraging.