Skip to content

Latest commit

 

History

History
182 lines (142 loc) · 5.94 KB

File metadata and controls

182 lines (142 loc) · 5.94 KB

Week 10: LoRaWAN Sensor Network - TODO

Status: ✅ COMPLETE - Both nodes operational, full data pipeline live See also: ../DOCS/PLAN_WEEKLY.md for complete week-by-week breakdown

Project Status

  • Start Date: Week 10 (Phase 3)
  • Hardware: 2x NUCLEO-WL55JC1 (STM32WL with integrated LoRaWAN)
  • Gateway: RAK7268V2 WisGate Edge Lite 2 (AU915, Built-in LoRa Server)
  • Sensors: SHT41 (LoRa-1), BME680 (LoRa-2)
  • Displays: SSD1306 128x32 (LoRa-1), SH1106 128x64 (LoRa-2)
  • Status: ✅ COMPLETE

Hardware Inventory

  • RAK7268V2 LoRaWAN gateway (configured, AU915 Sub-band 2)
  • 2x NUCLEO-WL55JC1 boards
  • 1x BME680 sensor (on LoRa-2)
  • 1x SHT41 sensor (on LoRa-1)
  • 1x SSD1306 OLED 128x32 (LoRa-1)
  • 1x SH1106 OLED 128x64 (LoRa-2)
  • Breadboards, jumper wires

Day 1-2: Gateway & Hardware Setup ✅ COMPLETE

  • RAK7268V2 powered and configured (AU915 Sub-band 2)
  • Built-in LoRa Server operational (NOT ChirpStack)
  • Application "TOT" created with OTAA credentials
  • MQTT broker accessible at 10.10.10.254:1883
  • Both NUCLEO-WL55JC1 boards tested
  • probe-rs flashing and debugging operational
  • Embassy async framework verified

Day 3: LoRa-1 Implementation ✅ COMPLETE

  • SHT41 sensor integration (I2C 0x44)
  • SSD1306 OLED display (I2C 0x3C)
  • LoRaWAN OTAA join successful (DevEUI: 23ce1bfeff091fac)
  • Uplinks transmitting every ~30 seconds
  • 4-byte payload encoding (temp + humidity)
  • Display showing TX count, readings, SNR/RSSI
  • LED flash on transmission

Day 4: LoRa-2 Implementation ✅ COMPLETE

  • BME680 sensor integration (I2C 0x76)
  • SH1106 OLED display (I2C 0x3C)
  • LoRaWAN OTAA join successful (DevEUI: 24ce1bfeff091fac)
  • Uplinks transmitting every ~30 seconds
  • 12-byte payload encoding (temp + hum + pressure + gas)
  • Display showing TX count, readings, SNR/RSSI
  • LED flash on transmission

Day 5: Data Pipeline ✅ COMPLETE

  • Python MQTT bridge created (mqtt_to_influx.py)
  • Subscribe to gateway MQTT (10.10.10.254:1883)
  • Decode Base64 payloads (both 4-byte and 12-byte formats)
  • Write to InfluxDB (bucket: lorawan)
  • Docker Compose configuration for bridge container
  • End-to-end data flow verified

Day 6: Grafana Dashboard ✅ COMPLETE

  • InfluxDB datasource configured
  • Dashboard created with 10 panels:
    • Temperature (both nodes)
    • Humidity (both nodes)
    • Pressure (LoRa-2 only)
    • Gas Resistance (LoRa-2 only)
    • RSSI (both nodes)
    • SNR (both nodes)
    • Stat panels (latest values)
  • Dashboard JSON exported (grafana/lorawan-dashboard.json)

Day 7: Documentation ✅ COMPLETE

  • README.md - Complete system overview with architecture diagram
  • USERGUIDE.md - Comprehensive deployment guide (857 lines)
  • HARDWARE_CONFIG.md - Hardware specifications
  • LORAWAN_CREDENTIALS.md - Device credentials
  • docs/rak7268v2-config.md - Gateway configuration
  • TROUBLESHOOTING_WL55.md - Common issues and solutions
  • CLAUDE.md - Development guidance
  • NOTES.md - Technical learnings
  • STATUS.md - Current status summary
  • IMPLEMENTATION_SUMMARY.md - Implementation details

Firmware Implementation ✅ COMPLETE

LoRa-1 (firmware/lora-1/) ✅

  • Embassy async framework
  • STM32WL SubGHz radio initialization
  • lora-phy v3.0 driver
  • lorawan-device v0.12 MAC layer
  • OTAA join procedure
  • SHT41 sensor driver (integer math only)
  • SSD1306 display driver
  • Uplink transmission loop
  • SNR/RSSI tracking and display

LoRa-2 (firmware/lora-2/) ✅

  • Embassy async framework
  • STM32WL SubGHz radio initialization
  • lora-phy v3.0 driver
  • lorawan-device v0.12 MAC layer
  • OTAA join procedure
  • BME680 sensor driver (integer math only)
  • SH1106 display driver
  • Uplink transmission loop (12-byte payload)
  • SNR/RSSI tracking and display

Data Pipeline ✅ COMPLETE

MQTT Bridge (mqtt_to_influx.py) ✅

  • Subscribe to gateway MQTT topics
  • Parse JSON payload from gateway
  • Decode LoRaWAN payload (4-byte and 12-byte formats)
  • Write decoded data to InfluxDB
  • Docker container configuration

Testing ✅ COMPLETE

LoRaWAN Connectivity ✅

  • Both nodes join successfully
  • Uplinks received by gateway
  • RSSI: -13 to -80 dBm (typical)
  • SNR: 10-13 dB (typical)
  • End-to-end latency: <2 seconds

Data Pipeline ✅

  • MQTT messages received from gateway
  • Payloads decoded correctly
  • Data written to InfluxDB
  • Grafana displays real-time data

Deliverables ✅ ALL COMPLETE

  • RAK7268V2 LoRaWAN gateway deployed (AU915)
  • Built-in LoRa Server operational
  • 2x STM32WL55 LoRaWAN devices (OTAA, Class A)
  • Python MQTT bridge to InfluxDB
  • Grafana dashboard with 10 panels
  • Complete documentation set
  • USERGUIDE.md deployment guide

Stretch Goals (Future Work)

  • Implement downlink messages (Class A confirmed messages)
  • Add adaptive data rate (ADR) support
  • Implement low-power sleep mode
  • Add battery voltage monitoring
  • Integrate with Week 9 Modbus nodes (unified 4-node system)
  • Range testing at various distances

Key Learnings

  1. LoRaWAN byte order - EUIs must be reversed (little-endian) in firmware
  2. No FPU - STM32WL55 requires integer-only math
  3. SHT41 wake-up - Sensor needs measurement command before I2C scan
  4. MQTT 3.1 - RAK gateway requires older protocol version
  5. Embassy async - Peripheral stealing pattern for I2C sharing

Notes

  • Using native STM32WL LoRaWAN stack via lora-phy + lorawan-device
  • AU915 Sub-band 2 frequency plan (915.2-916.6 MHz)
  • Class A device (bi-directional with scheduled uplinks)
  • OTAA activation (secure key derivation)
  • Embassy async/await framework for consistency
  • Gateway uses built-in LoRa Server (NOT ChirpStack)

Status: ✅ Week 10 Complete Last Updated: 2026-01-09