8

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.

3

1 Answer 1

3

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

2
  • FYI: Just tried it on Ubuntu and Petalinux and it worked perfectly! May 23, 2017 at 17:48
  • And how do you send byte-for-byte binary if the embedded system does not permit you decode ascii?
    – Lexible
    Jun 6, 2020 at 20:20

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