Close

Custom ESP8266 Firmware

A project log for Mirobot - WiFi robotics kits for kids

Mirobot is an Arduino-based WiFi robotics kit that's designed to help teach kids about technology

ben-pirtBen Pirt 04/28/2015 at 11:212 Comments

I love this chip! Being able to write custom firmware that runs on the WiFi module has opened up a lot of opportunities for improving the whole user experience for Mirobot. I thought I'd write up a few more details about what I'm doing on the module because I think it would be pretty useful for lots of projects, not just this one. At the moment I'm using the basic ESP-01 module:

I chose this version because besides being the most widely available, it's also easy to plug straight into the board, rather than needing surface mount soldering.

At the moment, it's running a web server and a WebSocket server which means you can use the built in web pages to control an Arduino from your browser via WebSockets, which is what I'm doing with Mirobot and it's working great. It means your control app is self-contained and will run in any browser because it's just static Javascript.

You can check out the code from my GitGub repository and then build it using ESP-Open_SDK. If you want to modify the web pages, just replace the files in the "html" folder and run "make flashall" again to flash it to the module. There's also code in there to let you upgrade the web pages over http.

One of the other things I'm quite pleased about is that it can reflash an attached Arduino if you connect up GPIO0 to the Arduino reset pin. It can talk the STK500 Arduino bootloader protocol, which means that you're able to drag and drop an Arduino firmware file onto a web page and it will flash the Arduino over WiFi. I've coded it so that this happens in two steps; first it caches the binary file in the WiFi module flash and then it sends it across to the Arduino. Works a treat.

There are a bunch of other things I'd like to add to this code, including a captive portal for when you're configuring it and Zeroconf so you don't need to use IP addresses and what's great is that because this chip has such a growing open source following, people are already working on things like this.

Take a look at the code and have a play around if you're interested! If you want to play around with it in a robot, then take a look at the Mirobot Kickstarter!

Discussions

Ben Pirt wrote 06/24/2015 at 08:05 point

For the captive portal, the web server library that I've been using (libesphttpd) recently included its own captive portal which seems to work pretty nicely. Now I just need to add in Zeroconf and it should all be nice and findable on the network.

  Are you sure? yes | no

mpinner wrote 06/24/2015 at 01:24 point

thanks for sharing your progress and process. 

i've been working on a captive portal as well. this seems a great starting point: http://www.areresearch.net/2015/06/captiveintraweb-now-running-on-olimex.html

  Are you sure? yes | no