Messaging off the grid with Meshtastic

Standalone Devices

Last year, two new user interfaces specifically designed for standalone Meshtastic devices were developed, although they're still experimental. Both interfaces make the standalone devices much more usable than with the original interface. The first one is called the Meshtastic UI (MUI), and it supports ESP32-S3 devices with an LED display, such as the LilyGo T-Deck and the Seeed SenseCAP Indicator. Support for MUI is indicated in the Web Flasher with the Meshtastic logo and an icon of a display with UI in it.

Another new user interface is InkHUD, specifically developed for devices with e-paper display, such as the LilyGo T-Echo (Figure 12). If you want to flash one of these new user interfaces onto your device, choose a 2.6+ version in the Web Flasher. After clicking on Flash and then Continue, toggle the Meshtastic UI or InkHUD option right above the Download UF2 button (Figure 13).

Figure 12: InkHUD is a single-button user interface for Meshtastic devices with e-paper display.
Figure 13: Install one of the new user interfaces for standalone Meshtastic devices.

InkHUD is designed to navigate through menus with only a single button. Simply press the button to navigate to the next screen or the next option in a menu, and long-press to open a menu, confirm a choice, or toggle an option. Thanks to the e-paper technology, the display can stay always on without using energy (e-paper displays only use energy at the moment they're changing what's on the display). You can also customize what's displayed by enabling and disabling specific applets.

Extending Functionality with Modules

The Meshtastic firmware includes various modules to extend the functionality of your devices. You can find them under Module configuration in the app's radio configuration screen. For instance, the External Notification module enables alerts with a buzzer or an LED upon receiving a message. The firmware images for the different devices are already configured with the correct pin numbers, but if you use custom hardware you can change this configuration.

The Telemetry module periodically sends various types of data over the mesh network: device metrics, environmental metrics, air quality metrics, power metrics, and health metrics (not enabled in the firmware by default). You can enable or disable each of these types individually, and you can change the update interval as well. The device will automatically detect supported sensors at startup. The app also presents the last known sensor measurements in the device list or if you tap on the device's short name and choose More details (Figure 14).

Figure 14: Meshtastic devices can send sensor measurements over the mesh network.

MQTT

MQTT is a network protocol that is popular for home automation and Internet of Things scenarios. You can configure ESP32 devices that are connected via WiFi or Ethernet to forward Meshtastic messages to an MQTT broker. This feature allows users on your local mesh network to communicate with others on another mesh network, with the device that connects to the MQTT broker essentially operating as a bridge or gateway. This option requires enabling WiFi or Ethernet in the network configuration.

Then, within the MQTT module configuration, toggle the MQTT enabled option and specify the address, username, and password (both can be empty for anonymous access) for your MQTT broker. If you're connecting to a public MQTT broker, make sure to keep encryption enabled; otherwise all Meshtastic messages will be sent in plaintext. If you want to easily integrate your Meshtastic messages with a home-automation system (e.g., for reading telemetry), you can enable JSON output. You can also specify the root topic to use for messages sent to the MQTT broker.

Even after this MQTT module is configured, Meshtastic messages received by this device aren't forwarded to the MQTT broker yet. You need to specify this channel by channel. Open Channels in the radio configuration screen and tap on a channel to edit it. If you enable the uplink there, the device will send messages received from the local mesh network to the MQTT broker. If you enable the downlink, the device will forward messages received from the MQTT broker to the local mesh network.

Moreover, each device must consent to allow its messages to uplink to an MQTT broker through your Meshtastic/MQTT gateway. This is done in the LoRa configuration screen by enabling OK to MQTT. On the other hand, Ignore MQTT lets the device ignore any messages it receives via LoRa that originally came via MQTT.

All in all, using MQTT for your Meshtastic mesh network requires some thoughtful configuration. It is good to consider your options carefully, because most users will assume their messages stay local. It is also recommended to set up a dedicated, mains-powered Meshtastic device to connect to your MQTT broker or a public broker, ensuring uninterrupted operation.

One useful application of this MQTT link is mapping Meshtastic users. For instance, Liam Cottle's map [11] lets you discover other Meshtastic users in your region (Figure 15). His website provides instructions for connecting with his MQTT broker. To be able to show your position on the map, your device has to send its position on the default channel, but the position can be with low precision to preserve privacy.

Figure 15: Find other Meshtastic users in your region.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • ChirpStack LoRaWAN

    ChirpStack's LoRaWAN implementation lets you set up long-range wireless traffic for sensors even if you are far from a WiFi access point.

  • Instrumented Garden

    Place long-range wireless sensors in a garden and keep track of ambient conditions with gauges and time-based graphs.

  • LoRa Long Range Radio

    WiFi is convenient for devices that are in the same house. If you want to extend the distance, give LoRa a call.

  • Mesh Networking

    Mesh networking comes to with the IEEE802.11s draft standard. We'll show you how to mix a mesh.

  • FreeRTOS

    Exploit the full power of your microcontroller with the FreeRTOS multitasking operating system.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News