4

I have a device running Raspian, that does not have the lrzsz package installed on it. I only have a serial port to the device, and can connect to the device using screen or minicom, but unfortunately I cannot connect find a way to send files over. Also, the device does not have an internet connection.

Is there some way of either transferring files serially without lrzsz, or some way of getting lrzsz to the device serially?

1
  • Do you have busybox? Does busybox rx work? – Mark Plotnick Sep 16 '15 at 7:55
5

There might be simpler and more robust ways to transfer files, but this should work:

  1. base64 encode your file on the host system

    base64 file > file.64

  2. Redirect the serial output to a file on the Pi:

    cat < /dev/ttyAMA0 > file.64

  3. Use minicom's paste feature: Ctrl + A, Y, then select the file to be transferred. Press Ctrl + D on the Pi after the transfer is finished.

  4. The file is then transferred to the Pi as file.64
  5. Now base64 decode it:

    base64 -d file.64 > file

The base64 conversion is required because binary files are transmitted and echoed and some sequences might alter or terminate the session and mess with the terminal or corrupt the transfer. Any other conversion that prevents “unsafe” characters to be echoed back to the screen will do as well, but base64 seems like a good fit here and it's installed on the Pi by default.

2
  • Seems to work! Thank you very much! For interest, would you mind editing your response to indicate why the base64 conversion is necessary? – Cornel Verster Sep 16 '15 at 8:31
  • @CornelVerster otherwise the file could for example stop the transfer (if it has a ^D for example) – data May 28 '18 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.