Custom YUN image


I would like to build a custom OpenWRT image for the arduino Yun. I'm pretty familiar with OpenWRT, however i;'m missing a few bits about the Yun integration. I've already managed to disable wifi by setting the appropriate value in the /etc/config/wireless section and by commenting the line


in the /etc/rc.local file.

There are however two more goals that I would like to achieve:

1) making the rest interface Open by default 2) programming the micro at the first boot (I already know how to run a script only on the first boot, however it is not clear to me how to program the micro crom the CLI.

Thanks in advance Roberto


to make the rest interface open by default you have to modify the file /etc/config/arduino ( github ) and change

 secure_rest_api true

to secure_rest_api false.

To program the micro from CLI you have to use avrdude. Here is a little tutorial about avrdude

The linino microprocessor uses the linuxgpio programmer to program the Atmega, and the config file is inside /etc/ so the options for avrdude for programmer and config file, in this case, are:

-c linuxgpio -C /etc/avrdude.conf

The IDE runs 2 scripts to program the atmega, "merge-sketch-with-bootloader.lua" (github) that takes your sketch and creates one executable file with the bootloader included.

The second script is run-avrdude that upload the compiled sketch into the atmega. You have to pass the file name of the executable as a parameter.

You need to run the merge script once and then execute run-avrdude at every boot.