I have a program which opens /dev/ttyUSB0 for read/write access. Through this file handle, I can send data to the Arduino just fine. It receives it. However, I cannot receive anything back from the Arduino.
The Arduino is loaded with an RS-232 loopback program, so anything I send to the Arduino, I should see come right back. I can confirm this is happening with Minicom. So I know that it's possible to exchange data.
However, when I use my own C code to do this, absolutely nothing happens. It's like the Arduino is a Data Roach Motel -- Data goes in, but does not come back out. The RX light flashes, the TX light does not.
I need to know why, but nothing I've tried helps. I even ran strace minicom to try and see, at a system-call level, if I'm doing anything differently than Minicom. While my call traces aren't precisely the same, the differences that exist are not sufficient to explain the errant behavior (e.g., Minicom opens the serial port non-blocking, whereas I'm in blocking mode).
The only way I can get to run and test my program is if I (1) first run minicom, then (2) type CTRL-A Z J to suspend Minicom, and then (3) run my software which opens /dev/ttyUSB0 as described above.
I really need to know what is happening here. Can anyone please help?[1]
Thanks in advance!!
- I don't have much faith though -- most of the messages along a similar line as this go unanswered.
I'll try to keep debugging this in the mean-time, and will post my findings here if I stumble across anything.