Use The Esp As A Serial Adapter

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

      1. 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?

    1. 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….

  1. You say:
    . simpler than FTDI
    I say:
    . 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?

  2. “[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.

  3. 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.

    1. 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.

      1. 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.

  4. 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,

    1. “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
      – the embedded processor in the ESP8266 is ridiculously powerful for $3. As we’ve seen 99% of what people want to do with wifi-enabled microcontrollers can be programmed into the ESP8266 itself, and in most cases it’s no harder than writing Arduino code. There are several choices for programming on the ESP8266 besides C/C++; Lua’s been around for a while and there are projects for enabling Python, Basic and even Javascript on the ESP8266.

      1. 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.

        That’s just my preference. I like to use microcontrollers with proper documentation and possibly tools…at least a proper reference manual, datasheet e.t.c. I like to program them in C/C++ as I’m not a fan of using LUA, Python and especially Javascript on microcontrollers. Those high level languages in my humble opinion are not ideal for use in bare metal embedded development. Arduino is great for getting kids and young adults into programming…and fast prototyping…it’s not a platform that’s suited to least not always.

        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.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.