Meshtastic And Owntracks To Kick Your Google Habit

I have an admission to make. I have a Google addiction. Not the normal addiction — I have a problem with Google Maps, and the timeline feature. I know, I’m giving my location data to Google, who does who-knows-what-all with it. But it’s convenient to have an easy way to share location with my wife, and very useful to track my business related travel for each month. What we could really use is a self-hosted, open source system to track locations and display location history. And for bonus points, let’s include some extra features, like the ability to track vehicles, kids, and pets that aren’t carrying a dedicated Internet connection.

You can read the title — you know where we’re going with this. We’re setting up an Owntracks service, and then tying it to Meshtastic for off-Internet usability. The backbone that makes this work is MQTT, a network message bus that has really found its niche in the Home Assistant project among others. It’s a simple protocol, where clients send brief messages labeled by topic, and can also subscribe to specific topics. For this little endeavor we’ll use the Mosquito MQTT broker.

One of the nice things about MQTT is that the messages are all text strings, and often take the form of JSON. When trying to get two applications to talking using a shared MQTT server, there may need to be a bit of translation. One application may label a field latitude, and the other shortens it to lat. The glue code to put these together is often known as an MQTT translator, or sometimes an MQTT bridge. This is a program that listens to a given topic, ingests each message, and sends it back to the MQTT server in a different format and topic name.

The last piece is Owntracks, which has a recorder project, which pulls locations from the MQTT server, and stores it locally. Then there’s Owntracks Frontend, which is a much nicer user interface, with some nice features like viewing movement a day at a time. Continue reading “Meshtastic And Owntracks To Kick Your Google Habit”

Hackaday Prize 2023: LoShark, The Radio Debugger For LoRa

LoRa, the Long Range wireless protocol is pretty great for trickling data across long distances. There are some great embedded devices based around STM32, NRF52, and ESP32 microcontrollers. What’s been missing for quite a while is a device that allows for full access to a LoRa radio from a more capable CPU. The wait may be over, as there’s now the LoShark. It’s a USB key form factor, with a MIPS processor running a real Linux kernel. Cool!

The way debugging works is interesting, too. The team at SudoMaker is working on their Resonance runtime, which allows interacting with the onboard sx126x radio chip using JavaScript code. That chip can both send and receive, so this device should be capable of more than just capturing traffic. And if JavaScript isn’t your thing, the Linux system on the device means you can knock yourself out with C or C++ code. Who knows, we may even see Meshtastic running on this thing some day.

If this gets you excited, it’s already available for order for a reasonable $59.99. The LoShark ships in 433, 868, and 915 megahertz versions. It’s a really slick looking device, and maybe worth your time to check out. Enjoy!

Meshtastic For The Greater Good

Last week, my city was hit by a tornado. That’s not surprising here in Oklahoma, and thankfully this event was an F0 or possibly even an EF0 — a really weak tornado. Only a couple roofs collapsed, though probably half the houses in town are going to need roof repairs, thanks to the combination of huge hail and high winds. While it wasn’t too bad, power did go down in a few places around town, and this led to an interesting series of events.

Chat messages were coming in like this: “That was a [power] flicker, yeah. Even took down my Internet.” Followed by “Whee, [fiber Internet] got knocked out and now Starlink has too many clouds in the way.” And after ten minutes of silence, we got a bit worried to see “Time to hide under a bed. … Is cell service back?” It is a bit spooky to think about trying to help neighbors and friends after a disaster, in the midst of the communication breakdown that often follows. If he had needed help, and had no working communications, how long would it have taken for us to go check on him?
Continue reading “Meshtastic For The Greater Good”

Building A Communications Grid With LoRaType

Almost all of modern society is built around various infrastructure, whether that’s for electricity, water and sewer, transportation, or even communication. These vast networks aren’t immune from failure though, and at least as far as communication goes, plenty will reach for a radio of some sort to communicate when Internet or phone services are lacking. It turns out that certain LoRa devices are excellent for local communication as well, and this system known as LoraType looks to create off-grid text-based communications networks wherever they might be needed.

The project is based around the ESP32 platform with an E22 LoRa module built-in to allow it to operate within its UHF bands. It also includes a USB-based battery charger for its small battery, an e-paper display module to display the text messages without consuming too much power, and a keyboard layout for quickly typing messages. The device firmware lets it be largely automated; it will seek out other devices on the local mesh network automatically and the user can immediately begin communicating with other devices on that network as soon as it connects.

There are a few other upsides of using a device like this. Since it doesn’t require any existing communications infrastructure to function, it can be used wherever there are no other easy options, such as in the wilderness, during civil unrest where the common infrastructure has been shut down, or simply for local groups which do not have access to cell networks or Internet. LoRa is a powerful tool for these use cases, and it’s even possible to network together larger base stations to extend the range of devices like these.

Building A Local Network With LoRaWAN

