Powered by tea

Olimex ESP 8266 dev with Arduino IDE

Bits and pieces of this are everywhere but I’ve not found it all in one place. The ESP Thing docs are excellent and mostly apply to the Olimex too, but there are some subtleties in the setup. I’ve put what I did here so I remember how to do it again.

I had a few ESPs I’d bought in May and not used – these ones from Olimex. I read recently that you can now use ESPs from the Arduino IDE, so I thought I’d give it a go.

The goal is to be able to put some code that uses wifi on the ESP using the Arduino IDE. The basic flow is:

Buy ESP and an FTDI USB to Serial cable, plus a small breadboard and some male-male jumper wires, and a cheap voltage regulator

Solder the ESP’s legs on

Put it in the breadboard

Connect it up to the FTDI cable

Put it in FTDI mode(?)

Plug it in to USB on a laptop and test it using the serial monitor on the Arduino

Download the Arduino ESP environment and load it in to the IDE

Put test code on the ESP and check it worked

Buy ESP, FTDI and other bits

I think if I was buying them now I’d get some of these ESP Things, as they have a bunch of nice features (though not many GPIOs), but the excellent docs seem to apply to the ones I have too.

Edit – I was under the misapprehension that FTDI cables could supply 3.3V. No idea why, unless I misread the labels for some of the other outputs. But anyway: the one I bought doesn’t. You can’t use a voltage divider to get the voltage you want either, because that only works for things with tiny amounts of resistance. But, you can get a voltage regulator (e.g for 99p at Maplin) which gives you 3.3V from 5V happily enough.

5V will fry your ESP (though actually it didn’t fry mine), so do this or use a separate power supply (e.g. 2 AA batteries will work).

Put it in the breadboard

Connect it up to the FTDI cable

Like this:

The ESP will be powered from the FTDI (red jumper). Ground across the board to GPIO0 (21) puts it in FTDI mode (black jumpers). Yellow is RX, orange is TX.

Put it in FTDI mode

The Olimex docs suggest that you need to solder and desolder the dip switches, the three little fellas between pins 3 and 20 in the diagram above. What worked for me is to leave them as they came (which was as in the diagram above, which I think is 0 0 1). I’m fairly confused about why this worked, as the Olimex site says it comes in Flash mode, so maybe I have it upside down or something. But it did work.

Download the Arduino ESP environment and load it in to the IDE

These instructions worked very well for me. Make sure you actually select the board! (or else you’ll get strange errors with compiling and end up down a rathole of installing libraries manually. There’s no need, and they’ll conflict).