A remote console w/ ESP-Link May 2016

The ESP-Link is a clever project, which turns an ESP8266 WiFi module into a transparent serial link - sort of a wireless FTDI interface. Thorsten not only created a really powerful software package for this, he also built a few prototypes to turn this into a small “BUB-like” package:

Here’s the schematic of what’s on this board:

An ESP8266 and a switching regulator to bring the 5V down to 3.3V, basically. And some very finicky choices of pins and jumpers to be able to use this in various ways:

This is all documented on the ESP-Link project site. It can be a slightly tricky business to get going initially, but after that it’s a delight to use.

The ESP-Link presents an impressive home page for configuration and use from a browser:

If you want, you can even use its web-based console page for everything:

Note the reset button, which makes recovery of runaway code in Mecrisp a breeze.

But that’s all icing on the cake. The main use of ESP-Link is as a socket-based telnet connection. For this reason, the Forth Line evaluator tool has now been extended to also support telnet:

$ folie -p jemesp:23
Connected to: jemesp:23
11 22 + . 33  ok.

A telnet connection will be used when the path to the “serial port” has the format shown above, i.e. ending in a colon and network port number - else folie falls back to normal serial port mode.

Best of all, (remote!) uploading via include <filename> in folie still works as expected:

$ folie -p jemesp:23
Connected to: jemesp:23
Mecrisp-Stellaris 2.2.4 for STM32F103 by Matthias Koch
\       >>> include h
\       >>> include ../flib/mecrisp/hexdump.fs
\       <<<<<<<<<<< ../flib/mecrisp/hexdump.fs (73 lines)
\       >>> include ../flib/stm32f1/io.fs
\       <<<<<<<<<<< ../flib/stm32f1/io.fs (69 lines)
\       >>> include ../flib/stm32f1/hal.fs
\       <<<<<<<<<<< ../flib/stm32f1/hal.fs (134 lines)
\       >>> include ../flib/stm32f1/timer.fs
\       <<<<<<<<<<< ../flib/stm32f1/timer.fs (47 lines)
\       >>> include ../flib/stm32f1/pwm.fs
\       <<<<<<<<<<< ../flib/stm32f1/pwm.fs (52 lines)
\       >>> include ../flib/stm32f1/adc.fs
\       <<<<<<<<<<< ../flib/stm32f1/adc.fs (54 lines)
\       >>> include ../flib/stm32f1/rtc.fs
\       <<<<<<<<<<< ../flib/stm32f1/rtc.fs (43 lines)
\       >>> include ../flib/any/ring.fs
\       <<<<<<<<<<< ../flib/any/ring.fs (32 lines)
\       >>> include ../flib/stm32f1/uart2.fs
\       <<<<<<<<<<< ../flib/stm32f1/uart2.fs (31 lines)
\       >>> include ../flib/stm32f1/uart2-irq.fs
\       <<<<<<<<<<< ../flib/stm32f1/uart2-irq.fs (24 lines)
\       >>> include ../flib/stm32f1/spi.fs
\       <<<<<<<<<<< ../flib/stm32f1/spi.fs (68 lines)
\       >>> include ../flib/any/i2c-bb.fs
\       <<<<<<<<<<< ../flib/any/i2c-bb.fs (49 lines)
\       <<<<<<<<<<< h (57 lines)
\ done.

There’s still a buglet in this setup: the “reset” word leads to a runaway loop of “Unhandled Interrupt 00000003” - but this can be recovered through the reset button on the web page. The same happens with eraseflash and any other word indirectly calling reset.

Perhaps it’s related to timing or the junk character generated by Mecrisp after such a s/w reset?

Anyway… thanks to ESP-Link, it’s now possible to tinker with the JeeLabs Energy Monitor prototype from anywhere in the house. A huge convenience!

Weblog © Jean-Claude Wippler. Generated by Hugo.