Network-free communication with ESP32: LoRa, ESP-NOW and Trail Mate

  • The ESP32 enables off-grid communications by combining LoRa for long range and ESP-NOW for low-latency, low-power local links.
  • Firmware such as Trail Mate integrates offline maps, advanced GNSS, LoRa messaging, and digital voice into ESP32-based handheld devices.
  • ESP-NOW offers direct links between ESP32 without a WiFi router, ideal for sensors, controllers, and redundant local control in case of internet outages.
  • These open solutions enable communication and sensor networks in mountainous, rural environments, emergencies, and community projects.

network-free communicator with ESP32

La offline communication with ESP32 It has become a key issue for hikers, amateur radio operators, rescue teams, and, in general, anyone who needs to stay connected when their mobile phone loses signal or there's no internet available. In this scenario, technologies such as LoRa, mesh networks and ESP32-specific protocols that allow sending data, voice and even images over long distances with very little power consumption.

In recent years, very powerful solutions have emerged, from full firmware like Trail Mate even DIY projects that combine relays, ESP32, and remote control without needing to open ports on the router. Furthermore, Espressif has promoted protocols such as ESP-NOWwhich allow direct communication between boards without going through a WiFi access point or an external server, opening the door to fully autonomous and off-grid devices.

Off-grid communication with ESP32 and LoRa: context and possibilities

esp32 lora offgrid device

When we talk about ESP32-based off-grid communication We usually refer to scenarios where there is no mobile coverage or internet access, but we still need to send data or coordinate groups. That's where LoRa comes in: a long-range radio system that typically operates in sub-GHz bands such as 433, 868 or 915 MHz, depending on the region.

These bands allow ranges of 5 km in urban environments and more than 15 km In open areas with favorable conditions, provided we use an appropriate bandwidth and dispersion factor configuration, this type of link is perfect for hiking, expeditions, precision agriculture, rural monitoring or emergencies, where deploying complex infrastructure is not feasible.

The ESP32 fits this scenario perfectly because it combines computing power, WiFi, Bluetooth and support for external LoRa radios (such as the SX1262 or SX1280 chips) in a single, inexpensive, and readily available microcontroller, found on boards such as the AmyBoard ESP32-S3 boardIn this way, we can run advanced firmware, manage a screen, handle sensors, and also maintain long-distance links on the same board without depending on the mobile network.

Some manufacturers have created motherboards specifically designed for this use, for example the ranges LILYGO T-LoRa Pager, T-Deck, T-Deck Pro or different Heltec LoRa 32 moduleswhich integrate an ESP32, LoRa radio, and, in many cases, a screen and battery. Solutions such as these have been developed based on these principles. Trail Mate or compact communicators like MiniTrekker, designed for field, mountain and outdoor activities.

Trail Mate: Open source firmware for off-grid communicators with ESP32

Trail Mate is a Open firmware for ESP32-based portable devices It combines offline maps, LoRa messaging, advanced GNSS navigation, and extra features such as digital voice and SSTV image reception in a single system. Its philosophy is clear: stability, interoperability and energy efficiency ahead of accumulating functions without control.

The interface is organized into four main sections: GPS, LoRa chat, tracking, and system utilitiesIt is designed for relatively small screens and modest hardware, so navigation remains simple and straightforward, without unnecessary frills that complicate its use in the middle of a route or during a rescue operation.

One of the most striking features is the system of Offline maps on SD cardTrail Mate allows you to load maps in common formats like PNG or JPG, with different layers (OpenStreetMap, terrain, satellite, overlaid contour lines, etc.), so the device works without a constant internet connection. This means a single gadget can replace a traditional handheld GPS with mapping capabilities, eliminating the need to rely on a mobile phone.

At the GNSS level, the firmware supports multiple constellations: GPS, GLONASS, Galileo and BeiDouDisplaying detailed information for each satellite: SNR, azimuth, elevation, or values ​​such as HDOP to estimate the quality of the positioning solution. With decent GNSS hardware, under normal conditions, an accuracy of around [missing value] can be achieved. 2-5 meters, sufficient for mountain navigation, trails or field deployments.

