Speaking of clouds, Sketchgarden.co finally launched in Beta (as of 3-13-2012), allowing the remote upload of Arduino sketches over the internet. As I have already have a working specimen running on my Nanode v5 hardware, I popped in the new atmega328 chip, and it couldn’t have been a simpler process.
This have been a long time coming. In my prior post covering the build of the v5 nanode kit, I included details regarding possible remote firmware uploads and tftp bootloaders. Sketchgarden surpassed my expectations by eliminating the requirement for a server or any server side configuration. I only need to worry about configuring my code. Minimal hardware is also a big advantage- they were able to fit the code for everything into the Atmel328p chip in flash and eeprom, aside from the external eeprom used to store a permanent MAC address. (picture)
There are two elements that will be required for widespread adoption – Number one, the release of the bootloader. On twitter, Vic indicated a post-Makerfaire release of the bootloader in a finalized form. In the meantime they plan on shipping pre-loaded chips from wickeddevice.com.
The next element required to get the ball rolling is compatibility with both ENCJ and Wiznet ethernet modules. The Nanode uses the Microchip ENC28J60, while the official Ethernet shield and the Arduino Ethernet use the Wiznet W5100 chip. Both chips are also available as ethernet shields. Support for both chips will enable non-nanode customers to utilize sketchgarden, enabling WickedDevice to reach a critical mass. Boom.
The WickedDevice Nanode V5 is available assembled($49)or as a kit ($39, includes FTDI adapter). The Sketchgarden chip comes preloaded with the custom Sketchgarden bootloader, but is currently listed as unavailable,-It may not be offered for sale until the initial beta is complete.
ON TO THE GOODS
I went ahead and documented the process, including specifics for OSx users:In a nutshell: Install new Chip, configure network settings locally, set up new nanode on sketchgarden.co, Compile hex file and convert to a binary image. Then upload image and assign to your device. Boom. Done.
#1. Install New Chip (available soon at wickeddevice)
#2 Connect to your device on your local network, and change the settings to fit your network as necessary. The settings will be stored to the atmel328 eeprom and will remain static until changed.Note: The sketch seen below is called “SketchGarden Config” to re-load on your device should you need to re-configure your IP address, should you decide not to incorporate
#3 Connect your twitter account at sketchgarden.co
#4 Add your device with the Api key you obtained before.
#5 Compiling your working Nanode/Arduino sketch to hex:
Go to your working arduino / Nanode sketch. Hold down the Shift key and click the > compile button. Look at the last section and identify the file path. If you are cool like me, and have OSX, your files will be hidden in some folder that you can’t see.
That’s ok, here is a shortcut for OSX users. From finder, select Go, then Go To Folder, then paste in your long folder location.
For me it was /var/folders/RZ/RZv65MxvH4GoCj14HxLTjk+++TI/-Tmp-/build654337670699641674.tmp/ sketchname.cpp.hex
locate your file and copy it somewhere you can see it.
Now convert the hex file to a bin file using the tool from sketchgarden – currently a java program called HexToImage.jar, (located in the help menu from sketchgarden.co).
Open a terminal window, and navigate to the directory with your .hex file and the hextoimage.jar app.
Type in java -jar HexToImage.jar yourfilehere.cpp.hex yourfilehere.bin
For me, it was:
java -jar HexToImage.jar PachubeV3_LibTemp_Motion_light_Webserver_SEEDLCD_JH.cpp.hex PachubeV3_SeedLCD_for_Sketchgarden.bin
#6 Upload To Sketchgarden
Take your compiled and converted .bin file and upload it as a new sketch. Dont forget to copy in your source code to remind you of what this file does.
#7 Upload to your nanode
click and drag the file from the left over to the grey square… it took me a few tries, the page seems buggy. then click Upload Sketch.
# 8 Wait a few minutes, then give up thinking it failed….hours later return and rejoice that it actually did work, but you were to impatient the first time around!
Somewhere along the line I had an issue with my nanode resetting every time I try to capture from more than 3 sensors. Currently, I am only capturing Temperature and Light information. The motion capture device (A PIR motion sensor) was randomly freezing my Nanode and causing it to stop reporting data. Unfortunately I uploaded my old code in this ketch, but I should be able to recall what I did to get it to work. I beleive i excluded the reading of those sensor pins, and filled the values with an arbitrary or duplicate value.
It doesn’t look like much, but I made it.