I have a question related to the serial terminal. I have a Linux computer and I connect to an ARM mini-computer running debian with screen /dev/ttyUSB0 115200. From there, I can login and type commands.

That means I can virtually transfer any text file, by creating a file on the ARM through the serial terminal, opening the file in the Linux computer and copy all the text to the opened terminal.

Now, I would like to transfer binary data. My ARM computer doesn't have access to internet and thus, can't install packages. That includes minicom, sadly. Besides, it doesn't have rz out of the box.

In summary, I can easily transfer everything that is text. Now, I would like to copy a binary file through it. How can it be done?

P.s.: This question extend Send a binary file through serial terminal, with a bit more constraints.

  • Can your ARM system read USB storage? Or does it have any form of networking at all? – roaima Oct 6 '19 at 17:20
  • What tools does the ARM computer have? Does it have uudecode, base64 or any similar tool capable of decoding an ASCII-encoded binary back to binary form? Or a perl, python or some other powerful script interpreter that could be used to make one? – telcoM Oct 6 '19 at 17:22
  • Yes, I have python, and I was considering using it to do such function. But I was hoping there is an out of the box tool for that. – Emile D. Oct 6 '19 at 20:40

Use shar from GNU sharutils to make a text file out of the binary file, then copy and paste that text file as you’ve been doing. The text file will be a shell script which will recover the original binary file when executed. https://en.wikipedia.org/wiki/GNU_Sharutils

| improve this answer | |

Depends on what you have on the ARM box. Do you have uuencode? base64? perl?

Basically you convert the binary to ASCII using some wrapper program, send the ASCII file to the remote machine, then unwrap it back to the binary.

So, for example

uuencode myfile > myfile.uue

Now send myfile.uue to the remote end

Then on the remote end

uudecode myfile.uue

There are many ways of wrapping binary into ASCII; uuencode and base64 are two common methods. Without knowing what you have on the machine it's impossible to know what method would be best for you.

Once you've worked out how to do that then you could use this method to transfer a better program such as minicom or rz and use that. Basically use the ASCII wrapping to "bootstrap" a reliable transfer process.

| improve this answer | |

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.