I have a serial device (Omega RDXL4SD thermocouple reader, comms details p 22 here) connected to a USB port on my Raspberry Pi running Raspbian via an FTDI cable. It appears at /dev/ttyUSB0 and the output looks perfect if I display it by calling
pi@raspberrypi:~ $ screen /dev/ttyUSB0 9600
The output is a few numbers. Each time it spits out a line, the cursor returns to the beginning of the line and overwrites it, so that there is only ever one line of numbers on the screen at a time.
Now, I want to use
screen to achieve the same effect, but when I do I get boxes with question marks in them:
pi@raspberrypi:~ $ cat /dev/ttyUSB0 4401010000
I presume this is some kind of encoding problem. Can you explain what might be different about how these characters are being interpreted in
cat, or suggest other troubleshooting steps?
In case it helps:
pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux pi@raspberrypi:~ $ stty -F /dev/ttyUSB0 speed 9600 baud; line = 0; min = 100; time = 2; -icrnl -imaxbel -opost -onlcr -isig -icanon -echo
Edit: @meuh suggested adding -vet to display special characters. Now that I know about those flags, my particular problem is effectively solved! I still wouldn't mind an explanation of exactly what's going on here though.
pi@raspberrypi:~ $ cat -vet /dev/ttyUSB0 ^M^B4201010000^X^X^X^X^M^B4301010000^X^X^X^X^M^B4401010000^X^X^X^X^M^B41010100000245^M^B4201010000^X^X^X^X^M^B4301010000^X^X^X^X^M^B4401010000^X^X^X^X^M^B41010100000245^M^B4201010000^X^X^X^X^M^B4301010000^X^X^X^X^M^B4401010000^X^X^X^X^M^B41010100000245^M^B4201010000