Upload sketch from Linux side without a PC ?

I have not been able to find out whether it is possible to have a .ino file on the Yun SD card and have the Yun upload that to the Arduino without any connection to a PC.

What I have in mind is to have a few different SD Cards for different purposes. Plug card A into the Yun and it boots and becomes one type of device. Plug card B into it and it becomes a different device because it has uploaded a different .ino file to the Arduino side.

...R

No, it is not possible to upload a .ino file from the SD card to the '32U4 processor.

But is is possible to upload a compiled sketch stored as a .hex file into the '32U4 processor.

The process is to compile the sketch in the IDE, then look for the resulting .hex file. Copy that to the SD card and put it in the Yun. Then run:

/usr/bin/merge-sketch-with-bootloader.lua /www/sda1/<sketchname>.hex

That adds the Arduino bootloader to the .hex file. You can skip that step if you plan on no longer using the USB port to upload sketches, but I don’t know that I would be comfortable doing that myself. You do want to make sure that you only do this once, otherwise you will get multiple copies of the bootloader appended to the sketch if you run this step every time you boot.

Then, the .hex file can be programmed into the '32U4 processor using:

/usr/bin/run-avrdude  /www/sda1/<sketchname>.hex

See this thread for some more details: automatic uploading of hex file from micro sd card at power up on Arduino Yun

ShapeShifter:
But is is possible to upload a compiled sketch stored as a .hex file into the '32U4 processor.

Thanks very much. That would achieve what I have in mind.

It's rather a pity that The Yun can't also compile the code.

...R

Robin2:
It's rather a pity that The Yun can't also compile the code.