How can i send a (file) from PC to Arduino Yun at running time ?

There's a way to send some commands via Serial. But how would a whole file goes ? Assuming the file can take place at RAM without any problems.


  • Please be precise about what type of file and content.
    – leoc7
    Commented Dec 23, 2018 at 22:58
  • Just use scp...
    – Majenko
    Commented Dec 23, 2018 at 23:00
  • @leoc7 image file. JPEG extension. Commented Dec 23, 2018 at 23:29
  • @Majenko can you guide me to a link or a library ? Commented Dec 23, 2018 at 23:30
  • 1
    And what do you want to do with the file?
    – Majenko
    Commented Dec 24, 2018 at 9:17

3 Answers 3


You can send a file, byte after byte, using Serial. On the Arduino side, you parse serial communication and put bytes inside an array. At the end, you reconstruct the file.

  • What tool i can use to send that file from PC to Arduino ? Commented Dec 24, 2018 at 9:30
  • I think that not exist a tool like this. You should create this PC tool using, for example, Visual Studio.
    – leoc7
    Commented Dec 24, 2018 at 11:03

The first question is what do you want to do with your image : Arduino Yun has a Linux chip & an Arduino chip. And I don't think that image treatment must happen in the Arduino side... So you can send your image with scp to Linux side, then do what you want with it and perhaps, eventually, send the result for action to the Arduino part.

  • I want to send an image, This image is to be attached to an email which would be sent to email address. Commented Dec 28, 2018 at 12:13

Back in the mists of time (late 1990s, if anyone's counting), there existed a file transfer protocol called XMODEM that was used to send a file across a link normally used for a terminal, on small, publicly available systems known as Bulletin Board Systems, or BBSes. XMODEM divided a file into packets of 129 bytes, sent and acknowledged one packet at a time. It had a simple 8-bit checksum to verify the file contents which was just "ok" over a reasonably reliable line, line and inadequate on a noisy one. But it was one of the first experimenter-built and widely used protocols.

As it was pushed harder and harder (larger file sizes, higher line speeds intolerant of the small, single-packet handshake) and its weaknesses became more problematic,a number of derivatives were developed to address the weaknesses.

ZMODEM was one of those, which allowed the sender a "sliding window" of packets, so it could keep sending packets (up to the window maximum) without stopping to wait for each acknowledgement, and could use larger packet sizes, among other improvements.

They are relatively easy to implement, XMODEM more-so, and source code or specs can be found by looking around.

If your files aren't horrendously large and the lines are fairly reliable, even XMODEM may be adequate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.