Programming an Arduino over WiFi with the ESP8266

A lot of people have used ESP8266 to add inexpensive WiFi connectivity to their projects, but [Oscar] decided to take it one step further and program an Arduino over WiFi with the ESP8266. [Oscar] wrote a server script in Python that communicates with firmware running on the Arduino. The Arduino connects to the server on startup and listens for a “reboot” command.

When the command is received, the processor resets and enters the bootloader. The python script begins streaming a hex file over WiFi to the ESP8226, which relays it to the Arduino’s bootloader. Once the hex file is streamed, the microcontroller seamlessly starts executing the firmware. This method can be used with any AVR running a stk500-compatible bootloader.

[Oscar]’s writeup is in Spanish, but fortunately the comments in his Python and Arduino code are in English. Check out the video (in English) after the break where [Oscar] demonstrates his bootloading setup.

 

17 thoughts on “Programming an Arduino over WiFi with the ESP8266

  1. Wow that’s a hell of a security hole! I guess that doesn’t matter for toy robots but for the places where I would want firmware-over-wifi (i.e. programmable devices doing important things in hard-to-reach places), I would want a much more-secure approach. The whole point of over-the-air updates is that it’s a big hassle to get to your device, so you want the update process to be really really safe and fault-tolerant.

    When I last did this, the digitally-signed firmware update gets streamed to an external EEPROM or flash device. The bootloader contains a public key and uses that to verify the update; if it’s both valid and newer than the one on the device, it installs it. If it fails to boot properly a few times, it will revert to the previous firmware image.

    1. Agree! They need to make that $5.00 board a couple bucks more expensive with a USB port and make an awesome IDE and community like Arduino so we can program that processor directly and easily.

      In all seriousness through – I did download the IDE but ease-of-use is not a strong point. I believe that the MSP430 stuff didn’t take off in a big way is mostly due to the IDE. Heck those were $5.00 boards with similar features to an arduino. If someone makes an Arduino like IDE that support wiring and has a nice click to upload button these things would take off in a big way.

      1. Arduino is considered to be “a big success” and they bow and scrape to the gods of Atmel but it really doesn’t make a lot of money for Atmel. Shoot, Atmel has their very own development system that competes with Arduino, so Atmel is actually working against the interests of Arduino. Nobody is going to expend the vast efforts of development and documentation and support for projects that don’t even begin to pay for themselves.

        Face it, making life easy for newbies is a fun goal but it is not going to happen in this case because there is no business reason. Anyone who has the gumption to make an actual product that is going to result in actual sales is going to “do it right” and work directly with the manufacturer and their tools so that they can be assured of quality support and continued supply.

        And it’s pretty telling that Arduino development has pretty much ground to a halt. Arduino Due has been around for a long time now and its development environment is still considered an “experimental fork”. This is a clear sign of a lack of development resources and it’s not a good sign at all.

    2. puny human beings use 4000 pound steel automobiles to transport just themselves

      retail stores everywhere use 64-bit Windows systems to calculate the change for your groceries

      and maybe you can tell us how to run a wifi radio with an atmega

  2. Would be cool to skip the bootloader and instead program the ESP8266 to flash the AVR directly over SPI. I guess it won’t be long until we see WiFi enabled Flash programmers for popular micros. Even JTAG would be possible.

  3. if they sort out the security issues then this could become the standard way to update firmware on devices. This solution is even cheaper than the ST-LINK debuggers that ST puts on their evaluation boards. And maybe some people will stop freaking out over the fact that debuggers and bootloaders can be more sophisticated than the gear that they support.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s