One of the most useful tools in the hardware hackers toolbox is a USB to serial adapter. With this, you can flash new firmware to routers, and ply the vast binary seas of embedded hardware. The common form of the USB to Serial adapter is an FTDI breakout board. This requires drivers, though, and there is actually a simpler – and wireless – solution: the ESP8266 WiFi module.
Despite being the best little IoT device on the block, the ESP8266 was originally designed to be a USB to WiFi adapter. In our haste to build WiFi throwies, WiFi blinkies, and freaking WiFi server farms, we seem to have forgotten that there’s still a use for a device that turns a 3.3V TTL into a WiFi connection. It’s the perfect device for reflashing a cheap WiFI router with new firmware, or just providing you with wireless serial connections to go along with your wireless Internet.
This project uses jeelabs’ ESP-link firmware for the ESP8266. It’s a simple bridge between WiFi and serial, and can function as an AVR programmer in a pinch. The web interface for this firmware is very nice, but you really don’t need it; the entire purpose of this firmware is to be even more transparent than an FTDI USB to serial adapter. For the next time you’re flashing a router with OpenWRT, don’t bother digging out the USB adapter; an ESP is all you need.
22 thoughts on “Use The Esp As A Serial Adapter”
Isn’t it already a serial -> WiFi adapter? What do you mean?
I think he means a wifi to serial adapter…
they seem to be suffering from amnesia.
they forgot usb to seal is not that useful. people have, you know, serial ports.
then they forgot that is exactly what the esp is made to do.
and lastly they forgot they already published this… sigh. is this the Slashdot of electronics?
I don’t have any (UART) serial ports. I haven’t since WindowsXP…
> people have, you know, serial ports.
That is not even remotely true.
The vast majority of people work with laptops now. No DB9’s on there.
It is *fairly* ridic that we still cling to the ghosts of DB9/RS232/TTL UART serial.
Opps deja vu :-)
Duplicate story. First mentioned last month: https://hackaday.com/2015/09/18/transparent-esp8266-wifi-to-serial-bridge/
Hmmm… I must have missed that story because I don’t recognize it. But it’s a nice idea anyways. I have to config one of my modules for this and plonk it down into my toolbox….
. simpler than FTDI
. supported working and stable baud rates
. working HW handshake
. Configurable buffer sizes
. Don’t bother thinking about power supply. USB provides power.
Apart from the last one, those could be really useful information worth mentioning, because ESP8266 had issues with those for a long period of time. Why use a messy UART adapter? Just to make your life harder?
Having a widget that can easily be used to bootload/flashprog a bunch of common micros, and then give a little bit of interactivity, would be pretty wonderful, if it is all baked into the ESP and “just works”.
“[T]he ESP8266 was originally designed to be a USB to WiFi adapter” should be “the ESP8266 was originally designed to be a serial to WiFi adapter” — ESP8266 doesn’t have USB support.
I have tried to use the ESP-LINK to replace a USB/UART converter on the serial console of a embedded Linux system. While it somehow work, it’s not reliable enough. There is missing characters, and the connection drop after some time for no reason as the Wifi router is just 1 meter away. There is also many strings injected into the console while the ESP boot.
While the idea is very good, the implementation need to be rock stable to be useful in a real project. Also the firmware is fare too big for a such simple use. No need to have a such complex web server, a simple command mode on the console will be enough for this kind of use. The mDNS would be a more useful feature.
I’ve been using this more minimal firmware:
When the last Hackaday article came out I tried ESP-LINK and also found it unreliable. It also ran the ESP hot enough to burn my fingers. There was a bug report about high power consumption due to one of the GPIOs dumping power into one of the onboard resistors. So maybe that was the issue and it’s fixed now.
The firmware above runs the chip at barely above room temperature and supports more baud rates too. Configuration is done via AT commands on the console.
Thx for posting. Would be super if someone (more knowledgeable than me) published a very detailed how-to example project using this firmware. Would be very valuable especially to relative noobs in the Maker community.
im kinda suprised nobody has modded the esp8266 to be used as a wifi dongle yet.
I’ve been using the $10 USR-WIFI232-T as a WiFi to serial device for a while now. I’m surprised that it’s taken well over a year for something like this to be possible with an ESP8266. In my assessment this is the ideal application of the ESP8266. I prefer to add WiFi capability to the microcontroller of my choice (and do it for $3!!!) than to have to develop code for the ESP8266’s onboard MCU. I will definitely be looking into it. Thanks for posting this hackaday,
“I prefer to add WiFi capability to the microcontroller of my choice (and do it for $3!!!) than to have to develop code for the ESP8266’s onboard MCU”
Sure… but two comments:
– the stock AT firmware, and as mentioned above, the current firmware for wifi-serial, are useable, but not completely without problems
I understand. But I still prefer to develop for a microcontroller of my choice and add a device dedicated to doing WiFi. I’m not a big fan of ‘here’s the chip and buggy sdk and good luck’. In order to get proper hardware documentation you have the sign your life away.
I also like to use parts that can be easily sourced for distributors in N.America. This wasn’t the case with the ESP8266 a few months ago. Though to be fair, I’m pretty sure that you can get ESP8266 modules right now from N.American resellers if not the I.C.s
Now I don’t mind getting a ‘plug’n’play’ ESP8266 breakout board / black box product that’s a dedicated WiFi to Serial router in much the same vain as an FTDI USB to serial converter…so long as I know it works well and that I don’t have to develop code for it…I’ll gladly pay $3-$5 for the device and plug into my projects as needed. That’s why I’m a big fan of the USR-WIFI232-T, HF-LPT100 and HLKRM04 devices.
It’s a shame that the wifi-serial firmware mentioned above is still somewhat buggy. But I do believe that its a step in the right direction…at least for my purposes.
esp-link is rock solid for me, but not the 1.0.1 version they are linking to on the guthub page, 1.0.4 is latest. My esp-01 also has no issues programming an arduino.
I tested this ESP-Serial link with a Micromite controller : usable and funny (http://synthelectro-fr.blogspot.fr/)
Now, what about using a serial adapter as an ESP? That would be the real hack methinks.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)