4

I have a scope attached to RX and TX lines of the serial port. If I do:

cat /dev/ttyS0

I get a steady stream of 'C' characters so the remote side is up and sending. If I do:

cat {filename} > /dev/ttyS0

I get a burst on TX line w/o any protocol. If I do the following:

/usr/bin/sx -vv -k -X -b -c send {filename}

TX line remains inactive. File is binary and expecting xmodem 1K protocol. What am I doing wrong?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

2 Answers2

1

The answer, given by the now-inactive OP, was:

sx {filename} > /dev/ttyS0 < /dev/ttyS0
Compholio
  • 186
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
1

For others using embedded systems who might still want/need to send a file via XMODEM, this method works well with a Raspberry Pi or similar system: Install sx and ser2net

Add a line in the /etc/ser2net.conf file for the TTY connected to the UART and set the correct baud rate (115200 in this example):

5000:raw:115200:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT

Use sx to load the file:

sx -vv -X -b --tcp-client localhost:5000 embedded-image.bin
  • Where do you get rx/sx these days? I can't find the sources. – not2qubit Jul 12 '19 at 09:18
  • If you're using a Debian system you can get it with the lrzsz package, or you can get the sources here: https://www.ohse.de/uwe/software/lrzsz.html – Compholio Oct 27 '21 at 15:06