Transferring file using zmodem/picocom/minicom noninteractively

ART picture ART · Oct 9, 2013 · Viewed 13k times · Source

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?

Answer

ART picture ART · Oct 18, 2013

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.