The messaging part is based on Meshtastic and MeshCoreTwo very popular open-source projects for creating decentralized LoRa mesh networks. Thanks to them, Trail Mate can send and receive text messages, share its location, and participate in larger mesh networks without the need for a central tower or router, allowing communication even in the absence of infrastructure.

Beyond text, Trail Mate adds features rarely seen on this type of device, such as SSTV (Slow Scan Television) receptionwhich allows receiving images transmitted via audio, a classic feature in amateur radio. It also integrates a walkie-talkie mode with Codec2 in half-duplex communicationThis means that compressed voices can be sent at extremely low bitrates, on the order of 700bpsThis is very suitable for low-speed LoRa links with limited resources.

Regarding navigation, the firmware includes route registration and trackingsaving the routes in memory for later reference. It also has a "team" mode that relies on ESP-NOW for the initial key exchange between nearby devices, and then switches to LoRa for long-range communication. This combines the best of both worlds: fast close-range pairing and long-range off-grid connectivity.

Compatible hardware: from LILYGO and Heltec to M5Stack and commercial communicators

Trail Mate is designed for running on several ESP32 platforms with integrated LoRaAmong them, models such as the LILYGO T-LoRa Pager, T-Deck, T-Deck Pro or some experimental clocks and modules such as the T-Watch S3There are also efforts to port the firmware to devices based on ESP-IDF like the M5Stack Tab5further expanding the list of options.

This multi-platform approach allows each user to choose the hardware format that best suits your useSome motherboards prioritize battery life with large batteries, while others opt for larger screens or full physical keyboards. A very practical example is the LILYGO T-Deckwhich includes a QWERTY keyboard and a generous screen, ideal for writing LoRa messages directly in the field without relying on a mobile phone.

Most of these boards mount radios like SX1262 or SX1280which allow adjusting parameters such as bandwidth and dispersion factor. With high dispersion factors (for example, SF12), the Transmission speed drops below 300 bpsBut in return, the reach is significantly increased. In rural or mountainous areas, this commitment is well worth it.

Some devices add advanced utilities, such as a function to Energy Sweep which scans the sub-GHz band to select less congested channels. This is very useful when deploying many LoRa nodes in the same area or when working in areas with significant radio frequency noise.

In parallel, compact commercial communicators based on ESP32 and LoRa have been appearing, such as the MiniTrekker LoRawhich integrate GPS, mesh connectivity, rugged casing and compatibility with tools such as ATAK for tactical uses, search and rescue or demanding outdoor activities.

ESP-NOW: Ultra-fast communication without WiFi or router

In addition to LoRa, the ESP32 ecosystem has its own very powerful protocol for local communication: ESP-NOWDeveloped by Espressif for the ESP32, ESP8266, and variants such as the ESP32-S and ESP32-C, ESP-NOW is designed for exchange small packets of data with very low latency and minimal power consumption, without needing to connect to a traditional WiFi access point.

Unlike WiFi, where communication passes through several layers of the OSI model (physical, link, network, transport, etc.), ESP-NOW Simplify these five top layers into a single one.This reduces overhead, minimizes congestion delays, and allows a newly powered-on device to... transmit data in a matter of milliseconds, instead of the several seconds it takes to connect to a WiFi network.

In practice, this means that an ESP32 with batteries can wake up, send an ESP-NOW packet in about 40 ms and go back to sleepThis saves a huge amount of energy compared to a normal WiFi connection, which can take between 3 and 12 seconds just to establish a link. This makes ESP-NOW a fantastic option for battery-powered sensors, wireless switches, remote controls, or distributed nodes, as well as solutions based on nRF24L01 with Arduino.

In terms of scope, although he continues working on 2,4 GHzESP-NOW typically far exceeds the typical range of a home WiFi network. Where a WiFi network operates between 25 and 100 meters, with proper tuning and favorable conditions, ESP-NOW can typically reach between 100 and 500 metersor even more, depending on antennas, environment and orientation.

