Adding a remote serial console to an ODROID C2
In a previous post I mentioned that I used an ESP8266 as a WiFi to serial console bridge. Having a secondary method to connect to a headless computer is a functionality that is very common when it comes to commercial servers. When working with servers and network equipment unexpected situations will make it necessary to have the means to continue managing, power cycling or even reinstalling software in the equipment remotely. The most complete solutions implement out-of-band management which provides access to the equipment via a dedicate communication medium. The WiFi to serial console bridge in this post falls under the in-band management classification. This is because it uses the same medium for management as the computer uses for normal communications, requires support on the part of the computer to work, and requires the computer to be powered on.
Materials
To build this WiFi to serial console bridge you will need:
- An ESP8266 board. I used an ESP-01 as it was the most easy to source at the time and one of the smaller modules available for this microcontroller.
- Wire cutters
- Wire strippers
- Solder iron
- Solder wire
- 4 wire connector set
- 3 x 10k ohm resistors
- ODROID C2
The ESP8266 is a low cost microcontroller with a full TCP/IP stack and wireless capabilities. It is manufactured by Espressif Systems and has become very popular.
The firmware
The first step is to program the ESP-01 with the firmware that will provide an terminal in a web site over WiFi. Original I built my own firmware but since have found the espterm-firmware. This firmware emulates a DEC VT-100 terminal inside a webpage over WiFi.
Since the ESP-01 provides just the bare minimum hardware, to burn the espterm firmware you need an ESP-01 programmer. This is needed to place the ESP-01 in “flash mode” so that it accepts new firmware code, otherwise it boots in “run mode” and will only execute what’s already in its flash memory. You can purchase one or you can build your own with a few parts.
To flash the firmware to the ESP-01, espterm recommends using the free open source esptool tool.
Download the latest version of espterm from the releases page and uncompress it. Among the uncompressed files there will be one called flash.sh that will call esptool with the required arguments to burn the firmware to the ESP-01.
Cabling
The ODROID C2 uses Molex 5268-04 connector for the serial console. I have not been able to source this connector so I remove it and use another easier to find, 4 pin, keyed connector.
Connectivity
By default the espterm boots up in passwordless access point mode with an SSID of “TERM” plus a random number sequence. It also enables its own DHCP server. In this mode only computers with a WiFi card will be able to connect to it.
Continuing with the theme of my last post, as you've have seen, scaling up is not the only way to get things done. We've managed to build a remote management solution using a $3 USD microcontroller module. Remote management is an old concept, but that also teaches us that: just because an idea is old doesn't mean it is not still useful :) Happy hacking.