Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transferring file using zmodem/picocom/minicom noninteractively

We are trying to transfer file using minicom (in host pc) and picocom(in arm based evaluation board) combination. On evaluation board side we have /dev/ttygserial and on host pc side we have /dev/ttyUSB0.

Host side minicom setup is as follows,

  1. Serial device - /dev/ttyUSB0
  2. Baud Rate - 115200

Steps to set minicom in receiving mode.

  1. press ctrl+a R , select zmodem.
  2. Now minicom will start waiting for file from other end.

On evaluation board side we use picocom as follows to send the file.

  1. On command line execute picocom -b 115200 -s "sz -vv" /dev/ttygserial
  2. Now press Ctrl+A and Ctrl+S.
  3. Picocom will ask for filename by printing **file
  4. Once file name is provided and enter is pressed file is sent to host.

All this steps works and we are able to transfer different types of files from evaluation board to pc but now we want to put this procedure into C code. For that I have following doubts,

  1. Is it possible to set minicom in file reception mode using single command? (meaning noninteractively) ?
  2. Is it possible to send file using picocom in single command (meaning noninteractively)?
  3. Any other suggestions?
like image 526
ART Avatar asked Nov 11 '22 20:11

ART


1 Answers

In other sites also people have asked this kind of question but questions unanswered yet.

So I decided to look into picocom code and found that it is very simple to make a change in that code.

I have made send command non-interactive, I will make receive command too non-interactive and post full code here so that it can be referred by anyone who has a similar problem.

like image 139
ART Avatar answered Jan 04 '23 02:01

ART