The topology it allows is very flexible: you can work with unidirectional, bidirectional, one-to-many, and many-to-many linksThe protocol distinguishes between initiating devices (usually sensors, switches, etc.) and responders (actuators, sockets, lights, etc.), although the same board can assume both roles at the same time without any problem.

Technical characteristics, advantages and limitations of ESP-NOW

ESP-NOW relies on the MAC address of each device to route messages without joining a network. Before communicating, nodes pair up using their MAC addresses, and this pairing can be encrypted or unencryptedAccording to the needs. Once paired, the connection between devices is persistent, even if they restart: upon restarting, they resume communication without needing to "introduce themselves" again.

Among the most outstanding features, we can highlight that It is compatible with WiFi and Bluetooth LEIt uses few CPU and flash resources, and allows payloads of up to 250 bytes per packet It also provides callbacks to inform the application layer of successful or failed submissions. This is very useful for implementing retries or confirmation logic.

In terms of security, ESP-NOW supports encryption with ECDH for key exchange and algorithms like AES128-CCM and AES256-CTR to protect data. According to Espressif documentation, in rapid provisioning scenarios, the following can be configured up to 16 devices in a few seconds, with simultaneous multi-node handshake, which greatly facilitates the deployment of batches of IoT devices.

However, it's not all advantages. The main limitation of ESP-NOW is the amount of data per packet (about 250 bytes)For most IoT applications (sensors, states, commands) it is more than enough, but if large transmissions or continuous data streaming are needed, the advantage is diluted and it is probably better to use standard WiFi or another technology.

Furthermore, the number of encrypted pairs are limitedIn Station mode, a maximum of 10 encrypted nodes are allowed, and in SoftAP or SoftAP + Station modes, the limit drops to 6. More peers can be had if they are not encrypted, but the combined total of encrypted and unencrypted peers must be kept below 20. For many home or DIY projects, this is not a problem, but in very large deployments, it must be taken into account.

Unlike LoRa, ESP-NOW does not aim to compete in terms of range or operation in sub-GHz bands with specific duty cycle regulations. Its natural habitat is the high-speed, low-power short/medium range ad-hoc networksLoRa shines when searching over several kilometers with very low data rates.

ESP-NOW vs LoRa: When to use each technology

The first thing to be clear about is that ESP-NOW and LoRa are designed for different scenariosAlthough they can coexist in the same project with ESP32, it makes no sense to consider them as direct rivals because their strengths complement each other rather than overlap.

On one hand, ESP-NOW does not require additional hardwareIt comes integrated into the ESP32/ESP8266 chip itself and can be configured via the firmware. This makes it ideal for quick and easy projects where you want to connect multiple devices in a home, workshop, classroom, or local industrial environment without the hassle of external modules.

The typical range of ESP-NOW is between 100 and 500 meters with a good antenna and line of sight, sufficient to cover large houses, warehouses, small farms or nearby facilitiesFurthermore, communication is extremely fast, and we can send as many 250-byte packets as needed, with very high update frequencies—perfect for real-time telemetry, collaborative robots, or direct control of actuators.

At the other end, LoRa adds cost and complexity (It requires a dedicated radio module and configuration of parameters such as SF, BW, power, etc.), but in return it can cover between 10 and 20 km under favorable conditions, or several kilometers with obstacles, provided that the legal duty cycle limitations in the corresponding ISM band are respected.

LoRa's speed is significantly lower and the amount of time we can transmit is also usually limited, but in return we get very robust links, high sensitivity (below -160 dBm in some chips) and high resistance to interferenceThis makes it ideal for rural sensing, agriculture, environmental monitoring, or low-data-rate distributed networks.

Many advanced projects opt for combine both technologiesESP-NOW is used for fast and dense communication within a small area (for example, between several nodes of the same workgroup), while LoRa is reserved for the long-distance link to a central gateway or coordinating nodeTrail Mate and other off-grid firmwares move precisely along these lines of synergy.

Local and remote communication with ESP32: relay control without opening ports

