LF/CR issue with RS232 in Linux
I've been having this problem where anytime I send a 0xA through an RS-232 in a Linux OS the receiver interprets that as 2 bytes, 0xD and 0xA. Also whenever I receive 0xD the serial port interprets that as 0xA. I've been reading that t开发者_开发问答here are known issues regarding this, has anybody been able to find a solution?
If anybody is having this issue I found a work around.
Simply type these commands in the terminal, and the issue went away for me
"stty -F /dev/ttyUSB0 -onclr"
"stty -F /deb/ttyUSB0 -icrnl"
/dev/ttyUSB0 can be replaced with whatever file descriptor you are using.
Apparently Linux has these settings set by default. (I don't why)
精彩评论