How can I transfer a binary file using minicom and a serial connection?

15,159

I have not tried this before, but this page says you can send binary via minicom by encoding it in ASCII. You need to have busybox installed on the box.

Use uuencode to encode. Here is it's syntax:

uuencode [INFILE] STORED_FILENAME > send_file

INFILE is the path to file to encode and STORED_FILENAME is obviously the name of the file. uuencode outputs to stdout, so it is redirected to a temporary file, send_file.

Ready the target machine for recieving file:

target$ cat > recieved_file

Now it is uploaded as ascii using minicom:

host$ minicom
CTRL+A S
+-[Upload]--+                                                
| zmodem    |                                                     
| ymodem    |                                                
| xmodem    |                                                
| kermit    |                                                
|>ascii<    |                                                
+-----------+

On the target, decode the file:

uudecode [-o OUTFILE] [INFILE]

To see if it worked as expected, check md5:

busybox md5sum <filename>

Please see if this works and post back, because I have never done this. myself

Share:
15,159

Related videos on Youtube

kaio
Author by

kaio

Updated on September 18, 2022

Comments

  • kaio
    kaio over 1 year

    How can I transfer a binary file using a serial cable between my Ubuntu pc and a box where I've installed minicom? The minicom box doesn't have a connection.

    • Admin
      Admin almost 9 years
      Is a serial cable the only option? Does the box have a network card? A usb port?
    • Admin
      Admin almost 9 years
      yes @ terdon , the serial cable the only option .it haven't a network card , usb port.
    • Admin
      Admin almost 9 years
  • JohnTortugo
    JohnTortugo about 7 years
    FYI: Just tried it on Ubuntu and Petalinux and it worked perfectly!
  • Lexible
    Lexible almost 4 years
    And how do you send byte-for-byte binary if the embedded system does not permit you decode ascii?