LoRaMessenger

LoRaMessenger is an off-grid chat between LoRa equipped ESP32 nodes with a simple wireless web interface.

The ESP32 hosts a Wi-Fi network that will provide a simple chat-like interface that will display online nodes, received and sent messages, and some text boxes to set the node name, destination node, and message.

Since the LoRa communication protocol is used to send and receive messages, it is possible to set two or more modules to transmit and receive messages up to a distance of a few kilometers.

Most ESP32 LoRa modules, such as the TTGO LoRa32 or Heltec Wifi LoRa 32, are equipped with a display, so you can use them independently to receive messages like a pager.

A node can be easily installed inside a small box with a battery, thus creating a communication system that can communicate even in areas where there is no phone signal.


Web interface

After the ESP32 is started, a new Wi-Fi network called LoRaMessenger [number] is created.

When a device connects to the network, the web interface should open automatically, if nothing happens, the interface can be accessed by opening a web browser and navigating to the ESP32 IP, which is by default 1.1.1.1.

On android, a wifi login page containing the web inteface is opened after connecting to the Wi-Fi network. This way, background 4g network connection is mantained even when using LoRaMessenger. A notification saying login to the network should stay into the notification panel and can be opened anytime to show the interface again.

The web interface is now presented on your browser, the chat has the following features:

Note that as of right now a page refresh is necessary to update the received messages and read receipts.


LoRa protocol

LoRaMessenger uses a custom communication protocol, each packet sent consists of a header and a payload.

The header provides the information needed for the network and packet routing to work properly, the parameters contained in the header are as follows:

Message payload:

Acknowledgment payload:

Announce payload:


Packet relaying and routing

LoRaMessenger creates a network of nodes capable of forwarding messages to nodes not directly reachable by the sender.

To do this, each node utilizes an automatic routing table containing the destination nodes and the best route to reach them.
The table is updated through announcement packets that are sent periodically or upon name change by all nodes.

The current routing algorithm is very simple and prefers a lower number of hops, in the case of two routes with the same number of hops the one with the connection to the next strongest node is chosen.


Configuration

Into the includes folder, a configuration file called config.h is present. This file contains all the settings necessary for LoRaMessenger to function.

LoRa config:

L1 config:

L3 config:

Messages config:

Display config:

Network config:

Pinout:

Pin definitions may need to be edited in case another board is used (Pin definitions are based on a TTGO LoRa32 V2).