Quantcast
Channel: Articles on JeeLabs
Viewing all articles
Browse latest Browse all 296

A remote console w/ ESP-Link

$
0
0

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:

  • ESP-Link software has to be uploaded to the ESP8266 using another serial FTDI board
  • note that this only needs to be done once: after that, updates can be installed over the air
  • when done, a few jumpers and pins are changed to make it match the normal FTDI pinout

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
ok.
11 22 + . 33  ok.
^D
$

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
ok.
Mecrisp-Stellaris 2.2.4 for STM32F103 by Matthias Koch
\       >>> include h
\       >>> include ../mlib/hexdump.fs
\       <<<<<<<<<<< ../mlib/hexdump.fs (73 lines)
\       >>> include ../flib/io-stm32f1.fs
\       <<<<<<<<<<< ../flib/io-stm32f1.fs (69 lines)
\       >>> include ../flib/hal-stm32f1.fs
\       <<<<<<<<<<< ../flib/hal-stm32f1.fs (134 lines)
\       >>> include ../flib/timer-stm32f1.fs
\       <<<<<<<<<<< ../flib/timer-stm32f1.fs (47 lines)
\       >>> include ../flib/pwm-stm32f1.fs
\       <<<<<<<<<<< ../flib/pwm-stm32f1.fs (52 lines)
\       >>> include ../flib/adc-stm32f1.fs
\       <<<<<<<<<<< ../flib/adc-stm32f1.fs (54 lines)
\       >>> include ../flib/rtc-stm32f1.fs
\       <<<<<<<<<<< ../flib/rtc-stm32f1.fs (43 lines)
\       >>> include ../flib/ring.fs
\       <<<<<<<<<<< ../flib/ring.fs (32 lines)
\       >>> include ../flib/uart2-stm32f1.fs
\       <<<<<<<<<<< ../flib/uart2-stm32f1.fs (31 lines)
\       >>> include ../flib/uart2-irq-stm32f1.fs
\       <<<<<<<<<<< ../flib/uart2-irq-stm32f1.fs (24 lines)
\       >>> include ../flib/spi-stm32f1.fs
\       <<<<<<<<<<< ../flib/spi-stm32f1.fs (68 lines)
\       >>> include ../flib/i2c-bb.fs
\       <<<<<<<<<<< ../flib/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!


Viewing all articles
Browse latest Browse all 296

Trending Articles