TransWikia.com

what is the equivalent of scp for the serial console?

Raspberry Pi Asked on October 5, 2021

I am configuring my raspberry pi device of the serial console (like this https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/overview)

How can I do the equivalent of scp? (copy files to the raspberry pi)

Currently I am just going cat > newfile.py and then pasting in the file content.

Maybe the following matrix will explain what I am missing:

over network                    | over serial
--------------------------------------------------------------
ssh [email protected]             | picocom -b 115200 /dev/ttyU*
--------------------------------------------------------------
scp script.py [email protected]:~ | ????????????????

additional stuff:

  • I would like to put this in a script, so a non interactive way would be preferable.
  • All of your suggestions sound great.. but an example would be really handy.

2 Answers

There's nothing wrong with your approach for individual text files. For a binary file (or a large number of files/directories which you'd pack together with tar/gzip), you can use base64 to encode them as text:

Receiver (Pi over picocom):

cat | base64 -di > file

Sender (another terminal on the PC):

cat file | base64 > /proc/`pidof picocom`/fd/0

Also note that if you want to try out X/Y/ZMODEM (which will be about 30% faster than gzip/base64), the client in Debian goes by the name lrzsz and can be installed with apt. Other apps with ZMODEM support are cutecom/minicom.

Answered by Dmitry Grigoryev on October 5, 2021

Although old fashioned, Picocom supports filetransfer, x-modem, y-modem, z-modem and ascii-xfr. If I where you, i'd go for z-modem. The package you are looking for is lrzsz (and notzmodem as I stated earlier). Note that it operates a bit different from scp.

Answered by Ljm Dullaart on October 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP