I have connected my RPi to my laptop via an RS232 to TTL adapter and a RS232 to USB cable and tried to write to it in C.
On my laptop everything worked just fine.
But when I move to the production environment, I see from the Pc they have that the program that was made to communicate with the RPi reads what it just wrote.
In fact, if it tries to write a long string, it works, but when he tries to write a short string (the hex for "ack"), that very string "bounces" back and is read by the program.
- PC sends "message" to RPI
- RPI sends "ack_1" to PC
- PC sends "ack" to RPI
- Both PC and RPI read "ack" from the line
I can post part of the code that I use, if you think it's necessary.
For now I can tell you that I use standard functions from the RS232 C library.
My OS is Raspbian.