Weather Station

Link to GitHub Repository

https://github.com/jhughes1010/weather_v4_lora

NOTE: Certainly not ready for public consumption quite yet

Software Goals

  1. Minimal use of RTC variables

    1. TX data to the receiver for stable storage

    2. RTC will be used for rain gauge count and will be zeroed out after every send

  2. Creative way to sync TOD or calibrate RTC on weather station

    1. RTC is present on ESP32, but not good enough for long term time keeping (+/- 5% tolerance)

  3. Try to send raw data structure, not human readable txt

    1. minimize TX byte count. This will matter more for LoRaWAN TX budget

Software Milestones

LoRa equivalent of WiFi weather station v3.3 on devkit
Startup TOD request and periodic recalibrate of time
Calibrate to wake and send at user defined intervals (in code, but align sends to be on the 5’s, 10’s 15’s etc)
Basic data structure send to listener via LoRa
Bring tip gauge online
Bring all v3 sensor reads online. This will fill the data structure with live data, but it’s already being sent

Software Configuration

changes are needed in defines.h

LoRa radio band

This configures the radio to TX/RX on the desired legal frequency for your locale.

//=========================================== //LoRa band //=========================================== #define BAND 915E6 //you can set band here directly,e.g. 868E6,915E6

Wake Frequency

//=========================================== //Set how often to wake and read sensors //=========================================== const int UpdateIntervalSeconds = 30; //Sleep timer (30s) for my normal operation #define SEND_FREQUENCY_LORA 5

UpdateIntervalSeconds is set to define how often the station wakes. In the example above, we wake every 30s, and transmit every 5 wake operations. We also alternate the hardware and sensors data sends on the LoRa send.

Why wake, but not send. This lets us get improved resolution on the wind speed and gusting.

WAKE CYCLE

Activity

WAKE CYCLE

Activity

0

LoRa sensor send. Zero out gusting/max wind speed.

1

Wind speed measure and update max wind speed.

2

Wind speed measure and update max wind speed.

3

Wind speed measure and update max wind speed.

4

Wind speed measure and update max wind speed.

5

LoRa hardware send.

6

Wind speed measure and update max wind speed.

7

Wind speed measure and update max wind speed.

8

Wind speed measure and update max wind speed.

9

Wind speed measure and update max wind speed.

Every cycle is an opportunity to gather max wind speed data. Max speed and single sample speed data are sent on every bootCount%10==0 cycle. Not only do we receive instantaneous wind speed, but max wind speed over the last 10 measurement cycles ( or 5 minutes in my default case).