Beyond the outdoor aspect, many want to use the ESP32 for controlling relays and household devices Both remotely (via the internet) and locally, without depending on whether the router or fiber connection is always active. And, of course, without having to struggle with port forwarding or complicated firewall configurations.

A widespread strategy is to make the ESP32 Connect to a central server or a cloud backend (for example, Firebase, MQTT on a VPS, etc.) and have the mobile app query and send commands through that server. This way, there's no need to open ports on the ESP32, since the device itself handles this. initiates outgoing connection to the Internet, usually via HTTPS or MQTT over TLS.

This approach solves the remote part well, but raises a classic question: What happens if the internet goes down or the external service (like Firebase) stops working? In many cases, even without an internet connection, the local WiFi network remains operational, and it would be desirable to continue controlling the relay from a mobile phone inside the home or facility.

To cover this hybrid scenario, the system can be designed so that the ESP32 has two complementary access modesOn one hand, it maintains the connection to the remote backend whenever possible. On the other hand, it exposes a local interface (for example, a small embedded web server or a REST API on the board itself) to which the mobile application can connect directly when it detects that the Internet is unavailable.

The app can implement a simple logic: first it tries to communicate with the remote server; if that fails, it tries to Discover the ESP32 on the local network (for example, through mDNS, a scan of IPs within the LAN range, or using a specific SSID broadcast by the ESP32 itself in access point mode). In this way, even without cloud access, local wireless control is still possible.

Another very interesting option, especially if we want total independence from the WiFi network, is to combine IP control with protocols such as ESP-NOW for direct commands between boardsFor example, you can build a small "controller" with a battery-powered ESP32 and ESP-NOW, which sends commands to the ESP32 that controls the relay. This way, even when the router is turned off, the devices will continue to communicate without going through the home network.

Real-world applications: off-grid, rural IoT, emergencies, and community networks

The technologies and projects discussed fit into a broad range of practical applications in the real worldIn the outdoor sector, firmware like Trail Mate allows groups of hikers, mountaineers, or rescue teams to... coordinate in areas without coveragesharing location, text messages, and routes on detailed offline maps.

In rural or agricultural deployments, the combination of ESP32, LoRa and ESP-NOW It enables distributed sensor networks that collect data on humidity, temperature, water level, animal presence, etc., and send it to a central gateway. This gateway can, in turn, publish the information via MQTT to a local or remote server, or even be integrated into home automation platforms such as Home Assistant if desired.

Amateur radio operators find in these solutions an ideal playing field for experiment with SSTV, ultra-compressed digital voice links, and mesh networks that do not depend on mobile operators. The ability to work with maps, routes, and GNSS gives them additional tools for activities such as SOTA outings, contests, or communications support at sporting events.

In emergency or civil protection scenarios, where conventional infrastructure may fail or become overloaded, off-grid systems based on ESP32, LoRa and mesh networks They offer a very valuable backup plan. They allow you to maintain a basic communication channel to coordinate teams, mark critical points on the map, and share essential information without relying on operational cell phone towers.

Finally, the community networks and maker projects They benefit from the open-source nature of both the hardware and software: the community creates custom firmware, develops new features, fixes bugs, and shares knowledge. The pace of evolution is very rapid, and users can adapt solutions to their specific needs without being tied to a single manufacturer.

One particularly striking aspect is that projects like Trail Mate have been developed with code generated largely by artificial intelligence under human supervision. This opens up an interesting topic about how AI can accelerate the development of real embedded firmware, while also raising questions about code quality, maintainability, and style when many parts are suggested by generative models.

Taken together, the ecosystem formed by ESP32, LoRa, ESP-NOW, Meshtastic, MeshCore and open source firmwares such as Trail Mate It has transformed the way off-grid communication is approached. With inexpensive and readily available hardware, it's possible to build everything from simple relay controllers with local and remote control to complex off-grid sensor and communicator networks with maps, advanced GNSS, and digital voice, offering hobbyists, professionals, and communities a powerful toolbox to stay connected even when the conventional network disappears.

M5StampS3 BAT module with ESP32-S3 and integrated battery
Related article:
M5StampS3 BAT module with ESP32-S3 and integrated battery