Missing 0x11 and 0x13 bytes with UART, revolution board
« on: May 23, 2018, 06:55:13 am »
I am encountering a problem while working a custom UART communication between an Arduino and a revolution board. I am modifying the firmware pios/com layer to enable exchanging arbitrary bytes over UART on the main_port of revolution. I added a new "use case" on top of the existing GPS/Telemetry/DEBUGCONSOLE etc. and use PIOS_COM_SendBuffer to communicate. it seems to work well, as the Arduino successful receives the "Hello world" sent from Revolution.

However whenever I use PIOS_COM_SendBuffer to send a sequence of binary bytes, any byte of value 0x11 or 0x13 simply disappears over the wire. It is making the protobuf decoding to fail on the Arduino side.

Does anyone know why it is so?

Re: Missing 0x11 and 0x13 bytes with UART, revolution board
« Reply #1 on: May 23, 2018, 07:00:01 am »
^Q and ^S are software flow control.  Your serial library code is eating them.

Re: Missing 0x11 and 0x13 bytes with UART, revolution board
« Reply #2 on: May 23, 2018, 10:59:59 am »
Thanks!

Which link do you think might be the one that eats the ^Q and ^S?

I was using the following connectivity to investigate: Revolution Main_Port <-> USB-TTL adaptor <-> `cat /dev/ttyUSB0 | tee log.txt`, and the log.txt was missing the bytes 0x11 annd 0x13

Re: Missing 0x11 and 0x13 bytes with UART, revolution board
« Reply #3 on: May 23, 2018, 11:10:39 am »
Yes. You are right. Thanks!

In the end it is the linux who is eating the software flow control.

after `stty -F /dev/ttyUSB0 -ixon` I can see the bytes now.