Trying out off-grid wireless communication with Meshtastic
Background
One day I was scrolling through my Fediverse timeline and saw someone on the instance posted (I can’t find the original post now but it was something like):
Meshtastic is modern Pictochat
Pictochat is a feature available on the Nintendo DS, allowing players to chat with each other by exchanging images with nearby consoles. I don’t have a DS, but I have a 3DS, which has a somewhat similar feature called Streetpass, allowing it to communicate with nearby consoles while in sleep mode, which I think is very cool. The post raised my interest on Meshtastic, so I searched a bit and learnt that it is an open source off-grid mesh network based on LoRa devices. And then I just kinda forgot about it.
Later when watching some 38C3 talks, I came across Meshtastic again. There was 2 talks featuring Meshtastic (this and this), both of which mentioning that nodes are pretty cheap (as cheap as $5-$7 if DIY, I should be able to lower that by getting cheaper parts here in China), so I wanted to try it out.
It happened that lyc8503 was interested in building his own networks too, so we decided to try Meshtastic at school. He has already written a blog article about the whole procedure. You should probably read that before continue reading. I only add some of my own thoughts and experiments here.
Choice of Hardwares and Cost Concerns
After watching the talks, I did a quick search about off-the shelf devices (development boards) that Meshtastic supports, and found that they are all priced at over 100 CNY (~14 USD), which is well over my expectation. Now I have to build the nodes myself.
The cost of the first MCU + LoRa combination that we used, ESP32 + SX1278(Ra-01), is about 40CNY (~6 USD). This doesn’t include the antenna and the screen. Although we have a cheaper ESP32C3 as MCU, but we just couldn’t make it work somehow (we couldn’t make it boot and there was no serial output to diagnose, and we just gave up after some guessing). Later we tried the relatively cheaper nRF52840 + SX1268 (E22-400MM22S) combination, which costs around 20 CNY (~3 USD) including the antenna. However the SX1268 LoRa module was bought at the sample price of 6 yuan. If I need more than 2 nodes, I have to buy them at the normal price of 20 yuan, which brings the cost per node up to almost 40 CNY. Also I need to solder them manually.
Additionally, I bought the U-blox NEO-6M GPS modules, which costs 11 CNY per module. They can provide geolocation info for nodes, though not very precise.
My initial goal was to lower the cost of nodes as much as possible, and it turns out that about 20 CNY per node is the limit. People in MeshCN WeChat group seem to not care about the cost and all and would buy ready-to-go nodes at 100+ CNY.
More Range Testing
My other goal was to see the maximum transmission range of our DIY nodes. According to the official Meshtastic website, the current ground record is 331km, and people in the MeshCN group frequently reports successful transmissions over 10km. However, the tests that we did in Nanjing couldn’t even reach the distance of 1km, thanks to the density of buildings in urban areas. So I went to the countryside to see if I can get better ranges with relatively open areas and less noise in the air.
Hardware Version 2
Hardware used: nRF52840 + SX1268(on small PCB) + adapter cable with rubber ducky antenna (the version 2 in lyc8503’s article)

I placed a node on a balcony on the 4th floor, and then moved the other node along the straight road beside the house. The farthest successful transmission is about 800m. The position on map and satistics are below.


You can see on the map that there’s almost no buildings blocking the signal (there is a factory building that is almost blocking the line, which may be the reason why I can’t go further). Too bad that it couldn’t reach 1km. Maybe this antenna adapter wire is just too crappy.
Hardware Version 3
Hardware used: nRF52840 + SX1268 + adapter board + rubber ducky antenna + (optional) GPS module (the version 3 in lyc8503’s article)
After upgrading the devices, I went testing in another place in the countryside. I placed one of the nodes at the window on the 3rd floor, and moved the other node around. This place doesn’t have a straight long road, so I can only look for open areas and try to avoid houses. I couldn’t find a perfect line that don’t cross any buildings in the end, and I got a successful transmission from 1km away, despite some houses blocking the line of sight. The position on map and statistics are below. While testing I tried swapping between the long (24cm) and short (11cm) antennas on the moving node, but they don’t really show any difference on the signal quality.


Hardware Version 3, the Second Time
I couldn’t get results that feel good enough in the countryside, so I decided to try again, this time using the height of a hill to avoid the obstruction from buildings in the urban area.
I used the same devices as last time (only using the shorter antenna), taping a node onto the window of my home (at 4th floor), and I brought the other node up the nearby hill. Although I couldn’t receive anything on the way, I could consistently receive the signal after I got to a tower on the hilltop. The distance from my home is about 2.6km, and the altitude is about 200m. I don’t want to dox myself so I’m not showing the map here.

^The node on the hilltop. The line of sight to my home is onlyblocked by trees, and the radio signal can bypass them.

^Signal statistics of tracerouting 4 times. There is even a Good so it probably haven’t reached its limitation.

^Messages can be recieved and acknowledged consistently.
Conclusion
The final range test on the hilltop finally reached my expectations on the transmission range of our DIY nodes, though it can probably do better. Maybe I can try further later, but I can’t “Shadow Clone” and move 2 nodes at the same time. I also can’t really just leave one node on the hilltop and move the other node around (it’s public space and I don’t even have a closure to protect the node). Shelving this until I have more spare time. At least I learnt that higher altitude can greatly boost transmission range.
I can finally wrap up this project now, and it’s been 3 months since lyc8503’s artical in May. I got a slight taste of what it feels like to do develop with real embedded softwares. Personally I think the use cases of Meshtastic is not very wide. I can only think of situations like going hiking where there’s no cellular network, or using IoT devices in open areas (like in a large farm) where the cost may be lower than using 4G network. In urban areas it just looks cool(?) to use this kind of mesh networks, and maybe there’s the benefit of controlling the infrastructure myself too.