-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Visual Studio Code is our recommended IDE for development:
- Download VSCode from the official website
- Install for your operating system (Windows, macOS, or Linux)
- Launch VSCode and proceed to installing the required extensions
The following extensions are essential for development:
- PlatformIO VSCode - Main IDE extension.
- PlatformIO Core CLI - Required for RadioMesh build tools.
- Alternatively, you can install everything from the official PlatformIO Install page.
- Microsoft C++ - Provides IntelliSense support.
- Markdown Preview Github Styles - For documentation preview with GitHub styling.
- Serial Monitor - For interacting with your Arduino board. Note: you can also use the serial monitor provided with PlatformIO IDE.
- VSCode with PlatformIO installed
- Two compatible LoRa boards (see Hardware section below)
- USB cables for programming
The hub device manages the mesh network and handles device inclusion.
cd examples/DeviceInclusion/MiniHub
cp device_info_example.h device_info.h
# Edit device_info.h to set your device ID and radio parameters
../../tools/builder.py build --target local_heltec_wifi_lora_32_V3 --clean --deployThe hub provides a web admin panel for network management:
- Connect to the hub's WiFi access point (SSID: "MiniHubAP", Password: "firefly2517")
- Open http://192.168.20.1 in your browser
- Use the admin panel to enable inclusion mode when ready to add devices
Standard devices join the network through the hub's inclusion process.
cd examples/DeviceInclusion/Standard
cp device_info_example.h device_info.h
# Edit device_info.h to set unique device ID and matching radio parameters
../../tools/builder.py build --target local_seeed_xiao_esp32s3 --clean --deployThe standard device will automatically join when it detects the hub's inclusion broadcast.
Open serial monitors for both devices (115200 baud) to watch the automatic inclusion process and subsequent data exchange.
RadioMesh now features a fully automatic inclusion protocol built into the framework:
-
Zero Application Code: Inclusion is handled entirely by the
InclusionController - Automatic State Management: Protocol states and transitions are managed internally
- Built-in Retry Logic: Exponential backoff (5s, 10s, 20s) with 3 retry attempts
- Secure Key Exchange: ECDH-based key exchange for network security
- State Persistence: Devices remember their inclusion status across reboots
- Hub must be explicitly put into inclusion mode via:
- Web admin panel (http://192.168.20.1 after connecting to MiniHubAP WiFi)
- Programmatically using
device->enableInclusionMode(duration)
- Hub broadcasts
INCLUDE_OPENmessages periodically while in inclusion mode - Non-included devices automatically respond with
INCLUDE_REQUEST - Hub and device perform secure key exchange
- Device confirms inclusion and joins the network
- All messages are handled automatically by the protocol layer
Applications only need to:
- Enable inclusion mode on hubs when needed
- Optionally monitor inclusion events for UI updates
- No manual message handling or state management required
RadioMesh comes with a simple build tool written in python that provides a wrapper around platformIO CLI tool.
The tool is located in the tools directory and is called builder.py. It can be used instead of the platformio cli for building both the library and the examples.
All you have to do is run the script from a folder containing a platformio.ini.
usage: builder.py [-h] {version,build,test,clean,list-targets} ...
builder - A PlatformIO CLI Wrapper to build RadioMesh library and examples.
positional arguments:
{version,build,test,clean,list-targets}
Available commands
version Print cli version
build build the project for a specific target
test test the project for a specific target
clean clean the project for a specific target
list-targets list all available target environments
options:
-h, --help show this help message and exit
With builder, you can:
Show help for commands
./tools/builder.py build --help
List library build targets (from the project root)
% ./tools/builder.py list-targets
Build the library
Example:
% ./tools/builder.py build --target heltec_wifi_lora_32_V3 --clean - A clean library build for the Heltec WiFi LoRa v3 board.
Build and deploy examples
The DeviceInclusion example contains both Hub and Standard device configurations:
From examples/DeviceInclusion/MiniHub:
-
../../tools/builder.py build --target local_heltec_wifi_lora_32_V3 --clean- Clean build for hub -
../../tools/builder.py build --target local_heltec_wifi_lora_32_V3 --clean --deploy- Build and deploy hub
From examples/DeviceInclusion/Standard:
-
../../tools/builder.py build --target local_seeed_xiao_esp32s3 --clean- Clean build for standard device -
../../tools/builder.py build --target local_seeed_xiao_esp32s3 --clean --deploy- Build and deploy standard device
Run and deploy unit tests
Examples (from the project root):
-
% ./tools/builder.py test --target test_heltec_wifi_lora_32_V3- Run all tests -
% ./tools/builder.py test --target test_heltec_wifi_lora_32_V3 --suite test_DeviceBuilder- Run specific test suite
Note: tests are uploaded and run on the device, so you will need to connect your Arduino board using a USB cable for the command to work.
Currently, RadioMesh supports the following Arduino boards:
-
Heltec WiFi LoRa 32 V3 - ESP32S3 with SX1262 LoRa radio and OLED display
- PlatformIO board info
- Ideal for hub devices with display capabilities
-
Seeed XIAO ESP32S3 with LoRa module
- Compact form factor ideal for battery-powered nodes
- Requires external SX1262 LoRa module
-
Heltec CubeCell Board V2 - ASR650x series with SX1262
- PlatformIO board info
- Ultra-low power consumption for sensor nodes
- Also supports CubeCell Board Plus and other ASR650x variants
All devices in a mesh network must use compatible radio settings:
- Same frequency band (868MHz for EU, 915MHz for US)
- Same bandwidth, spreading factor, and coding rate
- Configured in
device_info.hfor each device
The DeviceInclusion example demonstrates the complete automatic inclusion process:
- Acts as the network hub managing device inclusion
- Features OLED display showing network status
- Automatically enables inclusion mode on startup
- Tracks inclusion statistics (requests, successful joins)
- Represents a typical sensor node
- Automatically joins the network when hub is in inclusion mode
- Sends periodic sensor data once included
- Minimal code required - inclusion is fully automatic
-
device_info.h- Device-specific configuration (ID, radio params) -
MiniHub.ino- Hub implementation with display UI -
StandardDevice.ino- Minimal standard device implementation
-
Devices not communicating
- Verify radio frequencies match between devices
- Check antenna connections
- Ensure devices are within range
- Monitor serial output for error messages
-
Inclusion failures
- Hub inclusion mode times out after 60 seconds by default
- Check for radio interference
- Verify unique device IDs
- Review protocol timeout settings
-
Build errors
- Ensure
device_info.hexists (copy fromdevice_info_example.h) - Verify PlatformIO environment matches your hardware
- Check RadioMesh library installation
- Ensure
-
Upload failures
- Verify correct USB port selection
- Check board is in programming mode
- Try different USB cable or port
- Review the DeviceInclusion README for detailed protocol information
- Explore the API documentation
- Check the Wiki for advanced topics
- Join the community discussions for support
RadioMesh source documentation can be found here