Add LoRa sensor network support
- Design LoRa packet protocol with CRC16 validation - Add protocol header files (lora_protocol.h, lora_packet.h) - Create battery-powered remote node firmware template - Support for DHT22, BME680, DS18B20 sensors - Deep sleep for battery conservation - Automatic gateway registration - Add LoRa receive to gateway firmware - RadioLib SX1262 integration - Node registry for tracking up to 16 nodes - HTTP forwarding of received readings - ACK responses to remote nodes - Create comprehensive setup guide with wiring diagrams Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
265a53768e
commit
5554341b49
@@ -0,0 +1,120 @@
|
||||
; ZNET LoRa Remote Sensor Node
|
||||
; Battery-powered sensor nodes for temperature/humidity/VOC monitoring
|
||||
;
|
||||
; Supported boards:
|
||||
; - Heltec WiFi LoRa 32 V3
|
||||
; - TTGO LoRa32 (SX1276)
|
||||
; - DIY ESP32 + SX1262/SX1276 modules
|
||||
|
||||
[platformio]
|
||||
default_envs = heltec_v3
|
||||
|
||||
[env]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
upload_speed = 921600
|
||||
|
||||
; Common libraries for all variants
|
||||
lib_deps =
|
||||
sandeepmistry/LoRa@^0.8.0
|
||||
adafruit/Adafruit Unified Sensor@^1.1.14
|
||||
adafruit/DHT sensor library@^1.4.6
|
||||
adafruit/Adafruit BME680 Library@^2.0.4
|
||||
paulstoffregen/OneWire@^2.3.8
|
||||
milesburton/DallasTemperature@^3.11.0
|
||||
|
||||
build_flags =
|
||||
-DCORE_DEBUG_LEVEL=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
|
||||
; Common settings for battery optimization
|
||||
board_build.partitions = min_spiffs.csv
|
||||
|
||||
; ============================================================================
|
||||
; Heltec WiFi LoRa 32 V3 (Recommended - built-in OLED + SX1262)
|
||||
; ============================================================================
|
||||
[env:heltec_v3]
|
||||
board = heltec_wifi_lora_32_V3
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DLORA_BOARD_HELTEC_V3
|
||||
-DLORA_FREQUENCY=915.0
|
||||
; SX1262 pins for Heltec V3
|
||||
-DLORA_SCK=9
|
||||
-DLORA_MISO=11
|
||||
-DLORA_MOSI=10
|
||||
-DLORA_SS=8
|
||||
-DLORA_RST=12
|
||||
-DLORA_DIO1=14
|
||||
-DLORA_BUSY=13
|
||||
; OLED pins
|
||||
-DOLED_SDA=17
|
||||
-DOLED_SCL=18
|
||||
-DOLED_RST=21
|
||||
; Battery ADC
|
||||
-DBATTERY_ADC_PIN=1
|
||||
-DBATTERY_ADC_EN_PIN=37
|
||||
|
||||
lib_deps =
|
||||
${env.lib_deps}
|
||||
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.4.0
|
||||
jgromes/RadioLib@^6.4.0
|
||||
|
||||
; ============================================================================
|
||||
; TTGO LoRa32 V2.1 (SX1276)
|
||||
; ============================================================================
|
||||
[env:ttgo_lora32_v21]
|
||||
board = ttgo-lora32-v21
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DLORA_BOARD_TTGO_V21
|
||||
-DLORA_FREQUENCY=915.0
|
||||
; SX1276 pins for TTGO
|
||||
-DLORA_SCK=5
|
||||
-DLORA_MISO=19
|
||||
-DLORA_MOSI=27
|
||||
-DLORA_SS=18
|
||||
-DLORA_RST=23
|
||||
-DLORA_DIO0=26
|
||||
; OLED pins
|
||||
-DOLED_SDA=21
|
||||
-DOLED_SCL=22
|
||||
-DOLED_RST=16
|
||||
; Battery ADC
|
||||
-DBATTERY_ADC_PIN=35
|
||||
|
||||
lib_deps =
|
||||
${env.lib_deps}
|
||||
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.4.0
|
||||
|
||||
; ============================================================================
|
||||
; Generic ESP32 + SX1276 (DIY builds)
|
||||
; ============================================================================
|
||||
[env:esp32_sx1276]
|
||||
board = esp32dev
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DLORA_BOARD_GENERIC
|
||||
-DLORA_FREQUENCY=915.0
|
||||
; Define your own pins in config.h
|
||||
|
||||
; ============================================================================
|
||||
; DHT22 sensor variant (ambient temp/humidity)
|
||||
; ============================================================================
|
||||
[env:heltec_v3_dht22]
|
||||
extends = env:heltec_v3
|
||||
build_flags =
|
||||
${env:heltec_v3.build_flags}
|
||||
-DSENSOR_TYPE_DHT22
|
||||
-DDHT_PIN=7
|
||||
|
||||
; ============================================================================
|
||||
; BME680 sensor variant (temp/humidity/pressure/VOC)
|
||||
; ============================================================================
|
||||
[env:heltec_v3_bme680]
|
||||
extends = env:heltec_v3
|
||||
build_flags =
|
||||
${env:heltec_v3.build_flags}
|
||||
-DSENSOR_TYPE_BME680
|
||||
-DBME680_I2C_ADDR=0x76
|
||||
Reference in New Issue
Block a user