Welcome to YTUnity

One free SpiderTaz Network account works across every network site.

Featured creators

Creators on the SpiderTaz Network

Become a creator →

Intro to LoRa Mesh Part 4: Meshtastic IoT Sensor Node | DigiKey

DigiKey Guide 8 days ago

Description

In this series, we explore LoRa mesh networking with Meshtastic and MeshCore, two open-source projects that let you send encrypted text messages and sensor data over several kilometers without cell service, Wi-Fi, or a satellite subscription. Over six episodes, we'll flash and configure nodes for both protocols, build a solar-powered repeater to extend the network's range, connect a sensor to a Meshtastic node to transmit telemetry, and finally bridge the mesh to a Home Assistant server over MQTT so you can log and visualize that data. If you've been hearing buzz about these protocols but don't know where to start, this series is for you.

To follow along with the series, you will need the following hardware:
SenseCAP Card Tracker T1000-E: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/114993369/24814479
XIAO ESP32S3 & Wio-SX1262 Kit: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010611/25835813
XIAO nRF52840 & Wio-SX1262 Kit: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010710/26553900
SenseCAP Solar Node P1-Pro: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/114993633/26834458
Raspberry Pi 4 or 5 (for Home Assistant in the final episode): https://www.digikey.com/en/products/detail/raspberry-pi/SC0195-9/12159401

Note that LoRa hardware is region-specific. Check the frequency band for your country before ordering. The United States and most of the Americas use 915 MHz, while Europe uses 433 MHz and 868 MHz. The SenseCAP P1 Pro's included antenna covers 868 to 915 MHz.

For this episode, you will also need:
Grove BME680 environmental sensor: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/101020513/9369933

You can read a full write-up of everything we cover in this video here: https://www.digikey.com/en/maker/tutorials/2026/intro-to-lora-mesh-part-4-meshtastic-iot-sensor-node

The Meshtastic firmware supports a number of environmental sensors out of the box, which means you can build a long-range IoT sensor node without writing any code. Connect a supported sensor over I2C, enable telemetry in the app, and the node starts broadcasting readings that any other node on the mesh can pick up. In this episode, we wire a Grove BME680 to a XIAO nRF52840 board for temperature, humidity, pressure, and gas readings, then read those measurements from a second node across the mesh.

There's a catch on this particular board: The XIAO nRF52840's normal I²C pins are consumed by the LoRa daughterboard, and the pins we need instead are reserved for GPS in the stock firmware, which means the I2C sensors won't work until you build a custom firmware variant with a specific flag enabled. We cover why, and I've linked a pre-compiled version above if you'd rather skip the build. The XIAO ESP32S3 doesn't have this limitation. We also talk through what the BME680 can and can't tell you reliably, including why indoor air quality readings need roughly two days of calibration before you should trust them.

Pre-compiled I2C firmware for the XIAO nRF52840: http://bit.ly/4aFy7aO

From there we configure the node in the app: switching the device role to Sensor, setting a fixed position so a stationary node isn't wasting airtime on GPS updates, and enabling both device and environment metrics on a broadcast interval. Note that when your phone is connected to the node, readings refresh about once a minute, but they only go out over the mesh at whatever interval you configured. We verify the mesh side properly by disconnecting and reading the sensor node from a T1000-E card tracker instead.

We close with two tools worth knowing when a node isn't behaving. The first is the serial monitor built into the web flasher, where the firmware's I2C scan at boot will tell you immediately whether your wiring is right. The second is the official Meshtastic Python package, which connects to a node over serial, BLE, or TCP and lets you script anything the app can do. We write a short script that listens for telemetry packets and prints environment and device metrics to the terminal as they arrive from across the mesh.

In the next episode, we'll pipe all of this telemetry into Home Assistant over MQTT for proper logging and dashboards.

Learn more:
Maker.io - https://www.digikey.com/en/maker
DigiKey’s Blog – TheCircuit https://www.digikey.com/en/blog
Connect with DigiKey on Facebook https://www.facebook.com/digikey.electronics/
And follow us on X: https://x.com/digikey

0:00 Intro
0:34 Overview of supported sensors
2:34 Hardware hookup
4:49 Custom firmware for the XIAO nRF52840
6:48 Configure telemetry on Meshtastic app
11:04 Test telemetry from another node
11:48 Meshtastic serial monitor for debugging
13:43 Using the Meshtastic Python library
18:58 Conclusion