Recently co-hacker Jay pointed this out to me: http://rayshobby.net/esptoy/ It’s basically a little board that has an even smaller daughter board (an “ESP-12”..more on this shortly) soldered right onto it, plus a USB-serial converter, a 3v regulator, an RGB LED and a button, and it boots up running a little LUA-based firmware that let’s you load little LUA sketches on it. He’s actually running the NodeMCU code on it. A very cool little board that let’s you get little Wifi ‘node’ up and going with minimal effort at the very low cost of $17! He also references a project that led him to put together first the ESPToy 1.0, then the current 1.2. The 1.0 basically combined an ESP8266 with an Arduino, but in 1.2, he did away with the Arduino part entirely.
I was intrigued that the author had basically loaded his own firmware onto the ESP8266 (the ‘ESP-12’ module) little device and started digging into it a bit more. So, it turns out the ESP8266 line of modules have their own embedded 32bit processors, the wifi protocol stack and hardware, and some on-board flash. They expose GPIO pins and a serial port. Most amazing of all – you can get “bare-bones” ESP modules for less than $5! So, I decided to dig deeper. The LUA runtime is OK, but there aren’t a lot of libraries out there for talking to other things using it. For instance, I’m currently kicking around the idea of an arduino-powered, web-connected universal IR remote – I’d like the greater versatility of Arduion programming, rather than LUA…and the idea little $5 Wifi-connected arduino-like devices is crazy!
So, it seems like there is at least one project out there to program these suckers using the Arduino IDE and code. I’m going to blog my experience here..
First step – I ordered a couple of different ESP devices. I should point out that there are a bunch of ESP modules (ESP-01 through ESP-12 at this point).
They’re basically all the same chipset in various configurations exposing different pins and with different (or non-present) on-board antennas.
Then there are many device that have an ESP variation mounted on them an break the pins out to more convenient configurations, add voltage regulator and buttons, etc, and are still very cheap (<$5).
I got an ESP-07 on a more-or-less bare motherboard and an ESP-12 on a board that has an regulator, RGB LED, LED’s on several GPIO’s, and apparently a photo sensor. The ESP-07 package included an external Wifi antenna that can be snapped on to provide better range than the on-bard ceramic antenna. The ESP-12 package also came with a USB-serial converter that is necessary to connect to these things. I already had one, but figured a spare wouldn’t hurt. Neither of these had any documentation with them.
I also ordered a couple of the ESPToy’s just for the hell of it too 🙂
Anyway, having the regulate on-bard is big plus, since it will make actually using them with simple 5V (e.g., USB) supplies easy. (Update: I message the eBay seller to tell him it did have a regulator and he indicated the next version will not, since the chip used on this one is pretty low power. ESP-07 drawing a lot of power is a topic I’ve seen more than once…for instance, they say not to try to use the 3V supply from the FTDI serial adapter like the one in the ESP-12 package, above).
So… here goes..
Everything came at the same time. I plugged an ESPToy in first, since it was the easiest – just plug in a mini-USB cable and it powers up. It fires up the first time with a simple demos that goes into Wifi host mode and serves up a simple HTML page that lets you set the RGB values of the LED. It worked fine..ok, time to go drill into the ‘bare’ modules some..
So, at first, I had trouble getting either to do much. Neither would report or respond to anything over the serial port or show up on Wifi. It seems like there is a lot of variation in terms of what the default firmware is intended to do, but supposedly you should be able to get to a command prompt and do AT commands more or less right off the bat. I tried different baud rates – apparently older firmwares may be 115200 or 57600, while the latest is supposedly 9600 – all to no avail. I was focusing mainly on ESP-12 board and, finally, I started wondering about the jumper. To flash new firmwares on these suckers, you have to hold GPIO0 (zero) high when you power the board on – this puts it in firmware flash mode. Maybe the jumper is for doing that? Yes! I took the jumper off (and also verified my conjecture with the multimeter) powered it on and right away, a new Wifi network, “AI-THINKER-9B5AC7”, showed up. It took some googling to find the Wifi password, which is “ai-thinker”. I also now get a whole bunch of output over serial as it starts up (my version is operating at 115200 buad) it shows it’s listening on 192.168.4.1. Hitting that url with my browser now produces a “We have a GET request” message on the serial port.
I still get get no response from AT commands, though. My theory is there is a non-standard firmware on this device that leaves AT mode to run the little HTTP demo app. In bit, I’m going to try flashing it with a newer firmware. At this point I also still haven’t gotten any response at all from the ESP-07.