Arduino Yun - auto update sketch

Who can help me with auto update arduino sketch.

I have an arduino yun with a software running on it, for example V1.0

I want to modify my software sketch, for example add or modify some value’s V1.1

How can i proceed that the arduino Yun checks every day @ 8pm to see if there is a new version of the sketch?

Is this possible or not?

Not at Yun but Yun shield.

Since Firmware 2.0.4, auto update sketch is supported. With this feature, the Dragino’s will connect to a http server and get the latest sketch version and upload the sketch with this version.

http://wiki.dragino.com/index.php?title=Getting_Start_with_Arduino_Yun#Auto_Update_Sketch

will this be implemented on Yun or where can i ask this?

Regards

It shouldn’t be too hard to do the same thing as the Yun Shield’s function, at least the core part of it, if you know a little bit about Linux scripting. But if you want the fancy web GUI, that’s more work.

First off, cron can be set up to automatically run a script daily at a designated time. (Search for Linux cron or crontab for information.)

The script can then go out over the network and fetch the compiled sketch’s .hex file from a server. You could use curl or wget to do that. (Search for Linux curl or wget for information.)

Once you have the file, compare it to the last loaded file to see if there are differences. If so, save the new file for comparison next time. (Search for Linux cmp for information)

To actually program the sketch into the '32U4 processor, make a copy of the hex file, and run:

/usr/bin/merge-sketch-with-bootloader.lua <name>
/usr/bin/run-avrdude <name>

where is the name of your temporary sketch copy. The first command will merge the Arduino bootloader with the sketch’s hex file (overwriting the original file, which is why you’re making a temporary copy) and the second command programs it into the '32U4 processor.

So, basically, you need to write a Linux shell script that fetches a new copy of the script hex file, checks to see if it is a new version, and if so, merges it with the bootloader and programs it into the processor.

Open source:

https://github.com/dragino/openwrt-yun/blob/master/dragino-packages/luci-app-sensor/root/usr/bin/auto-update-mcu.sh

Interesting... That Dragino source doesn't pretend the bootloader onto the hex file before burning it to the MCU. Probably because the Yun Shield can be used with a variety of boards and processors, and it doesn't know which bootloader to use? I guess the instructions must indicate that the bootloader already be added to the sketch image before setting up the update file?

ShapeShifter: ...I guess the instructions must indicate that the bootloader already be added to the sketch image before setting up the update file?

+1