BresserWeatherSensorTTN
Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver based on ESP32 and RFM95W/SX1276 - sends data to a LoRaWAN Network (e.g. The Things Network)
Install / Use
/learn @matthias-bs/BresserWeatherSensorTTNREADME
BresserWeatherSensorTTN
[!WARNING] This repository is deprecated and has been archived and set to read-only.
The recommended alternative is BresserWeatherSensorLW which provides more features and has a much cleaner architecture.
The underlying LoRaWAN libraries MCCI LoRaWAN LMIC library and MCCI Arduino LoRaWAN Library seem not to be maintained any longer.
Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver based on ESP32 and RFM95W/SX1276 - sends data to a LoRaWAN Network (e.g. The Things Network) Support for RP2040 (Arduino-Pico) has been added recently.
The RFM95W/SX1276 radio transceiver is used in FSK mode to receive weather sensor data and in LoRaWAN mode to connect to a LoRaWAN Network.
Auxiliary sensor data can be integrated via Bluetooth Low Energy (BLE), OneWire, UART, analog/digital inputs etc.
Features
- Single 868 MHz Radio Transceiver for both Sensor Data Reception and LoRaWAN Connection
- Tested with The Things Network and Helium Network (EU868)
- Supports multiple 868 MHz Sensors (e.g. Weather Sensor and Soil Moisture Sensor or Indoor Thermometer/Hygrometer)
- See BresserWeatherSensorReceiver for supported sensors
- Low Power Design (using ESP32 Deep Sleep Mode / RP2040 Sleep State)
- Fast LoRaWAN Joining after Deep Sleep (using ESP32 RTC RAM / RP2040 Flash)
- ATC MiThermometer Bluetooth Low Energy Thermometer/Hygrometer Integration (optional)
- Theengs Decoder Bluetooth Low Energy Sensors Integration (optional)
- OneWire Temperature Sensor Integration (optional)
- ESP32/RP2040 Analog Digital Converter Integration (optional)
- A02YYUW / DFRobot SEN0311 Ultrasonic Distance Sensor (30...4500mm) (optional)
- Remote Configuration via LoRaWAN Downlink
Supported Hardware
-
Resumably Heltec WiFi LoRa32 V2 (confirmation wanted!!!)
-
Presumably Adafruit Feather ESP32-S2 with Adafruit LoRa Radio FeatherWing (confirmation wanted!!!)
-
Presumably Adafruit Feather ESP32 with Adafruit LoRa Radio FeatherWing (confirmation wanted!!!)
-
Thingpulse ePulse Feather with Adafruit LoRa Radio FeatherWing
-
DFRobot FireBeetle ESP32 IoT Microcontroller with FireBeetle Cover LoRa Radio 868MHz
-
Adafruit Feather RP2040 with Adafruit LoRa Radio FeatherWing
See The Things Network's Big ESP32 + SX127x topic part 2 for some hardware options.
See Leonel Lopes Parente's collection of LoRa development boards pinout-diagrams.
Recommended Hardware
Beginners
You get a fully functional board (including antenna) which does not require any additional wiring for a reasonable price!
Advanced
ESP32 Module
DFRobot FireBeetle ESP32 IoT (DFR0478) recomended due to its good low power design.
RFM95W- or SX1276-based Radio Transceiver Module
- Adafruit RFM95W LoRa Radio Transceiver Breakout (ADA3072) - 868/915 MHz version (868 MHz is used for both LoRaWAN and Bresser Weather Sensor in Europe) with RF connector (u.FL or SMA as desired)
or
Antenna
- Delock 89769 - LoRa 868 MHz Antenna SMA plug 3 dBi omnidirectional has been used with good results
- EBYTE TX868-XP-100 868MHz SMA-J 3.5dBi High Gain Omnidirectional Antenna - larger, but better
Power Supply
Mains adapter or Li-Ion battery (with or without solar charger) - depending on desired operation time and duty cycle.
Software Build Setup
-
Install the Arduino ESP32 board package in the Arduino IDE -<br> Note: When using the ESP32 board package >=V2.0.5, you have to apply two fixes in arduino-lorawan and arduino-lmic, respectively (see below)
-
Select the desired ESP32 board
-
Install all libraries as listed in the section Library Dependencies via the Arduino IDE Library Manager
-
Configure
Arduino/libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h:- select you appropriate region
#define CFG_sx1276_radio 1
-
Add the following line to
Arduino/libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h:#define LMIC_ENABLE_DeviceTimeReq 1(Otherwise requesting the time from the LoRaWAN network will not work, even if supported by the network.)
-
Apply fixes if using ESP32 board package >= v2.0.5
- https://github.com/mcci-catena/arduino-lorawan/pull/204 (fixed in mcci-catena/arduino-lorawan v0.10.0)
- https://github.com/mcci-catena/arduino-lmic/issues/714#issuecomment-822051171
-
Clone (or download and unpack) the desired BresserWeatherSensorTTN release (Releases)
-
Load the sketch
BresserWeatherSensorTTN.inofrom the BresserWeatherSensorTTN directory -
Compile
Library Dependencies
| Library | r: required /<br>o: optional | | ---------------------------------- | ---------------------------- | | MCCI Arduino Development Kit ADK | r | | MCCI LoRaWAN LMIC library | r | | MCCI Arduino LoRaWAN Library | r | | RadioLib | r | | LoRa_Serialization | r | | ESP32Time | r | | BresserWeatherSensorReceiver | r | | Preferences | r (RP2040) | | OneWireNg | o | | DallasTemperature | o | | NimBLE-Arduino + ATC_MiThermometer | o | | NimBle-Arduino + Theengs Decoder | o | | DistanceSensor_A02YYUW | o |
See package.json for required/tested versions.
Software Customization
Configure the LoRaWAN Network settings APPEUI, DEVEUI and APPKEY
- First you have to follow your LoRaWAN Network provider's instructions on how to configure/obtain the settings.
- Then configure the BresserWeatherSensorTTN software accordingly:
- Solution 1 (not recommended):
Configure the section starting with
// APPEUI, DEVEUI and APPKEYin BresserWeatherSensorTTN.ino - Solution 2 (recommended):
Configure the file secrets.h - refer to secrets.h.template as an example --
#define SECRETS // deveui, little-endian static const std::uint8_t deveui[] = { 0xAA, 0xBB, 0xCC, 0x00, 0x00, 0xDD, 0xEE, 0xFF }; // appeui, little-endian static const std::uint8_t appeui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // appkey: just a string of bytes, sometimes referred to as "big endian". static const std::uint8_t appkey[] = { 0x11, 0x22, 0x33, 0
- Solution 1 (not recommended):
Configure the section starting with
