In today's world of overly-centralized AI powered networks that track your every interaction and move to sell your personal data to the highest advertising bidder, sometimes it's nice to unplug and disconnect from the network if even just for a little bit.
What about when you're at a concert, festival, or event with thousands of other people and would like to maintain basic contact with your friends who are also there, but the cellular network is too congested with all those social influencers live streaming their every move?
What about when you're at a rally or event where your local government intentionally disabled cellular communication? Or maybe you just go hiking regularly and cellular service up in the hills is completely non-existent?
The folks over at Meshtastic have thought about this exact problem with open source, off-grid and decentralized mesh networks built to run on affordable, low-power devices. One of which I will discuss here; the Heltec LoRa 32 ESP32S3 radio.
Before I get into the details of how to set up a Heltec Lora32 on Meshtastic, I will first illustrate a major benefit of this type of device; its range!
Bluetooth has an effective range of about 10 meters, or 30 feet. This is perfect for watches and wearables on your person as your phone is generally also on your person, and few people are bigger than 10 meters.
As for a cross device communication protocol however, it's not overly effective unless you want to snuggle up with those you wish to communicate with. At which point however you might as well just talk to the person as they are going to need to be right beside you.
{width=100%}
802.11, aka WiFi, offers considerably better range, with a max distance of about 100 meters (300 feet) in outdoor, open air environments or about 30 meters (100 feet) indoors. This allows communication between devices in different rooms in a single house, and even offers ad-hoc peer-to-peer connections.
Unfortunately any communication with a friend down the street will either require specialized point-to-point antennas strategically placed or uplinking that communication through a third party. While this is a perfectly solid option when that infrastructure and servers are in place, it does rely upon systems outside your control to be available.
{width=100%}
That brings us to a LoRa Mesh, or "Long Range Mesh". On the 900MHz frequency this gives a maximum range of about 15 kilometers, or about 9 miles when using high-gain 10dBi antennas and with good line of sight!
{width=100%}
As per the official docs for LoRa:
Technology | Wireless Communication | Range | Tx Power |
---|---|---|---|
Bluetooth | Short range | 10 m | 2.5 mW |
Wifi | Short range | 50 m | 80 mW |
3G/4G | Cellular | 5 km | 5 W |
LoRa | LPWAN | 2-5 km (urban) | 20 mW |
5-15 km (rural) | |||
15 km (LOS) |
In my real-world experiment, I used a pair of devices with the default 2dBi antennas at ground level. With one device inside my house on the first floor, I was able to carry the second device 500 meters (.3 miles / 1600 feet), away through the neighborhood, houses, and trees before the signal dropped too much for the two devices to communicate with each other. That's about 5 city blocks through buildings with no special effort applied in the installation or antenna placement.
A similar test in a park in the Appalachians through trees and over a hill yielded similar distance, about 500 meters before the signal dropped too much to be effective. While half a klick isn't overly impressive, this was with the default low-gain antennas.
I have a pair of 5dBi antennas ordered and will offer a follow-up article comparing the different antennas.
As a trade-off to long range communication at very lower power usage however, is very limited bandwidth. Bluetooth 6.0 Low-Energy has a maximum throughput of 3 Mbps whereas Meshtastic's Short/Turbo only gets 21.88 kbps.
According to the radio presets recommended for Meshtastic:
Radio Preset | Alt Preset Name | Data-Rate | Bandwidth | Link Budget |
---|---|---|---|---|
Short Range / Turbo | Short Turbo | 21.88 kbps | 500 kHz | 140dB |
Short Range / Fast | Short Fast | 10.94 kbps | 250 kHz | 143dB |
Short Range / Slow | Short Slow | 6.25 kbps | 250 kHz | 145.5dB |
Medium Range / Fast | Medium Fast | 3.52 kbps | 250 kHz | 148dB |
Medium Range / Slow | Medium Slow | 1.95 kbps | 250 kHz | 150.5dB |
Long Range / Fast | Long Fast | 1.07 kbps | 250 kHz | 153dB |
Long Range / Moderate | Long Moderate | 384 bps | 125 kHz | 156dB |
Long Range / Slow | Long Slow | 184 bps | 125 kHz | 158.5dB |
The Long/Fast (default implementation) only supports about 1 kbps. This is plenty for short text snippets, but not nearly fast enough to even support the 8 kbps bitrate for G.729 audio.
The Codec 2 open source speech codec could in theory operate as it is capable of transmitting speech at only 700 bps, but very few devices support this at the time of writing.
This radio uses the LoRa radio technology that operates on the 33 cm band to offer wireless communication in the UHF 902MHz - 928MHz frequency range, (or 779MHz - 787MHz in Canada, 915MHz - 928MHz in Australia, or 863MHz - 870MHz in Europe). This spectrum is license-free and can be freely used by the general public and is generally used by cordless phones, RF identification, and amateur radio.
Thus far there have been a number of potentially confusing terms and technology listed.
First off is the Heltec Radio; a tiny Arduino device with a Bluetooth/Wifi radio, USB connection, and a LoRa radio.
The LoRa protocol is just the physical layer for wireless data communication, much like Bluetooth or Wifi.
Having a device and a wireless radio is not the complete picture however, as you need an application running over top these fundamentals to make them actually do something. LoRa supports a multitude of applications, including LoRaWAN, MeshCore, IoT devices, MQTT, and the one covered herein, Meshtastic.
Now that the technical primer of what this device is, is out of the way, onto actually getting the device up and running!
Just connect the included antenna and mount the board and antenna into the enclosure. Insert the USB-side of the board first and it will just snap into place. Wrap the antenna down and around the loop clip and that should fit snuggly in the antenna slot.
Linux has native support for the USB interface, but Windows users will need to install additional drivers.
Plug in your radio via a USB-C cable into your computer and (optionally) verify it's visible via lsusb
.
lsusb | grep UART
Bus 001 Device 008: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
The serial interface should be visible in the kernel and can be verified by:
ls -lha /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jul 11 16:02 /dev/ttyUSB0
Permissions Warning - Unless you have used serial devices before, you will probably need to add a group
to your user account. As listed in the ls
command, only root
and members of the dialout
group
have read/write access serial devices.
Verify your user is a member of the dialout
group by running the groups
command:
groups
charlie dialout cdrom floppy sudo audio dip video plugdev users render netdev bluetooth lpadmin scanner libvirt docker sambashare
If you do not see the group name in the output, add your user and restart for the change to take effect.
sudo usermod -a -G dialout YOURUSERNAME
(This only needs to be done once per computer, and will enable communication to any serial device.)
Once your permissions are set and your radio is plugged in via USB, open flasher.meshtastic.org in Google Chromium and follow the prompts.
You MUST use Chromium (or Chrome) as Firefox does not support the WebSerial API required for web browsers communicating with serial devices.
The flasher will let you select which version of Meshtastic to install and will do all the work necessary to flash the Arduino memory with the new application.
Once the radio restarts automatically, select your region on the radio and you'll be good to go!
The basic kit for the Heltec Lora32 does not include a battery, nor will one fit inside the small enclosure! As such you will need to provide power from its USB-C port via either a battery bank or other USB power source.
There are batteries compatible with this module however, including a 3.7V 3A Li-Po battery and a 3.7V 10A Li-Po battery.
Use of these batteries will require a larger case to be 3D printed.
Now that Meshtastic is running on your Heltec, you can use it to communicate with other Meshtastic clients.
You can use Chromium to access client.meshtastic.org from a computer, but at least at the time of writing, this web interface is absolute rubbish and is really not recommended.
Direct serial connections just don't work at all and the Bluetooth connection works but requires frequent SHIFT+CTRL+R hard refreshes. Connecting via Bluetooth, (the only option that kinda almost works), requires SHIFT+CTRL+R when you first connect, AND every single time the device restarts, which is quite frequent when you are performing changes.
That said, it does work enough to configure your radio... eventually.
At least it's enough to configure your channels, including the primary public channel, (which should already be configured).
The default public PSK is AQ==
and if you want to communicate with the general public, this should be left as default.
Any changes to the primary channel Pre-Shared Key will prevent your device from interacting with other devices.
(If this is your desired goal though, have at it!)
Additional channels can be configured with your own private encryption key. This allows you to have a group of devices which can privately communicate with the group, assuming each device shares the same PSK.
(Relay nodes can still forward encrypted channels, even if they do not have the shared key. In fact relay nodes generally should NOT have your private keys, as physical access to the nodes would allow an attacker to extract your private key.)
Note, the PSK is not like a wifi key where you can type in whatever you'd like. Use the Generate
button
to generate a valid AES encryption key in either 256bit or 128bit.
There is a mature and functional Python client and library suitable for interfacing with Meshtastic via a command line. This is effective with the serial interface, though can be tedious for general use.
Chris Talbot has a Gnome client for Meshtastic, but was written to require Debian 13, which at the time of writing is not stable so I was not able to try it. It has support for Flatpak, but again requires an operating system which is not released yet, so again... fail.
(Pro tip to developers who are making a project; make sure you target CURRENT environments, not future ones...)
The Android client for Meshtastic is available via the F-Droid and Google app stores. This will most likely be the most common method of interacting with the Meshtastic network.
You will be able to see all visible neighbors within range, along with a historical log of devices you may have run across in your travels. The Heltec does not ship with any additional sensor, but GPS can be shared from your phone over Bluetooth and additional sensors can be added if you're skilled enough with a soldering iron.
These sensors include a built-in GPS receiver, temperature, humidity, barometric pressure, and more! (Stay tuned for a follow-up where I add this functionality to a basic Heltec radio.)
For nodes that have GPS enabled, (you do not need to share your location if you do not wish), a map view of nodes is also available. (Nodes can have their GPS coordinates set manually, so devices may not necessarily be where they are coded.)
A map of all known nodes worldwide is available so you can get an idea of how densely populated your neighborhood would be and if you can expect to be able to chat with folks.