If you have a serial login from one ubuntu workstation (local) to another ubuntu machine (remote), you can send a raw file over gtkterm with the following:
First, check the md5sum of the file so that we can be confident we transferred it successfully. If the file you wish to send is binary (contains non-ascii text) then I recommend that you first base64 encode the data. For example
[local]:
user@local:~$ md5sum my_file.bin
9426054eb507e98605d7a6b94189168b my_file.bin
user@local:~$ base64 my_file.bin > my_file.bin.base64
user@local:~$ gtkterm --port /dev/ttyUSB1 --speed 115200 &
[remote]:
user@remote:~$ cat > my_file.bin.base64
Now use the gtkterm menu to "send raw file" and select your file. You'll see every byte of the file echo'ed on the gtkterm window. When the file is finished sending press Ctrl+D
in the gtkterm
window to send a EOF
to cat
. You'll see a new terminal prompt pop up. Then base64 decode the file. Finally it's a good idea to check the integrity of the data.
[remote]:
user@remote:~$ base64 -d my_file.bin.base64 > my_file.bin
user@remote:~$ md5sum my_file.bin
9426054eb507e98605d7a6b94189168b my_file.bin
Notes
Note that the file transfer will proceed at the rate of the serial connection. You can't feasibly send very large files this way. Furthermore (and especially if the serial connection doesn't support flow control) there's always the possibility of some dropped bytes.
*BONUS:
Once you've started cat > my_file.bin.base64
on the remote machine through gtkterm, you can bypass gtkterm to do the actual file transfer. For instance you can use plain ole cat:
[local]:
user@local:~$ cat my_file.bin > /dev/ttyUSB1
Or if you want a fancy progress bar give pv
a try:
[local]:
user@local:~$ pv my_file.bin | cat > /dev/ttyUSB1
This technique will work with other serial terminal clients, including terminal based clients (i.e. creen
, minicom
, etc).