This project implements a LoRaWAN sensor node using the SX1262 transceiver and RP2040 microcontroller, leveraging the Embassy framework for efficient, asynchronous embedded programming. The node collects data from air (temperature, humidity, CO2) and soil (temperature, moisture) sensors, encodes it using Cayenne LPP, and transmits it over LoRaWAN. It's designed for low-power, long-range IoT applications.
- LoRaWAN Communication: Long-range, low-power wireless communication using the SX1262 transceiver.
- RP2040 Microcontroller: Efficient, dual-core processing for embedded applications.
- Embassy Framework: Asynchronous, non-blocking task management for optimal performance.
- Sensor Integration: Collects data from air and soil sensors.
- Cayenne LPP Encoding: Standardized payload format for easy integration with IoT platforms.
- Low-Power Design: Optimized for battery-powered operation (battery level reading planned).
- Raspberry Pi Pico (RP2040-based board)
- SX1262 LoRa module
- I2C sensors for air and soil data
- Rust toolchain with
thumbv6m-none-eabi
target probe-rs
for flashing and debugging- LoRaWAN network server (e.g., ChirpStack) for gateway and device management
- Clone the repository:
git clone https://github.com/nanobreaker/sx1262-rp2040-embassy.git
cd sx1262-rp2040-embassy
- Set up the Rust environment:
rustup target add thumbv6m-none-eabi
- Build the project:
cargo build
- Flash the firmware using
probe-rs
:
probe-rs run --chip RP2040 target/thumbv6m-none-eabi/debug/rp2040
- Configure Sensors: Update
config.rs
with your I2C addresses and LoRaWAN credentials. - Run the Application: After flashing, the device will automatically start collecting sensor data and sending uplinks over LoRaWAN.
cargo run
- Monitor Logs: Use
defmt
withprobe-rs
to view logs: - Decode Payloads: Use a Cayenne LPP decoder on your LoRaWAN network server to interpret the sensor data.
- Fork the repository and create a new branch for your feature or bugfix.
- Ensure your code follows Rust's embedded best practices and Embassy's guidelines.
- Submit a pull request with a clear description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.