At its core, the Internet is really just a bunch of computers networked together. There’s no reason that there can’t be other separate networks of computers, or that we all have to tie every computer we have to The One Internet To Rule Them All. In fact, for a lot of embedded systems, it doesn’t make much sense to give them a full network stack and Cat6e Ethernet just to report a few details about themselves. Enter LoRaWAN, a wireless LAN that uses extremely low power for Internet-of-Things devices, and an implementation of one of these networks in an urban environment.

The core of the build is the LoRaWAN gateway which sits at the top of a tall building to maximize the wireless range of all of the other devices. It’s running ChirpStack on the software side and uses a Kerlink Wigrid station to broadcast. The reported range is a little over 9 km with this setup. Other gateways can also be added, and the individual LoRa modules can report to any available gateway. From there, the gateways all communicate back to the central server and the information can be sent out to the wider network, Internet or otherwise.

The project’s creator [mihai.cuciuc] notes that this sort of solution might not be best for everyone. There are other wide area networks available, but using LoRaWAN like this would be likely to scale better as more and more devices are added to the network. For some other ways that LoRa can be used to great effect, take a look at this project which builds an off-grid communications network with it.

Farm Data Relay System: Combine LoRa And 2.4 Ghz Networks Without WiFi Routers And Cloud Dependence

Setting up a wireless sensor network over a wide area can quickly become costly, and making everything communicate smoothly can be a massive headache, especially when you’re combining short range Wi-Fi with long range LoRa. To simplify this, [Timm Bogner] created Farm Data Relay System which simplifies the process of combining LoRa, 2.4Ghz modules and serial communications in various topologies over wide areas.

The FDRS uses a combination of ESP32/8266 sensor nodes for short range, and LoRa nodes for long range. The ESP nodes use Espressif’s connectionless ESP-NOW peer-to-peer protocol on which allow multiple ESP boards to communicate directly without the need for a Wi-Fi router. The ESP modules can have one of 3 roles, nodes, repeaters or gateways, and gateways and repeaters share the same code. Nodes take sensor inputs, and are configured to each have a unique READING_ID.

Relays just retransmit ESP-NOW packets to extend the network range, while gateways convert packets between ESP-NOW, MQTT over Wi-Fi, LoRa or serial messages as required. Repeaters and gateways each have a unique UNIT_MAC for addressing. The code that handles communication for the ESP devices is simple and well documented, so you only need to set a few configuration values, and then can focus your efforts on the code required for your specific application.

The hub of the system is a Raspberry Pi running Node-RED which acts as the final MQTT gateway and connects to the ESP MQTT gateways. This means that all the action happens in the local network, without being dependent on an internet connection and cloud service. However, it can still send and receive data over the internet using MQTT or any other protocol as required. Node-RED makes it particularly easy to build custom automations and interfaces.

In the video after the break, Andreas Spiess, the man with the Swiss accent, who also has a hand in the project, goes over all the features, setup and caveats.

Continue reading “Farm Data Relay System: Combine LoRa And 2.4 Ghz Networks Without WiFi Routers And Cloud Dependence”

LoRa-Powered Birdhouses Enable Wireless Networking When The Internet’s Down

One of the design requirements for the networks that evolved into the Internet was the ability to keep functioning, even if some nodes or links were disabled or destroyed in war. The packet-switched architecture that still powers today’s Internet is a direct result of that: if one link stops functioning, information is automatically re-routed towards its intended destination. However, with tech giants occupying increasingly large parts of the global internet, an outage at one of them might still cause major disruption. In addition, a large-scale power interruption can disable large parts of the network if multiple nodes are connected to the same grid.

Six pieces of wood, with a hammer next to them
Just six pieces of wood make up the birdhouse.

Enter the LoRa Birdhouse project by the Wellesley Amateur Radio Society that solves those two problems, although admittedly at a very small scale. Developed by amateur radio operators in eastern Massachusetts, it’s basically a general-purpose LoRa-based packet-switching network. As it’s based on open-source hardware and commonly available components, its design allows anyone to set up a similar network in their own area.

The network is built from nodes that can receive messages from their neighbors and pass them on towards their final destination. Each node contains a Semtech SX1276 transceiver operating in the 902-928 MHz band, which gets its data from an ESP32 microcontroller. The nodes are placed in strategic locations outside and are powered by solar panels to reduce their ecological footprint, as well as to ensure resilience in case of a power outage. To make the whole project even more eco-friendly, each node is built into a birdhouse that provides shelter to small birds.

Users can access the network through modified network nodes that can be hooked up to a PC using a USB cable. Currently, a serial terminal program is the only way to interact with the network, although a more user-friendly interface is being planned. FCC rules also require all users (except any avian residents) to be licensed amateur radio operators, and all traffic to remain unencrypted. Tests have shown that one kilometer between nodes can work in the right conditions, enabling the deployment of networks across reasonably large areas.

While the Birdhouse Network might not be a plug-and-play internet replacement in case of a nuclear apocalypse, it does provide an excellent system to experiment with packet-switching wireless network technology. We’ve seen similar LoRa-based network initiatives like Qmesh, Cellsol and Meshtastic, all of which provide some way to communicate wirelessly without requiring any centralized hardware.