How the ESP8266 Community Added Arduino Support for the $5 Microcontroller

Arduino Internet of Things Technology
How the ESP8266 Community Added Arduino Support for the  Microcontroller
The ESP8266 SoC on an ESP-01 breakout board.
The ESP8266 SoC on an ESP-01 breakout board.

The ESP8266 is a UART to WiFi SoC built around a Tensilica Xtensa LX3 processor — shipping on a somewhat bewildering variety of breakout boards — the most commonly available being the ESP-01 which has a tiny form factor and can cost less than $5. However perhaps the most interesting thing about it is that it is now supported by the Arduino IDE.

The ESP8266 can’t do everything you could do with an Arduino. However it doesn’t have to do the same amount, because at $5 you can afford to buy 5 or 6 of them for the price of a single Arduino board. That’s a big deal.

The ESP8266 was already well on its way to becoming — almost by stealth — one of the leading platforms for the Internet of Things. It’s super cheap, and super easy to work with, and it’s actually fairly easy — as such things go — to get your hands on, which makes for a refreshing change. However the arrival of Arduino-compatibility has now opened things up to a much larger audience.

“This is inexpensive enough to be very much in the territory of ‘thousands of sensors-launched-out-of-a-cannon’-cheap.” — Brian Jepson

A few days ago I sat down with Richard Sloan who runs the community site ESP8266.com and who, along with Ivan Grokhotkov, did the work to add the ESP8266 to the Arduino IDE. We talked about that, and where he sees the ESP8266 fitting into the current market.

Make: The ESP8266 has come a long way really quickly, and now has a large community gathering around it. Why do you think that is?

Sloan: I think the ESP8266 has come so far so quickly due to the low price and ease at which you can acquire a board with the chip in place, it gave the makers/hackers a challenge, to master this low cost beast.

Make: You’ve just released a version of the Arduino IDE that supports the ESP8266, can you tell us about the work that went into that?

Sloan: Almost 3 months to get it to the point its at now, we did lots of testing on real hardware and wanted to release a product that was most of the way done, with a solid code base.

Make: Did you face any major architectural issues or other problems while implementing support?

Sloan: The application needs to be multitasking due to the TCP and WiFi stacks, and Arduino code is inherently blocking, so care needed to be taken to return to the multitasking ESP code as to not break it. If a user is going to code a blocking routine they need to call delay(0) or yield() to prevent the code breaking and the watchdog firing.

Make: The new 1.6.2 Arduino IDE has added additional hooks for third-party board support, do you anticipate merging your support into the mainline IDE at this point?

Sloan: Yes we do, we need to work with Arduino LLC on that.

Make: Arduino-compatibility will certainly increase the appeal of the module, what sort of limitations or surprises should someone from a traditional Arduino background coming fresh to the platform look out for?

Sloan: Basically you have limited I/O and limited peripherals, that’s about all that is different. There is a UART but no real SPI or I2C, those are going to be handled in a bit banging fashion.

Make: What would be the difficulties in porting existing Arduino code to the new module? I’m especially thinking here about library code?

Sloan: Again, I/O is an issue for sure, most standard libraries currently work, and if they don’t it’s normally a quick fix, unless they have included tonnes of direct AVR hardware calls.

Make: The ESP8266 commonly ships in a number of different board form factors, can you tell us about those, and which you’d recommend for different types of projects?

Sloan: I currently play a lot with the ESP-01, but the ESP-12 seems to be getting popular due having all the I/O pinned out on it.

Make: Apart from the price, is there anything else that especially recommends the platform? What niche do you see it fitting into?

Sloan: It fits really well with devices that only need a few I/O, that’s its shining point, and to date the data speed throughput has been a little bit of an issue, so nothing that pumps too much data.

Make: How do you see the platform developing with time?

Sloan: I think the next step will be I/O co-processors to extend its usage… We are working on that now, but no details are yet available, that can be for the next article.

We recently posted a three-part series on the ESP8266 microcontroller.  The first part of the series introduces the board, the second covers the installation of the new Arduino environment and building and uploading your first sketch, while the final part talks about creating a breadboard adaptor for the ESP-01 breakout board.

Discuss this article with the rest of the community on our Discord server!
Tagged

Alasdair Allan is a scientist, author, hacker and tinkerer, who is spending a lot of his time thinking about the Internet of Things. In the past he has mesh networked the Moscone Center, caused a U.S. Senate hearing, and contributed to the detection of what was—at the time—the most distant object yet discovered.

View more articles by Alasdair Allan

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK