2

I'm trying to upload a firmware file over a serial connection to a device that requires YMODEM protocol, from a Raspberry Pi. After a lot of digging, I keep finding that the sz --ymodem [file] command is the tool to do this. I've already managed to just communicate with the device using this example, but I'm having no luck with sz.

I've read through the sz documentation and it leaves me with a question. How do I determine if it is sending to the device? It is plugged in via USB and has port /dev/ttyACM0. Other examples talk about sending from a remote host to a local host via sz by default, but that's as deep as any explanation goes.

The device has a command which tells it to anticipate a file transfer; I believe this takes the place of rz, but the device documentation says it "Prepares the device for YMODEM transfer via HyperTerminal." I've sent it the files via HyperTerminal and a proprietary program successfully, but I need to be able to do it on the Linux command line.

I'm sure this is a case of inexperience and I'm missing something obvious, but how can I fully execute this file transfer from start to finish / what am I doing wrong?

2 Answers 2

1

rz and sz date back to the days when people used to dial into modems attached to larger computer systems and login. To send files back, one of several protocols could be used, kermit, xmodem, ymodem and zmodem.

The channel that the files were sent over were the actual login session. So one would start the transfer program on the host, and it would start its protocol handshaking. Then on the terminal program, you'd activate the transfer protocol option.

The hope was that the terminal program and the host computer would establish their place in the protocol and transfer the file.

Zmodem actually defined a flag sequence, so that when the host started a transfer, terminal programs that supported the automatic start would begin the transfer.

TELIX was a popular terminal program that supported this.

Hyperterm used to support several transfer protocols on the PC. If you were connected to the Pi via a serial port, that may be what you are looking for.

What you need to do is think about yourself as being on the raspberry pi, and running a terminal program on the Pi itself to talk to this serial port.

In my experience, the better serial terminal program to run on Linux is minicom, which does support ymodem.

apt-get install minicom

Run minicom and set up the right /dev/ttySxxx ( apparently /dev/ttyACM0)

sudo minicom -s

and follow the menus

Once you are connected, and are ready to ymodem the file. type control-A, the "S", and use the menu selections to pick ymodem and the file to send

It's been a while, but give that a try

19
  • Trying to use putty, now getting this error: (putty:732) Gtk-WARNING **: cannot open display:
    – Jack Mason
    Commented Mar 30, 2016 at 19:06
  • I don't think putty supports in-band file transfer protocols. That's a feature that was added by people forking the project. The GTK warning probably means you are not using X-windows right to run putty
    – infixed
    Commented Mar 30, 2016 at 19:23
  • Let me verify something here. You're not really sending data back to your main PC, from the pi, because you'd just use scp if that was the case. The device you are trying to send to is attached to a serial port off the Pi. Forget about sending the ymodem over ssh
    – infixed
    Commented Mar 30, 2016 at 19:31
  • Changed answer to use minicom
    – infixed
    Commented Mar 30, 2016 at 19:45
  • Have been trying minicom as well. After establishing the right port settings, it says the port is "offline". Sending through the ymodem upload option of minicom then, does one attempt and shows Retry 0: Timeout on pathname
    – Jack Mason
    Commented Mar 30, 2016 at 19:47
0

I think if you do sudo minicom -s it will take you to the setup menu. Make sure you set your port, if it's like a FTDI rs232, rs422 usb to serial cable, to /dev/ttyUSB. It won't even open if it can't find the adapter. Also to send the file you need to send it on one computer, and select receive pretty quickly on the other.....try using FTDI UART terminal for Android. It a little easier and has shortcut buttons.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .