Turning JET into a live system Jun 2017

The previous article about the redesigned JET model mentioned Folie as sitting between a USB interface and MQTT, presumably to publish received RF messages on MQTT, and to subscribe to an MQTT topic so commands will be picked up and sent out over RF.

But that’s not quite how Folie works right now.

The current version of Folie is aimed at interactive command-line use, for directly-attached µC nodes, and hopefully soon also for remote RF nodes. As the name says, a Forth Live Explorer:

At some point, we’ll want to collect incoming data and to send out commands to specific nodes. This is a perfect task for MQTT - as always-on “message broker” between various processes:

Since MQTT is network based, it does not need to be running on the same machine as Folie.

But Folie is more than a front-end for Mecrisp Forth. It’s also able to send entire source files (and recursively expand further included files), it can upload new firmware to an STM32-based µC via its ROM boot loader, and it can connnect to a Telnet server such as ser2net or esp-link.

The question is: how to create a structure which supports gradual development and growth?

Because JET is not about installing a system, configuring it, and then just “letting it run”. What we need, is a design which lets us add features as the need arises - perhaps downloaded from the net, because somebody else had some neat idea, or else built ourselves as custom add-on.

Just like a city, JET should be able to grow organically, over a very long time, and evolve in ways which cannot be predicted up front: i.e. infra-structure which must be solid and stable.

In JET, MQTT is the only fixed point in the system (along with naming choices for its topics and the message format). Everything else can be changed and replaced over time in case anyone comes up with a clever new way of doing things. With a bit of topic-prefix planning, a single MQTT instance can in fact support multiple approaches running in parallel.

But Folie v2 isn’t quite usable as is: it’s based on direct interactive use (great for development) and not really meant to be used unattended, when some parts of our setup are becoming useful and solid enough to keep them running all the time (e.g. some wireless sensor nodes).

This is about to change. The next major revision of Folie will allow both production mode and development mode to be mixed (and switched) as needed, using a new pass-through mode:

Note that Folie will continue to fully support the original development style, i.e. as interactive console front end for Mecrisp Forth µC nodes, both directly attached and via RF. What’s new, is that Folie v3 now adds SSH to the mix (both as server and as client), due to some terrific recent work by Thorsten von Eicken, who also re-factored the original code to prepare for changes like these (while keeping the !send and !upload functionality fully intact).

Since MQTT can be configured to use SSL connections, this creates a network-savvy context for all JET and JeeNode Zero development, which supports private and secure connections from a development machine, including source code uploads and remote re-flashing.

The intended use is for a small Linux board such as a Raspberry Pi, Odroid, or CHIP to run MQTT and one or more instances of Folie, each talking to their own µC via a USB interface. All development access then takes place from your own cosy development machine, with your favourite code editor, version control tools, and personal backups.

And yet it’s still fully adjustable - nothing prevents you from setting up everything on a single laptop, plugging the µC board into USB, and doing everything off-line, i.e. anywhere you like.

Weblog © Jean-Claude Wippler. Generated by Hugo.