How to Use an ESP8266 Board as a WiFi to Serial Debug Board

Telnet and SSH are great to access a Linux device, machine and computer remotely when they are already running, but when you are working on the bootloader and/or kernel themselves, you’ll have to use a serial port to access the terminal / serial console. Boards used to get an RS232 port which you connected to your computer with a NULL modem cable, but these days, most boards and devices expose TTL signals and require a USB to TTL debug board to access the console via a USB cable. If you only have one device close to you computer that’s fine, but if your testbed is a little further. or you need to access the serial console on multiple boards you could consider using ESP8266 module to export the terminal over WiFi.

ESP8266_Wifi_to_Serial_Debug_BoardThis is exactly what Zoobab did above with a GL.inet router running OpenWRT and NodeMCU board with ESP-12(E) module based on Espressif ESP8266 WiSoC. The wireless module is powered by a mico USB cable, and its GND, TX, and RX pins are connected to the corresponding router’s pins. Both works at 3.3V so no voltage conversion is needed, but with some other hardware it may be necessary to convert 5V to 3.3V.

The next step is to flash NodeMCU with ESP-LINK firmware, which connects an attached MCU to the Internet using an ESP8266 Wifi module. Now you can access the router terminal via ESP8266 board web interface.

Click to Enlarge
Click to Enlarge

That’s great with a little, or maybe not so little, caveat: it’s read-only. So if you want to input text in the serial console, you’ll currently have to telnet to your ESP8266 board to access the router’s serial console.

esp8266_telnet_serial_consoleThe implementation is still work in progress, as more complete documentation must be written, more features are planned (web console input, https console, etc…), and a few bugs still persist such as Ctrl+C not working with telnet. To work around the latter you can use Putty or socat, which can also allows to upload files over the serial link using Serio Python script.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

7 Replies to “How to Use an ESP8266 Board as a WiFi to Serial Debug Board”

  1. I’ve also asked Zoobab about some more use cases:

    1. Upload new firmware in /tmp when the network is broken: I linked serio on my page;
    2. For the multiple devices use case, I think the ESP could control some kind of “aiguillage” to be able to route the TX+RX+GND to another serial port; I will have a look what can be done in terms of circuit;
    3. Control the RESETor the POWER buttons of a device (this is actually supported for AVRs, but for standard routers, I have to see how to connect it). I have some relays in 3.3V/5V, which is easy to integrate if you want to cut the USP power;
    4. HTTPS integration so that you can have a web serial console through a web portal on the Internet.

  2. The glinet router has also a 3 pins connector (RX, TX and GND), and the VCC 3.3V is on another connector. So it would be possible to power the ESP without an external USB power supply. I have to solder one pin on the Glinet to expose the hole as a male pin.

  3. If someone has any ideas on which chip to use to connect multiple TTL serial ports, and to switch between them. I would suspect this kind of chip to be configurable via I2C or similar.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC