Yún – Sketch Uploader

by luca
17 comments

Usage

To upload the compiled version of your sketch, first you need to find out where the IDE saves that version.

Open the File menu and click on Preferences:

Flag the Show verbose output during compilation option:

Open your sketch (in the following example I’m going to use the “classic” Blink) and click the Verify button:

When the IDE complete the compiling process, scroll the output window until you find the full path of the compiled file (.hex):

Open the folder and verify that the file is present:

Now connect to sketchUploader’s URL (http://yun_ip/sd/sketchUploader/) and type the Yun’s password (by default it is arduino).

Click on the button to load the hex file:

and choose the file you previously identified.

sketchUploader will peforms the three steps automatically and, if everything is ok, after a few moments your sketch will be uploaded and running on the ATmega:

Very easy 😉

For Internet Explorer users...
The upload process may take some seconds, depending on the sketch size. On some computers I found that Internet Explorer has a very low timeout (10 seconds) for the Ajax calls and this can cause errors.

You can change the timeout’s default value (in milliseconds) through the following registry key:

Related Posts

17 comments

Dario Thursday February 13th, 2014 - 11:09 AM

Bravo. Adesso torna su CBC 😉

Reply
Dario Wednesday February 19th, 2014 - 04:46 PM

“08 visitor(s) online”
fai tornare su CBC anche gli altri 7

😉

Reply
Michael Friday May 23rd, 2014 - 06:56 PM

This is so cool! Great work!
Is it possible to copy/padte the .hex path into the uploaded (instead of navigating to file) since this path changes erverytime… and we have to get this path from IDE window anyway?

Reply
luca Friday May 23rd, 2014 - 07:47 PM

Hi Michael,

thanks! it requires some changes in the javascript code to add a text box where you can paste the path of the hex file… but of course you can paste it in the “open file” dialog instead of navigating to file.

Reply
Michael Saturday June 7th, 2014 - 03:09 AM

Hi Luca,
I found a strange behavior… sketchUploader loads and reboots Yun… but the code is not actually changes. I get errors like this.. when uploading via ethernet or with sketchUploader. Wifi and usb work just fine. Have you seen this before?

====================
vrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

/usr/bin/run-avrdude: line 4: can’t open /tmp/efuse: no such file
rm: can’t remove ‘/tmp/efuse’: No such file or directory
sh: 203: unknown operand
====================

Reply
luca Saturday June 7th, 2014 - 10:42 AM

Hi Michael,

that’s strange, it seems the “linux” part of the Yun can’t communicate with the atmega32u4… are you able to upload sketches using the Arduino IDE via wifi?

Reply
Michael Monday June 9th, 2014 - 02:40 PM

Hi Luca,
I use 1.5.6-r2 IDE, and recently updated the firmware to the latest from Arduino.
Wifi and usb upload work fine. I think sketchUploader worked fine at first (confusing now)… but sketchUploader and ethernet definitely don’t work now on multiple Yun modules.
Still scratching my head. I really like your sketchUploader.. it should be a standard package that makes the Yun so much better!

Reply
Tom Russell Friday January 23rd, 2015 - 07:06 PM

Is it possible for the Yun to fetch the upgrade from a remote website and then do the sketch update? This would avoid the need to access the Yun from a remote site when it is likely behind a firewall.

Tom

Reply
luca Friday January 23rd, 2015 - 08:51 PM

Hi Tom!

Of course you can write a script that fetches (via wget, http://ftp...) the new sketch and run the commands to program the ATMega… you gave me the idea for a new blog post 😉

Reply
Gabriel Sunday January 25th, 2015 - 03:30 PM

Hi!!

Firstly, thanks for your work, the project is amazing and very useful for arduino.

I have been done everything you say in this post and even tried the php example webpage with success, but once I tried with the sketchUploader webpage it appeared with a white background and a simple style.

I have tried that webpage on my computer and even with the dreamweaver editor and it seems that it is a problem of the webpage directly. Have anyone tried to the las update of this project? I downloaded it from the official repository.

Anyway, thanks a lot for your job luca!!

Reply
Gabriel Sunday January 25th, 2015 - 03:32 PM

Sorry, there’s an error in the last post. I wanted to say “I have done” in spite of “I have been done”.

Reply
luca Saturday January 31st, 2015 - 10:09 AM

Hi Gabriel… could it be that you didn’t install PHP (or one of its required modules) on the Yun? Anyway, did you notice that the latest official images include a “built-in” sketch upload feature?

Reply
JT Tuesday April 21st, 2015 - 01:47 AM

I get the sketchuploader page but why does it just sit there after I enter arduino for the password?

Reply
luca Tuesday April 21st, 2015 - 12:46 PM

Hi Jeff,

very strange, did you install PHP and all the requires packages? Anyway, the new version of Linino do include a “builtin” function to upload sketches, did you try it?

Reply
JT Tuesday April 21st, 2015 - 11:39 PM

yes all packages confirmed installed. Can I install the latest linino from 5 days ago or do I need the arduino one for my yun? thank you!!

Reply
luca Wednesday April 22nd, 2015 - 11:36 AM

Download the latest OpenWRT image from http://www.arduino.cc/en/Main/Software#toc8

Reply
JT Thursday April 23rd, 2015 - 01:45 AM

ok all upgraded ran all steps from scratch, I can connect to http://192.168.1.33/sd/sketch/index.html
and I type in arduino for the password, click on log in but nothing happens, what may I be missing? thx again for helping!

Reply

Leave a Comment

13 − three =