New toys! ESP8266

esp8266So it seems that since the Arduino WiFi module was a complete failure in the teasmade (well not complete, just unreliable and who wants their tea to be unreliable). I ordered a couple of ESP8266‘s. These are quite a hot topic at the moment, basically it’s just a serial port over wifi.

The intention is to control my book case lighting with them, so I want to do a few things while testing. Firstly the initial concept is to be able to send a RESTful command to turn a light on/off, Simple enough. Second I want to be able to send a value and have the lights set to that value e.g. 255 which will set the brightness. Third, I want to be able to have the ESP8266 send a RESTful command to a php test server elsewhere on the network. Finally, I want to be able to send a “status” message in JSON on request.

All of these simple tests provide the fundamental elements for creating the interactive home environment. A series of RESTful servers which chitter chatter with one another. There are lots of devices on the market which do these types of things and that’s where the Internet of Things (IoT) market is growing from.

I’ll post the wiring diagram and code for this once I’m done.

I’m still working on the NRF24L01 mesh, I’ve been working towards putting a simulator together so I can simulate a few thousand devices on the network together I’m also considering the encryption system and stuck trying to figure out whether I should use AES or 3DES… Of course all of this takes memory on the tiny little Arduino and there in lies the rub as Shakespear would say. I recently finished the fragment disassembly and re-assembly code, this isn’t going to be used very often, but it represents a step over an obvious flaw in most IoT networks which is message size. I need to be able to send JSON encoded message blocks which are larger than 255 bytes and that’s where fragmentation comes in.


I just added some code to github for getting started with this, but it needs some tinkering to get working properly. I’m suffering from some random crashes in the code on Leonardo, but that board has always been a little skittish. The nano with software serial was giving more success until the ESP8266 started to go into some kind of reboot loop. I’m yet to try the Mega or an Uno but I’ve got those hanging around too so I can give them a blast. The eventual target would be an arduino micro, without any FTDI plugged straight into the ESP2866’s serial port. Then the LED light hooked up via a decent power mosfet to one of the PWM ports with a low-pass filter on the gate. I might not even need the low pass filter with these LEDs so I’ll probably test it without first.

[auction-affiliate tool=”lister”]