Page 1 of 1

RevPi Core S - Problems reading USB port Serial data

Posted: 12 Sep 2024, 08:30
by Victor.Olofsson
Hi,

I have been trying to connect a RevPI Core S to a machine that data over rs232 to catch this data i want to connect the machine using a rs232 to usb and then by using Python & pyserial read and process the data. I have verified that /dev/ttyUSB0 exists and i have configured pyserial with the same settings as the machine (baud rate, parity etc.)

However this is where im having problems im not getting any data in /dev/ttyUSB0 and im having trouble figuring out what to do or if i have missed anything.

Hardware:
RevPI Core s
1P3FFCB-USB-SERIAL (Serial to usb converter)
Mystery machine that sends data over serial

Thanks in advance for any help,
// Victor

Re: RevPi Core S - Problems reading USB port Serial data

Posted: 13 Sep 2024, 16:22
by dirk
Hey Victor, I have created a test setup and hope it shows how easy you can transfer serial data:

1. Start miniterm

Code: Select all

python3 -m serial.tools.miniterm /dev/ttyUSB0
2. Set local echo on

Code: Select all

[STRG] + T, [STRG] + E
3. Monitor Pin 2 of D-SUB-9 plug - Pin 5 is GND
USB-RS232 RS Sniff Pins
USB-RS232 RS Sniff Pins
4. Type something into miniterm

Here is the result:
I have also used a USB-FTDI converter so it is the same driver as you use, I think.
FTDI USB-RS232 driver
FTDI USB-RS232 driver
I must admit that I used a beta RevPi Bookworm OS image on my device:

Code: Select all

pi@RevPi39627:~$ uname -a
Linux RevPi39627 6.6.0-revpi2-rpi-v8 #1+deb12+1 SMP PREEMPT_RT Thu Aug 29 07:50:23 UTC 2024 aarch64 GNU/Linux
Some ideas for your troubleshooting:
  • Use an oscilloscope or a logic analyzer to monitor the data lines
  • How about the edges of the rectangle signals?
  • How about echoes?
  • Maybe you need to use terminating resistors - yes I did not use them, but this was just a quick test with short cables
Typical signal without terminating resistors
Typical signal without terminating resistors