From f3aaf99358be3a6d0f6aae1c7ec5844f9aa63db8 Mon Sep 17 00:00:00 2001 From: matthias-bs <83612361+matthias-bs@users.noreply.github.com> Date: Thu, 30 Nov 2023 07:07:05 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20matthias?= =?UTF-8?q?-bs/BresserWeatherSensorReceiver@e7facc4a767ba2c1732e9e07b856e2?= =?UTF-8?q?6822f77620=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _weather_sensor_8h_source.html | 591 ++++++++++---------- _weather_sensor_cfg_8h_source.html | 863 ++++++++++++++--------------- class_weather_sensor-members.html | 7 +- class_weather_sensor.html | 28 - class_weather_sensor.js | 1 - functions.html | 3 - functions_func.html | 3 - navtreeindex0.js | 5 +- search/all_10.js | 2 +- search/all_11.js | 6 +- search/all_7.js | 3 +- search/all_8.js | 10 +- search/all_9.js | 2 +- search/all_a.js | 6 +- search/all_b.js | 6 +- search/all_c.js | 12 +- search/all_d.js | 18 +- search/all_e.js | 4 +- search/all_f.js | 10 +- search/classes_0.js | 2 +- search/classes_1.js | 4 +- search/classes_2.js | 4 +- search/classes_3.js | 2 +- search/classes_4.js | 6 +- search/classes_5.js | 4 +- search/functions_0.js | 2 +- search/functions_1.js | 8 +- search/functions_2.js | 2 +- search/functions_3.js | 4 +- search/functions_4.js | 6 +- search/functions_5.js | 3 +- search/functions_6.js | 2 +- search/functions_7.js | 2 +- search/functions_8.js | 2 +- search/groups_0.js | 2 +- search/typedefs_0.js | 2 +- search/variables_0.js | 2 +- search/variables_1.js | 2 +- search/variables_2.js | 4 +- search/variables_3.js | 2 +- search/variables_4.js | 4 +- search/variables_5.js | 2 +- search/variables_6.js | 6 +- search/variables_7.js | 2 +- search/variables_8.js | 2 +- search/variables_9.js | 4 +- search/variables_a.js | 6 +- search/variables_b.js | 10 +- search/variables_c.js | 4 +- search/variables_d.js | 8 +- search/variables_e.js | 2 +- search/variables_f.js | 2 +- 52 files changed, 828 insertions(+), 871 deletions(-) diff --git a/_weather_sensor_8h_source.html b/_weather_sensor_8h_source.html index 896eca8e..6e7bd4ba 100644 --- a/_weather_sensor_8h_source.html +++ b/_weather_sensor_8h_source.html @@ -152,303 +152,302 @@
65 // 20231025 Added Bresser Air Quality (Particulate Matter) Sensor, P/N 7009970
66 // Modified device type definitions
67 // 20231030 Refactored sensor data using a union to save memory
-
68 //
-
69 // ToDo:
-
70 // -
-
71 //
-
73 
-
74 #ifndef WeatherSensor_h
-
75 #define WeatherSensor_h
-
76 
-
77 #include <Arduino.h>
-
78 #include <RadioLib.h>
-
79 
-
80 
-
81 // Sensor Types
-
82 // 0 - Weather Station 5-in-1; PN 7002510..12/7902510..12
-
83 // 1 - Weather Station 6-in-1; PN 7002585
-
84 // - Professional Wind Gauge 6-in-1; PN 7002531
-
85 // - Weather Station 7-in-1; PN 7003300
-
86 // 2 - Thermo-/Hygro-Sensor 6-in-1; PN 7009999
-
87 // 3 - Pool / Spa Thermometer PN 7000073
-
88 // 4 - Soil Moisture Sensor 6-in-1; PN 7009972
-
89 // 5 - Water Leakage Sensor 6-in-1; PN 7009975
-
90 // 8 - Air Quality Sensor PM2.5/PM10
-
91 // 9 - Professional Rain Gauge (5-in-1 decoder)
-
92 // 9 - Lightning Sensor PN 7009976
-
93 // ? - CO2 Sensor
-
94 // ? - HCHO/VCO Sensor
-
95 #define SENSOR_TYPE_WEATHER0 0 // Weather Station
-
96 #define SENSOR_TYPE_WEATHER1 1 // Weather Station
-
97 #define SENSOR_TYPE_THERMO_HYGRO 2 // Thermo-/Hygro-Sensor
-
98 #define SENSOR_TYPE_POOL_THERMO 3 // Pool / Spa Thermometer
-
99 #define SENSOR_TYPE_SOIL 4 // Soil Temperature and Moisture (from 6-in-1 decoder)
-
100 #define SENSOR_TYPE_LEAKAGE 5 // Water Leakage
-
101 #define SENSOR_TYPE_AIR_PM 8 // Air Quality Sensor (Particle Matter)
-
102 #define SENSOR_TYPE_RAIN 9 // Professional Rain Gauge (from 5-in-1 decoder)
-
103 #define SENSOR_TYPE_LIGHTNING 9 // Lightning Sensor
-
104 
-
105 
-
106 // Sensor specific rain gauge overflow threshold (mm)
-
107 #define WEATHER0_RAIN_OV 1000
-
108 #define WEATHER1_RAIN_OV 100000
-
109 
-
110 
-
111 // Flags for controlling completion of reception in getData()
-
112 #define DATA_COMPLETE 0x1 // only completed slots (as opposed to partially filled)
-
113 #define DATA_TYPE 0x2 // at least one slot with specific sensor type
-
114 #define DATA_ALL_SLOTS 0x8 // all slots completed
-
115 
-
116 // Message buffer size
-
117 #define MSG_BUF_SIZE 27
-
118 
-
119 // Radio message decoding status
-
120 typedef enum DecodeStatus {
-
121  DECODE_INVALID, DECODE_OK, DECODE_PAR_ERR, DECODE_CHK_ERR, DECODE_DIG_ERR, DECODE_SKIP, DECODE_FULL
-
122 } DecodeStatus;
-
123 
-
124 
-
125 #if !defined(ARDUINO_ARCH_AVR)
-
126 #include <string>
-
127 
-
133 typedef struct SensorMap {
-
134  uint32_t id;
-
135  std::string name;
-
136 } SensorMap;
-
137 #endif
-
138 
-
139 
-
146 class WeatherSensor {
-
147  public:
-
152  /*
-
153  WeatherSensor()
-
154  {
-
155  //memset(this, 0, sizeof(*this));
-
156  };
-
157  */
-
163  int16_t begin(void);
-
164 
-
165 
-
182  bool getData(uint32_t timeout, uint8_t flags = 0, uint8_t type = 0, void (*func)() = NULL);
-
183 
-
184 
-
191  DecodeStatus getMessage(void);
-
192 
-
199  DecodeStatus decodeMessage(const uint8_t *msg, uint8_t msgSize);
-
200 
-
201  struct Weather {
-
202  bool temp_ok = false;
-
203  bool humidity_ok = false;
-
204  bool light_ok = false;
-
205  bool uv_ok = false;
-
206  bool wind_ok = false;
-
207  bool rain_ok = false;
-
208  float temp_c = 0.0;
-
209  float light_klx = 0.0;
-
210  float light_lux = 0.0;
-
211  float uv = 0.0;
-
212  float rain_mm = 0.0;
-
213  #ifdef WIND_DATA_FLOATINGPOINT
-
214  float wind_direction_deg = 0.0;
-
215  float wind_gust_meter_sec = 0.0;
-
216  float wind_avg_meter_sec = 0.0;
-
217  #endif
-
218  #ifdef WIND_DATA_FIXEDPOINT
-
219  // For LoRa_Serialization:
-
220  // fixed point integer with 1 decimal -
-
221  // saves two bytes compared to "RawFloat"
-
222  uint16_t wind_direction_deg_fp1 = 0;
-
223  uint16_t wind_gust_meter_sec_fp1 = 0;
-
224  uint16_t wind_avg_meter_sec_fp1 = 0;
-
225  #endif
-
226  uint8_t humidity = 0;
-
227  };
-
228 
-
229  struct Soil {
-
230  float temp_c;
-
231  uint8_t moisture;
-
232  };
-
233 
-
234  struct Lightning {
-
235  uint8_t distance_km;
-
236  uint8_t strike_count;
-
237  uint16_t unknown1;
-
238  uint16_t unknown2;
-
239 
-
240  };
+
68 // 20231130 Bresser 3-in-1 Professional Wind Gauge / Anemometer, PN 7002531: Replaced workaround
+
69 // for negative temperatures by fix (6-in-1 decoder)
+
70 //
+
71 // ToDo:
+
72 // -
+
73 //
+
75 
+
76 #ifndef WeatherSensor_h
+
77 #define WeatherSensor_h
+
78 
+
79 #include <Arduino.h>
+
80 #include <RadioLib.h>
+
81 
+
82 
+
83 // Sensor Types
+
84 // 0 - Weather Station 5-in-1; PN 7002510..12/7902510..12
+
85 // 1 - Weather Station 6-in-1; PN 7002585
+
86 // - Professional Wind Gauge 6-in-1; PN 7002531
+
87 // - Weather Station 7-in-1; PN 7003300
+
88 // 2 - Thermo-/Hygro-Sensor 6-in-1; PN 7009999
+
89 // 3 - Pool / Spa Thermometer PN 7000073
+
90 // 4 - Soil Moisture Sensor 6-in-1; PN 7009972
+
91 // 5 - Water Leakage Sensor 6-in-1; PN 7009975
+
92 // 8 - Air Quality Sensor PM2.5/PM10
+
93 // 9 - Professional Rain Gauge (5-in-1 decoder)
+
94 // 9 - Lightning Sensor PN 7009976
+
95 // ? - CO2 Sensor
+
96 // ? - HCHO/VCO Sensor
+
97 #define SENSOR_TYPE_WEATHER0 0 // Weather Station
+
98 #define SENSOR_TYPE_WEATHER1 1 // Weather Station
+
99 #define SENSOR_TYPE_THERMO_HYGRO 2 // Thermo-/Hygro-Sensor
+
100 #define SENSOR_TYPE_POOL_THERMO 3 // Pool / Spa Thermometer
+
101 #define SENSOR_TYPE_SOIL 4 // Soil Temperature and Moisture (from 6-in-1 decoder)
+
102 #define SENSOR_TYPE_LEAKAGE 5 // Water Leakage
+
103 #define SENSOR_TYPE_AIR_PM 8 // Air Quality Sensor (Particle Matter)
+
104 #define SENSOR_TYPE_RAIN 9 // Professional Rain Gauge (from 5-in-1 decoder)
+
105 #define SENSOR_TYPE_LIGHTNING 9 // Lightning Sensor
+
106 
+
107 
+
108 // Sensor specific rain gauge overflow threshold (mm)
+
109 #define WEATHER0_RAIN_OV 1000
+
110 #define WEATHER1_RAIN_OV 100000
+
111 
+
112 
+
113 // Flags for controlling completion of reception in getData()
+
114 #define DATA_COMPLETE 0x1 // only completed slots (as opposed to partially filled)
+
115 #define DATA_TYPE 0x2 // at least one slot with specific sensor type
+
116 #define DATA_ALL_SLOTS 0x8 // all slots completed
+
117 
+
118 // Message buffer size
+
119 #define MSG_BUF_SIZE 27
+
120 
+
121 // Radio message decoding status
+
122 typedef enum DecodeStatus {
+
123  DECODE_INVALID, DECODE_OK, DECODE_PAR_ERR, DECODE_CHK_ERR, DECODE_DIG_ERR, DECODE_SKIP, DECODE_FULL
+
124 } DecodeStatus;
+
125 
+
126 
+
127 #if !defined(ARDUINO_ARCH_AVR)
+
128 #include <string>
+
129 
+
135 typedef struct SensorMap {
+
136  uint32_t id;
+
137  std::string name;
+
138 } SensorMap;
+
139 #endif
+
140 
+
141 
+
148 class WeatherSensor {
+
149  public:
+
154  /*
+
155  WeatherSensor()
+
156  {
+
157  //memset(this, 0, sizeof(*this));
+
158  };
+
159  */
+
165  int16_t begin(void);
+
166 
+
167 
+
184  bool getData(uint32_t timeout, uint8_t flags = 0, uint8_t type = 0, void (*func)() = NULL);
+
185 
+
186 
+
193  DecodeStatus getMessage(void);
+
194 
+
201  DecodeStatus decodeMessage(const uint8_t *msg, uint8_t msgSize);
+
202 
+
203  struct Weather {
+
204  bool temp_ok = false;
+
205  bool humidity_ok = false;
+
206  bool light_ok = false;
+
207  bool uv_ok = false;
+
208  bool wind_ok = false;
+
209  bool rain_ok = false;
+
210  float temp_c = 0.0;
+
211  float light_klx = 0.0;
+
212  float light_lux = 0.0;
+
213  float uv = 0.0;
+
214  float rain_mm = 0.0;
+
215  #ifdef WIND_DATA_FLOATINGPOINT
+
216  float wind_direction_deg = 0.0;
+
217  float wind_gust_meter_sec = 0.0;
+
218  float wind_avg_meter_sec = 0.0;
+
219  #endif
+
220  #ifdef WIND_DATA_FIXEDPOINT
+
221  // For LoRa_Serialization:
+
222  // fixed point integer with 1 decimal -
+
223  // saves two bytes compared to "RawFloat"
+
224  uint16_t wind_direction_deg_fp1 = 0;
+
225  uint16_t wind_gust_meter_sec_fp1 = 0;
+
226  uint16_t wind_avg_meter_sec_fp1 = 0;
+
227  #endif
+
228  uint8_t humidity = 0;
+
229  };
+
230 
+
231  struct Soil {
+
232  float temp_c;
+
233  uint8_t moisture;
+
234  };
+
235 
+
236  struct Lightning {
+
237  uint8_t distance_km;
+
238  uint8_t strike_count;
+
239  uint16_t unknown1;
+
240  uint16_t unknown2;
241 
-
242  struct Leakage {
-
243  bool alarm;
-
244  };
-
245 
-
246  struct AirPM {
-
247  uint16_t pm_2_5;
-
248  uint16_t pm_10;
-
249  };
-
250 
-
256  struct Sensor {
-
257  uint32_t sensor_id;
-
258  float rssi;
-
259  uint8_t s_type;
-
260  uint8_t chan;
-
261  bool startup = false;
-
262  bool battery_ok;
-
263  bool valid;
-
264  bool complete;
-
265  union {
-
266  struct Weather w;
-
267  struct Soil soil;
-
268  struct Lightning lgt;
-
269  struct Leakage leak;
-
270  struct AirPM pm;
-
271  };
-
272 
-
273  Sensor ()
-
274  {
-
275  memset(this, 0, sizeof(*this));
-
276  };
-
277  };
-
278 
-
279  typedef struct Sensor sensor_t;
-
280  sensor_t sensor[NUM_SENSORS];
-
281  float rssi = 0.0;
-
282 
-
283 
-
289  bool genMessage(int i, uint32_t id = 0xff, uint8_t s_type = 1, uint8_t channel = 0, uint8_t startup = 0);
-
290 
-
291 
-
300  void clearSlots(uint8_t type = 0xFF)
-
301  {
-
302  for (int i=0; i< NUM_SENSORS; i++) {
-
303  if ((type == 0xFF) || (sensor[i].s_type == type)) {
-
304  sensor[i].valid = false;
-
305  sensor[i].complete = false;
-
306  }
-
307  }
-
308  };
-
309 
-
317  int findId(uint32_t id);
-
318 
-
319 
-
328  int findType(uint8_t type, uint8_t channel = 0xFF);
-
329 
-
338  bool is_decode3in1(uint32_t id);
-
339 
-
340  private:
-
341  struct Sensor *pData;
-
342 
-
360  int findSlot(uint32_t id, DecodeStatus * status);
-
361 
-
362 
-
363  #ifdef BRESSER_5_IN_1
-
373  DecodeStatus decodeBresser5In1Payload(const uint8_t *msg, uint8_t msgSize);
-
374  #endif
-
375  #ifdef BRESSER_6_IN_1
-
387  DecodeStatus decodeBresser6In1Payload(const uint8_t *msg, uint8_t msgSize);
-
388  #endif
-
389  #ifdef BRESSER_7_IN_1
-
399  DecodeStatus decodeBresser7In1Payload(const uint8_t *msg, uint8_t msgSize);
-
400  #endif
-
401  #ifdef BRESSER_LIGHTNING
-
411  DecodeStatus decodeBresserLightningPayload(const uint8_t *msg, uint8_t msgSize);
-
412  #endif
-
413  #ifdef BRESSER_LEAKAGE
-
423  DecodeStatus decodeBresserLeakagePayload(const uint8_t *msg, uint8_t msgSize);
-
424  #endif
-
425 
-
426  protected:
-
430  uint16_t lfsr_digest16(uint8_t const message[], unsigned bytes, uint16_t gen, uint16_t key);
-
431 
-
440  int add_bytes(uint8_t const message[], unsigned num_bytes);
-
441 
-
452  uint16_t crc16(uint8_t const message[], unsigned nBytes, uint16_t polynomial, uint16_t init);
-
453 
-
454  #if CORE_DEBUG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
-
466  void log_message(const char *descr, const uint8_t *msg, uint8_t msgSize) {
-
467  char buf[128];
-
468  const char txt[] = "Byte #: ";
-
469  int offs;
-
470  int len1 = strlen(txt);
-
471  int len2 = strlen(descr) + 2; // add colon and space
-
472  int prefix_len = max(len1, len2);
-
473 
-
474  memset(buf, ' ', prefix_len);
-
475  buf[prefix_len] = '\0';
-
476  offs = (len1 < len2) ? (len2 - len1) : 0;
-
477  strcpy(&buf[offs], txt);
-
478 
-
479  // Print byte index
-
480  for (size_t i = 0 ; i < msgSize; i++) {
-
481  sprintf(&buf[strlen(buf)], "%02d ", i);
-
482  }
-
483  log_d("%s", buf);
-
484 
-
485  memset(buf, ' ', prefix_len);
-
486  buf[prefix_len] ='\0';
-
487  offs = (len1 > len2) ? (len1 - len2) : 0;
-
488  sprintf(&buf[offs], "%s: ", descr);
-
489 
-
490  for (size_t i = 0 ; i < msgSize; i++) {
-
491  sprintf(&buf[strlen(buf)], "%02X ", msg[i]);
-
492  }
-
493  log_d("%s", buf);
-
494  }
-
495  #endif
-
496 
-
497 };
-
498 
-
499 #endif
-
WeatherSensor
Receive, decode and store Bresser Weather Sensor Data Uses CC1101 or SX1276 radio module for receivin...
Definition: WeatherSensor.h:146
-
WeatherSensor::getMessage
DecodeStatus getMessage(void)
Tries to receive radio message (non-blocking) and to decode it. Timeout occurs after a multitude of e...
Definition: WeatherSensor.cpp:227
-
WeatherSensor::findId
int findId(uint32_t id)
Definition: WeatherSensor.cpp:442
-
WeatherSensor::is_decode3in1
bool is_decode3in1(uint32_t id)
Definition: WeatherSensor.cpp:468
-
WeatherSensor::rssi
float rssi
received signal strength indicator in dBm
Definition: WeatherSensor.h:281
-
WeatherSensor::getData
bool getData(uint32_t timeout, uint8_t flags=0, uint8_t type=0, void(*func)()=NULL)
Wait for reception of data or occurrance of timeout. With BRESSER_6_IN_1, data is distributed across ...
Definition: WeatherSensor.cpp:170
-
WeatherSensor::begin
int16_t begin(void)
Constructor.
Definition: WeatherSensor.cpp:106
-
WeatherSensor::findType
int findType(uint8_t type, uint8_t channel=0xFF)
Definition: WeatherSensor.cpp:455
-
WeatherSensor::sensor
sensor_t sensor[NUM_SENSORS]
sensor data array
Definition: WeatherSensor.h:280
-
WeatherSensor::genMessage
bool genMessage(int i, uint32_t id=0xff, uint8_t s_type=1, uint8_t channel=0, uint8_t startup=0)
Generates data otherwise received and decoded from a radio message.
Definition: WeatherSensor.cpp:313
-
WeatherSensor::sensor_t
struct Sensor sensor_t
Shortcut for struct Sensor.
Definition: WeatherSensor.h:279
-
WeatherSensor::clearSlots
void clearSlots(uint8_t type=0xFF)
Clear sensor data.
Definition: WeatherSensor.h:300
-
WeatherSensor::decodeMessage
DecodeStatus decodeMessage(const uint8_t *msg, uint8_t msgSize)
Decode message Tries the available decoders until a decoding was successful.
Definition: WeatherSensor.cpp:269
-
SensorMap
Mapping of sensor IDs to names.
Definition: WeatherSensor.h:133
-
SensorMap::name
std::string name
Name of sensor (e.g. for MQTT topic)
Definition: WeatherSensor.h:135
-
SensorMap::id
uint32_t id
ID if sensor (as transmitted in radio message)
Definition: WeatherSensor.h:134
-
WeatherSensor::AirPM
Definition: WeatherSensor.h:246
-
WeatherSensor::AirPM::pm_2_5
uint16_t pm_2_5
air quality PM2.5 in µg/m³
Definition: WeatherSensor.h:247
-
WeatherSensor::AirPM::pm_10
uint16_t pm_10
air quality PM10 in µg/m³
Definition: WeatherSensor.h:248
-
WeatherSensor::Leakage
Definition: WeatherSensor.h:242
-
WeatherSensor::Leakage::alarm
bool alarm
water leakage alarm (only water leakage)
Definition: WeatherSensor.h:243
-
WeatherSensor::Lightning
Definition: WeatherSensor.h:234
-
WeatherSensor::Lightning::unknown1
uint16_t unknown1
unknown part 1
Definition: WeatherSensor.h:237
-
WeatherSensor::Lightning::strike_count
uint8_t strike_count
lightning strike counter (only lightning)
Definition: WeatherSensor.h:236
-
WeatherSensor::Lightning::distance_km
uint8_t distance_km
lightning distance in km (only lightning)
Definition: WeatherSensor.h:235
-
WeatherSensor::Lightning::unknown2
uint16_t unknown2
unknown part 2
Definition: WeatherSensor.h:238
-
WeatherSensor::Sensor
sensor data and status flags
Definition: WeatherSensor.h:256
-
WeatherSensor::Sensor::battery_ok
bool battery_ok
battery o.k.
Definition: WeatherSensor.h:262
-
WeatherSensor::Sensor::rssi
float rssi
received signal strength indicator in dBm
Definition: WeatherSensor.h:258
-
WeatherSensor::Sensor::complete
bool complete
data is split into two separate messages is complete (only 6-in-1 WS)
Definition: WeatherSensor.h:264
-
WeatherSensor::Sensor::s_type
uint8_t s_type
sensor type
Definition: WeatherSensor.h:259
-
WeatherSensor::Sensor::startup
bool startup
startup after reset / battery change
Definition: WeatherSensor.h:261
-
WeatherSensor::Sensor::sensor_id
uint32_t sensor_id
sensor ID (5-in-1: 1 byte / 6-in-1: 4 bytes / 7-in-1: 2 bytes)
Definition: WeatherSensor.h:257
-
WeatherSensor::Sensor::chan
uint8_t chan
channel
Definition: WeatherSensor.h:260
-
WeatherSensor::Sensor::valid
bool valid
data valid (but not necessarily complete)
Definition: WeatherSensor.h:263
-
WeatherSensor::Soil
Definition: WeatherSensor.h:229
-
WeatherSensor::Soil::temp_c
float temp_c
temperature in degC
Definition: WeatherSensor.h:230
-
WeatherSensor::Soil::moisture
uint8_t moisture
moisture in % (only 6-in-1)
Definition: WeatherSensor.h:231
-
WeatherSensor::Weather
Definition: WeatherSensor.h:201
-
WeatherSensor::Weather::light_klx
float light_klx
Light KLux (only 7-in-1)
Definition: WeatherSensor.h:209
-
WeatherSensor::Weather::light_ok
bool light_ok
light o.k. (only 7-in-1)
Definition: WeatherSensor.h:204
-
WeatherSensor::Weather::light_lux
float light_lux
Light lux (only 7-in-1)
Definition: WeatherSensor.h:210
-
WeatherSensor::Weather::temp_ok
bool temp_ok
temperature o.k. (only 6-in-1)
Definition: WeatherSensor.h:202
-
WeatherSensor::Weather::temp_c
float temp_c
temperature in degC
Definition: WeatherSensor.h:208
-
WeatherSensor::Weather::humidity
uint8_t humidity
humidity in %
Definition: WeatherSensor.h:226
-
WeatherSensor::Weather::uv
float uv
uv radiation (only 6-in-1)
Definition: WeatherSensor.h:211
-
WeatherSensor::Weather::humidity_ok
bool humidity_ok
humidity o.k.
Definition: WeatherSensor.h:203
-
WeatherSensor::Weather::wind_ok
bool wind_ok
wind speed/direction o.k. (only 6-in-1)
Definition: WeatherSensor.h:206
-
WeatherSensor::Weather::uv_ok
bool uv_ok
uv radiation o.k. (only 6-in-1)
Definition: WeatherSensor.h:205
-
WeatherSensor::Weather::rain_mm
float rain_mm
rain gauge level in mm
Definition: WeatherSensor.h:212
-
WeatherSensor::Weather::rain_ok
bool rain_ok
rain gauge level o.k.
Definition: WeatherSensor.h:207
+
242  };
+
243 
+
244  struct Leakage {
+
245  bool alarm;
+
246  };
+
247 
+
248  struct AirPM {
+
249  uint16_t pm_2_5;
+
250  uint16_t pm_10;
+
251  };
+
252 
+
258  struct Sensor {
+
259  uint32_t sensor_id;
+
260  float rssi;
+
261  uint8_t s_type;
+
262  uint8_t chan;
+
263  bool startup = false;
+
264  bool battery_ok;
+
265  bool valid;
+
266  bool complete;
+
267  union {
+
268  struct Weather w;
+
269  struct Soil soil;
+
270  struct Lightning lgt;
+
271  struct Leakage leak;
+
272  struct AirPM pm;
+
273  };
+
274 
+
275  Sensor ()
+
276  {
+
277  memset(this, 0, sizeof(*this));
+
278  };
+
279  };
+
280 
+
281  typedef struct Sensor sensor_t;
+
282  sensor_t sensor[NUM_SENSORS];
+
283  float rssi = 0.0;
+
284 
+
285 
+
291  bool genMessage(int i, uint32_t id = 0xff, uint8_t s_type = 1, uint8_t channel = 0, uint8_t startup = 0);
+
292 
+
293 
+
302  void clearSlots(uint8_t type = 0xFF)
+
303  {
+
304  for (int i=0; i< NUM_SENSORS; i++) {
+
305  if ((type == 0xFF) || (sensor[i].s_type == type)) {
+
306  sensor[i].valid = false;
+
307  sensor[i].complete = false;
+
308  }
+
309  }
+
310  };
+
311 
+
319  int findId(uint32_t id);
+
320 
+
321 
+
330  int findType(uint8_t type, uint8_t channel = 0xFF);
+
331 
+
332  private:
+
333  struct Sensor *pData;
+
334 
+
352  int findSlot(uint32_t id, DecodeStatus * status);
+
353 
+
354 
+
355  #ifdef BRESSER_5_IN_1
+
365  DecodeStatus decodeBresser5In1Payload(const uint8_t *msg, uint8_t msgSize);
+
366  #endif
+
367  #ifdef BRESSER_6_IN_1
+
379  DecodeStatus decodeBresser6In1Payload(const uint8_t *msg, uint8_t msgSize);
+
380  #endif
+
381  #ifdef BRESSER_7_IN_1
+
391  DecodeStatus decodeBresser7In1Payload(const uint8_t *msg, uint8_t msgSize);
+
392  #endif
+
393  #ifdef BRESSER_LIGHTNING
+
403  DecodeStatus decodeBresserLightningPayload(const uint8_t *msg, uint8_t msgSize);
+
404  #endif
+
405  #ifdef BRESSER_LEAKAGE
+
415  DecodeStatus decodeBresserLeakagePayload(const uint8_t *msg, uint8_t msgSize);
+
416  #endif
+
417 
+
418  protected:
+
422  uint16_t lfsr_digest16(uint8_t const message[], unsigned bytes, uint16_t gen, uint16_t key);
+
423 
+
432  int add_bytes(uint8_t const message[], unsigned num_bytes);
+
433 
+
444  uint16_t crc16(uint8_t const message[], unsigned nBytes, uint16_t polynomial, uint16_t init);
+
445 
+
446  #if CORE_DEBUG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
+
458  void log_message(const char *descr, const uint8_t *msg, uint8_t msgSize) {
+
459  char buf[128];
+
460  const char txt[] = "Byte #: ";
+
461  int offs;
+
462  int len1 = strlen(txt);
+
463  int len2 = strlen(descr) + 2; // add colon and space
+
464  int prefix_len = max(len1, len2);
+
465 
+
466  memset(buf, ' ', prefix_len);
+
467  buf[prefix_len] = '\0';
+
468  offs = (len1 < len2) ? (len2 - len1) : 0;
+
469  strcpy(&buf[offs], txt);
+
470 
+
471  // Print byte index
+
472  for (size_t i = 0 ; i < msgSize; i++) {
+
473  sprintf(&buf[strlen(buf)], "%02d ", i);
+
474  }
+
475  log_d("%s", buf);
+
476 
+
477  memset(buf, ' ', prefix_len);
+
478  buf[prefix_len] ='\0';
+
479  offs = (len1 > len2) ? (len1 - len2) : 0;
+
480  sprintf(&buf[offs], "%s: ", descr);
+
481 
+
482  for (size_t i = 0 ; i < msgSize; i++) {
+
483  sprintf(&buf[strlen(buf)], "%02X ", msg[i]);
+
484  }
+
485  log_d("%s", buf);
+
486  }
+
487  #endif
+
488 
+
489 };
+
490 
+
491 #endif
+
WeatherSensor
Receive, decode and store Bresser Weather Sensor Data Uses CC1101 or SX1276 radio module for receivin...
Definition: WeatherSensor.h:148
+
WeatherSensor::getMessage
DecodeStatus getMessage(void)
Tries to receive radio message (non-blocking) and to decode it. Timeout occurs after a multitude of e...
Definition: WeatherSensor.cpp:226
+
WeatherSensor::findId
int findId(uint32_t id)
Definition: WeatherSensor.cpp:441
+
WeatherSensor::rssi
float rssi
received signal strength indicator in dBm
Definition: WeatherSensor.h:283
+
WeatherSensor::getData
bool getData(uint32_t timeout, uint8_t flags=0, uint8_t type=0, void(*func)()=NULL)
Wait for reception of data or occurrance of timeout. With BRESSER_6_IN_1, data is distributed across ...
Definition: WeatherSensor.cpp:169
+
WeatherSensor::begin
int16_t begin(void)
Constructor.
Definition: WeatherSensor.cpp:105
+
WeatherSensor::findType
int findType(uint8_t type, uint8_t channel=0xFF)
Definition: WeatherSensor.cpp:454
+
WeatherSensor::sensor
sensor_t sensor[NUM_SENSORS]
sensor data array
Definition: WeatherSensor.h:282
+
WeatherSensor::genMessage
bool genMessage(int i, uint32_t id=0xff, uint8_t s_type=1, uint8_t channel=0, uint8_t startup=0)
Generates data otherwise received and decoded from a radio message.
Definition: WeatherSensor.cpp:312
+
WeatherSensor::sensor_t
struct Sensor sensor_t
Shortcut for struct Sensor.
Definition: WeatherSensor.h:281
+
WeatherSensor::clearSlots
void clearSlots(uint8_t type=0xFF)
Clear sensor data.
Definition: WeatherSensor.h:302
+
WeatherSensor::decodeMessage
DecodeStatus decodeMessage(const uint8_t *msg, uint8_t msgSize)
Decode message Tries the available decoders until a decoding was successful.
Definition: WeatherSensor.cpp:268
+
SensorMap
Mapping of sensor IDs to names.
Definition: WeatherSensor.h:135
+
SensorMap::name
std::string name
Name of sensor (e.g. for MQTT topic)
Definition: WeatherSensor.h:137
+
SensorMap::id
uint32_t id
ID if sensor (as transmitted in radio message)
Definition: WeatherSensor.h:136
+
WeatherSensor::AirPM
Definition: WeatherSensor.h:248
+
WeatherSensor::AirPM::pm_2_5
uint16_t pm_2_5
air quality PM2.5 in µg/m³
Definition: WeatherSensor.h:249
+
WeatherSensor::AirPM::pm_10
uint16_t pm_10
air quality PM10 in µg/m³
Definition: WeatherSensor.h:250
+
WeatherSensor::Leakage
Definition: WeatherSensor.h:244
+
WeatherSensor::Leakage::alarm
bool alarm
water leakage alarm (only water leakage)
Definition: WeatherSensor.h:245
+
WeatherSensor::Lightning
Definition: WeatherSensor.h:236
+
WeatherSensor::Lightning::unknown1
uint16_t unknown1
unknown part 1
Definition: WeatherSensor.h:239
+
WeatherSensor::Lightning::strike_count
uint8_t strike_count
lightning strike counter (only lightning)
Definition: WeatherSensor.h:238
+
WeatherSensor::Lightning::distance_km
uint8_t distance_km
lightning distance in km (only lightning)
Definition: WeatherSensor.h:237
+
WeatherSensor::Lightning::unknown2
uint16_t unknown2
unknown part 2
Definition: WeatherSensor.h:240
+
WeatherSensor::Sensor
sensor data and status flags
Definition: WeatherSensor.h:258
+
WeatherSensor::Sensor::battery_ok
bool battery_ok
battery o.k.
Definition: WeatherSensor.h:264
+
WeatherSensor::Sensor::rssi
float rssi
received signal strength indicator in dBm
Definition: WeatherSensor.h:260
+
WeatherSensor::Sensor::complete
bool complete
data is split into two separate messages is complete (only 6-in-1 WS)
Definition: WeatherSensor.h:266
+
WeatherSensor::Sensor::s_type
uint8_t s_type
sensor type
Definition: WeatherSensor.h:261
+
WeatherSensor::Sensor::startup
bool startup
startup after reset / battery change
Definition: WeatherSensor.h:263
+
WeatherSensor::Sensor::sensor_id
uint32_t sensor_id
sensor ID (5-in-1: 1 byte / 6-in-1: 4 bytes / 7-in-1: 2 bytes)
Definition: WeatherSensor.h:259
+
WeatherSensor::Sensor::chan
uint8_t chan
channel
Definition: WeatherSensor.h:262
+
WeatherSensor::Sensor::valid
bool valid
data valid (but not necessarily complete)
Definition: WeatherSensor.h:265
+
WeatherSensor::Soil
Definition: WeatherSensor.h:231
+
WeatherSensor::Soil::temp_c
float temp_c
temperature in degC
Definition: WeatherSensor.h:232
+
WeatherSensor::Soil::moisture
uint8_t moisture
moisture in % (only 6-in-1)
Definition: WeatherSensor.h:233
+
WeatherSensor::Weather
Definition: WeatherSensor.h:203
+
WeatherSensor::Weather::light_klx
float light_klx
Light KLux (only 7-in-1)
Definition: WeatherSensor.h:211
+
WeatherSensor::Weather::light_ok
bool light_ok
light o.k. (only 7-in-1)
Definition: WeatherSensor.h:206
+
WeatherSensor::Weather::light_lux
float light_lux
Light lux (only 7-in-1)
Definition: WeatherSensor.h:212
+
WeatherSensor::Weather::temp_ok
bool temp_ok
temperature o.k. (only 6-in-1)
Definition: WeatherSensor.h:204
+
WeatherSensor::Weather::temp_c
float temp_c
temperature in degC
Definition: WeatherSensor.h:210
+
WeatherSensor::Weather::humidity
uint8_t humidity
humidity in %
Definition: WeatherSensor.h:228
+
WeatherSensor::Weather::uv
float uv
uv radiation (only 6-in-1)
Definition: WeatherSensor.h:213
+
WeatherSensor::Weather::humidity_ok
bool humidity_ok
humidity o.k.
Definition: WeatherSensor.h:205
+
WeatherSensor::Weather::wind_ok
bool wind_ok
wind speed/direction o.k. (only 6-in-1)
Definition: WeatherSensor.h:208
+
WeatherSensor::Weather::uv_ok
bool uv_ok
uv radiation o.k. (only 6-in-1)
Definition: WeatherSensor.h:207
+
WeatherSensor::Weather::rain_mm
float rain_mm
rain gauge level in mm
Definition: WeatherSensor.h:214
+
WeatherSensor::Weather::rain_ok
bool rain_ok
rain gauge level o.k.
Definition: WeatherSensor.h:209
diff --git a/_weather_sensor_cfg_8h_source.html b/_weather_sensor_cfg_8h_source.html index f42946a9..a45405e4 100644 --- a/_weather_sensor_cfg_8h_source.html +++ b/_weather_sensor_cfg_8h_source.html @@ -137,477 +137,474 @@
50 // 20231004 Added function names and line numbers to ESP8266/RP2040 debug logging
51 // 20231101 Added USE_SX1262 for Heltec Wireless Stick V3
52 // 20231121 Added Heltec WiFi LoRa32 V3
-
53 //
-
54 // ToDo:
-
55 // -
-
56 //
-
58 
-
59 #if !defined(WEATHER_SENSOR_CFG_H)
-
60 #define WEATHER_SENSOR_CFG_H
-
61 
-
62 #include <Arduino.h>
+
53 // 20231130 Bresser 3-in-1 Professional Wind Gauge / Anemometer, PN 7002531: Replaced workaround
+
54 // for negative temperatures by fix (6-in-1 decoder)
+
55 //
+
56 // ToDo:
+
57 // -
+
58 //
+
60 
+
61 #if !defined(WEATHER_SENSOR_CFG_H)
+
62 #define WEATHER_SENSOR_CFG_H
63 
-
64 // ------------------------------------------------------------------------------------------------
-
65 // --- Weather Sensors ---
+
64 #include <Arduino.h>
+
65 
66 // ------------------------------------------------------------------------------------------------
-
67 #define NUM_SENSORS 1 // Number of sensors to be received
-
68 
-
69 // List of sensor IDs to be excluded - can be empty
-
70 #define SENSOR_IDS_EXC { 0x792882A2 }
-
71 //#define SENSOR_IDS_EXC { 0x792882A2 }
-
72 
-
73 // List of sensor IDs to be included - if empty, handle all available sensors
-
74 #define SENSOR_IDS_INC {}
-
75 //#define SENSOR_IDS_INC { 0x83750871 }
-
76 
-
77 // List of sensor IDs of the model "BRESSER 3-in-1 Professional Wind Gauge / Anemometer"
-
78 // P/N 7002531 - requiring special heandling in decodeBresser5In1Payload()
-
79 //#define SENSOR_IDS_DECODE3IN1 {}
-
80 #define SENSOR_IDS_DECODE3IN1 { 0x2C100512 }
-
81 
-
82 // Disable data type which will not be used to save RAM
-
83 #define WIND_DATA_FLOATINGPOINT
-
84 #define WIND_DATA_FIXEDPOINT
-
85 
-
86 // Select appropriate sensor message format(s)
-
87 // Comment out unused decoders to save operation time/power
-
88 #define BRESSER_5_IN_1
-
89 #define BRESSER_6_IN_1
-
90 #define BRESSER_7_IN_1
-
91 #define BRESSER_LIGHTNING
-
92 #define BRESSER_LEAKAGE
-
93 
-
94 
-
95 // ------------------------------------------------------------------------------------------------
-
96 // --- Board ---
-
97 // ------------------------------------------------------------------------------------------------
-
98 // Use pinning for LoRaWAN Node
-
99 
-
100 
-
101 // LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
-
102 // See pin definitions in
-
103 // https://github.com/espressif/arduino-esp32/tree/master/variants/ttgo-lora32-*
-
104 // and
-
105 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973
-
106 
-
107 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V1 (No TFCard)"
-
108 // in the Arduino IDE:
-
109 //#define ARDUINO_TTGO_LoRa32_V1
-
110 
-
111 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2"
-
112 // in the Arduino IDE:
-
113 //#define ARDUINO_TTGO_LoRa32_V2
-
114 
-
115 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2.1 (1.6.1)"
-
116 // in the Arduino IDE:
-
117 //#define ARDUINO_TTGO_LoRa32_V21new
-
118 
-
119 // Heltec Wireless Stick
-
120 // V2 -> SX1276
-
121 // V3 -> SX1262
-
122 // THERE IS NO WAY TO DISTINGUISH THE VERSION AUTOMATICALLY!
-
123 //
-
124 // This define is set by selecting "Board: Heltec Wireless Stick"
-
125 // in the Arduino IDE:
-
126 //#define ARDUINO_heltec_wireless_stick
-
127 
-
128 // This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)"
-
129 // in the Adruino IDE:
-
130 //#define ARDUINO_heltec_wifi_lora_32_V2
-
131 
-
132 // Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
-
133 // https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
-
134 //
-
135 // This define is set by selecting "Adafruit Feather ESP32-S2" in the Arduino IDE:
-
136 //#define ARDUINO_ADAFRUIT_FEATHER_ESP32S2
-
137 
-
138 // Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
-
139 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
-
140 //
-
141 // This define is set by selecting "Adafruit ESP32 Feather" in the Arduino IDE:
-
142 //#define ARDUINO_FEATHER_ESP32
-
143 
-
144 // Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
-
145 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
-
146 //
-
147 // This define is set by selecting "Adafruit Feather RP2040" in the Arduino IDE:
-
148 //#define ARDUINO_ADAFRUIT_FEATHER_RP2040
-
149 
-
150 // DFRobot Firebeetle32
-
151 // https://github.com/espressif/arduino-esp32/tree/master/variants/firebeetle32/pins_arduino.h
-
152 //
-
153 // This define (not very specific...) is set by selecting "FireBeetle-ESP32" in the Arduino IDE:
-
154 //#define ARDUINO_ESP32_DEV
-
155 
-
156 #if defined(ARDUINO_TTGO_LoRa32_V1)
-
157  #pragma message("ARDUINO_TTGO_LoRa32_V1 defined; using on-board transceiver")
-
158  #define USE_SX1276
-
159 
-
160 #elif defined(ARDUINO_TTGO_LoRa32_V2)
-
161  #pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
-
162  #pragma message("LoRa DIO1 must be wired to GPIO33 manually!")
-
163  #define USE_SX1276
-
164 
-
165 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
-
166  #pragma message("ARDUINO_TTGO_LoRa32_V21new defined; using on-board transceiver")
-
167  #define USE_SX1276
-
168 
-
169 #elif defined(ARDUINO_heltec_wireless_stick)
-
170  #pragma message("ARDUINO_heltec_wireless_stick defined; using on-board transceiver")
-
171  #pragma message("Radio transceiver chip has to be configured manually: V2 -> USE_SX1276 / V3 -> USE_SX1262")
-
172  //#define USE_SX1276 // Heltec Wireless Stick V2
-
173  #define USE_SX1262 // Heltec Wireless Stick V3
-
174 
-
175 #elif defined(ARDUINO_heltec_wifi_lora_32_V2)
-
176  #pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
-
177  #define USE_SX1276
-
178 
-
179 #elif defined(ARDUINO_heltec_wifi_32_lora_V3)
-
180  #pragma message("ARDUINO_heltec_wifi_32_lora_V3 defined; using on-board transceiver")
-
181  #define USE_SX1262
-
182 
-
183 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
-
184  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
-
185  #define USE_SX1276
-
186 
-
187 #elif defined(ARDUINO_FEATHER_ESP32)
-
188  #pragma message("ARDUINO_FEATHER_ESP32 defined; assuming RFM95W FeatherWing will be used")
-
189  #define USE_SX1276
-
190  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
191 
-
192 #elif defined(ARDUINO_AVR_FEATHER32U4)
-
193  #pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Adafruit Feather 32u4 RFM95 LoRa Radio")
-
194  #define USE_SX1276
-
195 
-
196 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
-
197  #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming assuming RFM95W FeatherWing will be used")
-
198  #define USE_SX1276
-
199  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
200 
-
201 #elif defined(ARDUINO_ESP32_DEV)
-
202  //#define LORAWAN_NODE
-
203  #define FIREBEETLE_ESP32_COVER_LORA
-
204 
-
205  #if defined(FIREBEETLE_ESP32_COVER_LORA)
-
206  #pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
-
207  #define USE_SX1276
-
208  #pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")
-
209 
-
210  #elif defined(LORAWAN_NODE)
-
211  #pragma message("LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
-
212  #define USE_SX1276
-
213 
-
214  #else
-
215  #pragma message("ARDUINO_ESP32_DEV defined; select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")
-
216 
-
217  #endif
-
218 #endif
-
219 
-
220 
-
221 // ------------------------------------------------------------------------------------------------
-
222 // --- Radio Transceiver ---
-
223 // ------------------------------------------------------------------------------------------------
-
224 // Select type of receiver module (if not yet defined based on the assumptions above)
-
225 #if ( !defined(USE_CC1101) && !defined(USE_SX1276) && !defined(USE_SX1262) )
-
226  //#define USE_CC1101
-
227  #define USE_SX1276
-
228  //#define USE_SX1262
-
229 #endif
-
230 
-
231 
-
232 // ------------------------------------------------------------------------------------------------
-
233 // --- Debug Logging Output ---
-
234 // ------------------------------------------------------------------------------------------------
-
235 // - ESP32:
-
236 // CORE_DEBUG_LEVEL is set in Adruino IDE:
-
237 // Tools->Core Debug Level: "<None>|<Error>|<Warning>|<Info>|<Debug>|<Verbose>"
-
238 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
-
239 //
-
240 // - ESP8266:
-
241 // DEBUG_ESP_PORT is set in Arduino IDE:
-
242 // Tools->Debug port: "<None>|<Serial>|<Serial1>"
-
243 //
-
244 // - RP2040:
-
245 // DEBUG_RP2040_PORT is set in Arduino IDE:
-
246 // Tools->Debug port: "<Disabled>|<Serial>|<Serial1>|<Serial2>"
-
247 //
-
248 // Replacement for
-
249 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
-
250 // on ESP8266 and RP2040:
-
251 #if defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)
-
252  #define ARDUHAL_LOG_LEVEL_NONE 0
-
253  #define ARDUHAL_LOG_LEVEL_ERROR 1
-
254  #define ARDUHAL_LOG_LEVEL_WARN 2
-
255  #define ARDUHAL_LOG_LEVEL_INFO 3
-
256  #define ARDUHAL_LOG_LEVEL_DEBUG 4
-
257  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
-
258 
-
259  #if defined(ARDUINO_ARCH_RP2040) && defined(DEBUG_RP2040_PORT)
-
260  #define DEBUG_PORT DEBUG_RP2040_PORT
-
261  #elif defined(DEBUG_ESP_PORT)
-
262  #define DEBUG_PORT DEBUG_ESP_PORT
-
263  #endif
-
264 
-
265  // Set desired level here!
-
266  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
-
267 
-
268  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
-
269  #define log_e(...) { DEBUG_PORT.printf("%s(), l.%d: ",__func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
270  #else
-
271  #define log_e(...) {}
-
272  #endif
-
273  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
-
274  #define log_w(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
275  #else
-
276  #define log_w(...) {}
-
277  #endif
-
278  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
-
279  #define log_i(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
280  #else
-
281  #define log_i(...) {}
-
282  #endif
-
283  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
-
284  #define log_d(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
285  #else
-
286  #define log_d(...) {}
-
287  #endif
-
288  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
-
289  #define log_v(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
290  #else
-
291  #define log_v(...) {}
-
292  #endif
+
67 // --- Weather Sensors ---
+
68 // ------------------------------------------------------------------------------------------------
+
69 #define NUM_SENSORS 1 // Number of sensors to be received
+
70 
+
71 // List of sensor IDs to be excluded - can be empty
+
72 #define SENSOR_IDS_EXC { 0x792882A2 }
+
73 //#define SENSOR_IDS_EXC { 0x792882A2 }
+
74 
+
75 // List of sensor IDs to be included - if empty, handle all available sensors
+
76 #define SENSOR_IDS_INC {}
+
77 //#define SENSOR_IDS_INC { 0x83750871 }
+
78 
+
79 // Disable data type which will not be used to save RAM
+
80 #define WIND_DATA_FLOATINGPOINT
+
81 #define WIND_DATA_FIXEDPOINT
+
82 
+
83 // Select appropriate sensor message format(s)
+
84 // Comment out unused decoders to save operation time/power
+
85 #define BRESSER_5_IN_1
+
86 #define BRESSER_6_IN_1
+
87 #define BRESSER_7_IN_1
+
88 #define BRESSER_LIGHTNING
+
89 #define BRESSER_LEAKAGE
+
90 
+
91 
+
92 // ------------------------------------------------------------------------------------------------
+
93 // --- Board ---
+
94 // ------------------------------------------------------------------------------------------------
+
95 // Use pinning for LoRaWAN Node
+
96 
+
97 
+
98 // LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
+
99 // See pin definitions in
+
100 // https://github.com/espressif/arduino-esp32/tree/master/variants/ttgo-lora32-*
+
101 // and
+
102 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973
+
103 
+
104 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V1 (No TFCard)"
+
105 // in the Arduino IDE:
+
106 //#define ARDUINO_TTGO_LoRa32_V1
+
107 
+
108 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2"
+
109 // in the Arduino IDE:
+
110 //#define ARDUINO_TTGO_LoRa32_V2
+
111 
+
112 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2.1 (1.6.1)"
+
113 // in the Arduino IDE:
+
114 //#define ARDUINO_TTGO_LoRa32_V21new
+
115 
+
116 // Heltec Wireless Stick
+
117 // V2 -> SX1276
+
118 // V3 -> SX1262
+
119 // THERE IS NO WAY TO DISTINGUISH THE VERSION AUTOMATICALLY!
+
120 //
+
121 // This define is set by selecting "Board: Heltec Wireless Stick"
+
122 // in the Arduino IDE:
+
123 //#define ARDUINO_heltec_wireless_stick
+
124 
+
125 // This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)"
+
126 // in the Adruino IDE:
+
127 //#define ARDUINO_heltec_wifi_lora_32_V2
+
128 
+
129 // Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
+
130 // https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
+
131 //
+
132 // This define is set by selecting "Adafruit Feather ESP32-S2" in the Arduino IDE:
+
133 //#define ARDUINO_ADAFRUIT_FEATHER_ESP32S2
+
134 
+
135 // Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
+
136 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
+
137 //
+
138 // This define is set by selecting "Adafruit ESP32 Feather" in the Arduino IDE:
+
139 //#define ARDUINO_FEATHER_ESP32
+
140 
+
141 // Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
+
142 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
+
143 //
+
144 // This define is set by selecting "Adafruit Feather RP2040" in the Arduino IDE:
+
145 //#define ARDUINO_ADAFRUIT_FEATHER_RP2040
+
146 
+
147 // DFRobot Firebeetle32
+
148 // https://github.com/espressif/arduino-esp32/tree/master/variants/firebeetle32/pins_arduino.h
+
149 //
+
150 // This define (not very specific...) is set by selecting "FireBeetle-ESP32" in the Arduino IDE:
+
151 //#define ARDUINO_ESP32_DEV
+
152 
+
153 #if defined(ARDUINO_TTGO_LoRa32_V1)
+
154  #pragma message("ARDUINO_TTGO_LoRa32_V1 defined; using on-board transceiver")
+
155  #define USE_SX1276
+
156 
+
157 #elif defined(ARDUINO_TTGO_LoRa32_V2)
+
158  #pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
+
159  #pragma message("LoRa DIO1 must be wired to GPIO33 manually!")
+
160  #define USE_SX1276
+
161 
+
162 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
+
163  #pragma message("ARDUINO_TTGO_LoRa32_V21new defined; using on-board transceiver")
+
164  #define USE_SX1276
+
165 
+
166 #elif defined(ARDUINO_heltec_wireless_stick)
+
167  #pragma message("ARDUINO_heltec_wireless_stick defined; using on-board transceiver")
+
168  #pragma message("Radio transceiver chip has to be configured manually: V2 -> USE_SX1276 / V3 -> USE_SX1262")
+
169  //#define USE_SX1276 // Heltec Wireless Stick V2
+
170  #define USE_SX1262 // Heltec Wireless Stick V3
+
171 
+
172 #elif defined(ARDUINO_heltec_wifi_lora_32_V2)
+
173  #pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
+
174  #define USE_SX1276
+
175 
+
176 #elif defined(ARDUINO_heltec_wifi_32_lora_V3)
+
177  #pragma message("ARDUINO_heltec_wifi_32_lora_V3 defined; using on-board transceiver")
+
178  #define USE_SX1262
+
179 
+
180 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+
181  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
+
182  #define USE_SX1276
+
183 
+
184 #elif defined(ARDUINO_FEATHER_ESP32)
+
185  #pragma message("ARDUINO_FEATHER_ESP32 defined; assuming RFM95W FeatherWing will be used")
+
186  #define USE_SX1276
+
187  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
188 
+
189 #elif defined(ARDUINO_AVR_FEATHER32U4)
+
190  #pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Adafruit Feather 32u4 RFM95 LoRa Radio")
+
191  #define USE_SX1276
+
192 
+
193 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
+
194  #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming assuming RFM95W FeatherWing will be used")
+
195  #define USE_SX1276
+
196  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
197 
+
198 #elif defined(ARDUINO_ESP32_DEV)
+
199  //#define LORAWAN_NODE
+
200  #define FIREBEETLE_ESP32_COVER_LORA
+
201 
+
202  #if defined(FIREBEETLE_ESP32_COVER_LORA)
+
203  #pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
+
204  #define USE_SX1276
+
205  #pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")
+
206 
+
207  #elif defined(LORAWAN_NODE)
+
208  #pragma message("LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
+
209  #define USE_SX1276
+
210 
+
211  #else
+
212  #pragma message("ARDUINO_ESP32_DEV defined; select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")
+
213 
+
214  #endif
+
215 #endif
+
216 
+
217 
+
218 // ------------------------------------------------------------------------------------------------
+
219 // --- Radio Transceiver ---
+
220 // ------------------------------------------------------------------------------------------------
+
221 // Select type of receiver module (if not yet defined based on the assumptions above)
+
222 #if ( !defined(USE_CC1101) && !defined(USE_SX1276) && !defined(USE_SX1262) )
+
223  //#define USE_CC1101
+
224  #define USE_SX1276
+
225  //#define USE_SX1262
+
226 #endif
+
227 
+
228 
+
229 // ------------------------------------------------------------------------------------------------
+
230 // --- Debug Logging Output ---
+
231 // ------------------------------------------------------------------------------------------------
+
232 // - ESP32:
+
233 // CORE_DEBUG_LEVEL is set in Adruino IDE:
+
234 // Tools->Core Debug Level: "<None>|<Error>|<Warning>|<Info>|<Debug>|<Verbose>"
+
235 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
+
236 //
+
237 // - ESP8266:
+
238 // DEBUG_ESP_PORT is set in Arduino IDE:
+
239 // Tools->Debug port: "<None>|<Serial>|<Serial1>"
+
240 //
+
241 // - RP2040:
+
242 // DEBUG_RP2040_PORT is set in Arduino IDE:
+
243 // Tools->Debug port: "<Disabled>|<Serial>|<Serial1>|<Serial2>"
+
244 //
+
245 // Replacement for
+
246 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
+
247 // on ESP8266 and RP2040:
+
248 #if defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)
+
249  #define ARDUHAL_LOG_LEVEL_NONE 0
+
250  #define ARDUHAL_LOG_LEVEL_ERROR 1
+
251  #define ARDUHAL_LOG_LEVEL_WARN 2
+
252  #define ARDUHAL_LOG_LEVEL_INFO 3
+
253  #define ARDUHAL_LOG_LEVEL_DEBUG 4
+
254  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
+
255 
+
256  #if defined(ARDUINO_ARCH_RP2040) && defined(DEBUG_RP2040_PORT)
+
257  #define DEBUG_PORT DEBUG_RP2040_PORT
+
258  #elif defined(DEBUG_ESP_PORT)
+
259  #define DEBUG_PORT DEBUG_ESP_PORT
+
260  #endif
+
261 
+
262  // Set desired level here!
+
263  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
+
264 
+
265  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
+
266  #define log_e(...) { DEBUG_PORT.printf("%s(), l.%d: ",__func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
267  #else
+
268  #define log_e(...) {}
+
269  #endif
+
270  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
+
271  #define log_w(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
272  #else
+
273  #define log_w(...) {}
+
274  #endif
+
275  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
+
276  #define log_i(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
277  #else
+
278  #define log_i(...) {}
+
279  #endif
+
280  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
+
281  #define log_d(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
282  #else
+
283  #define log_d(...) {}
+
284  #endif
+
285  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
+
286  #define log_v(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
287  #else
+
288  #define log_v(...) {}
+
289  #endif
+
290 
+
291 #endif
+
292 
293 
-
294 #endif
-
295 
-
296 
-
297 // Replacement for
-
298 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
-
299 // on Arduino AVR:
-
300 #if defined(ARDUINO_ARCH_AVR)
-
301  #define ARDUHAL_LOG_LEVEL_NONE 0
-
302  #define ARDUHAL_LOG_LEVEL_ERROR 1
-
303  #define ARDUHAL_LOG_LEVEL_WARN 2
-
304  #define ARDUHAL_LOG_LEVEL_INFO 3
-
305  #define ARDUHAL_LOG_LEVEL_DEBUG 4
-
306  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
+
294 // Replacement for
+
295 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
+
296 // on Arduino AVR:
+
297 #if defined(ARDUINO_ARCH_AVR)
+
298  #define ARDUHAL_LOG_LEVEL_NONE 0
+
299  #define ARDUHAL_LOG_LEVEL_ERROR 1
+
300  #define ARDUHAL_LOG_LEVEL_WARN 2
+
301  #define ARDUHAL_LOG_LEVEL_INFO 3
+
302  #define ARDUHAL_LOG_LEVEL_DEBUG 4
+
303  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
+
304 
+
305  // Set desired level here!
+
306  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
307 
-
308  // Set desired level here!
-
309  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
-
310 
-
311  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
-
312  #define log_e(...) { printf(__VA_ARGS__); println(); }
-
313  #else
-
314  #define log_e(...) {}
-
315  #endif
-
316  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
-
317  #define log_w(...) { printf(__VA_ARGS__); println(); }
-
318  #else
-
319  #define log_w(...) {}
-
320  #endif
-
321  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
-
322  #define log_i(...) { printf(__VA_ARGS__); println(); }
-
323  #else
-
324  #define log_i(...) {}
-
325  #endif
-
326  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
-
327  #define log_d(...) { printf(__VA_ARGS__); println(); }
-
328  #else
-
329  #define log_d(...) {}
-
330  #endif
-
331  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
-
332  #define log_v(...) { printf(__VA_ARGS__); println(); }
-
333  #else
-
334  #define log_v(...) {}
-
335  #endif
-
336 #endif
-
337 
-
338 #if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
-
339  (defined(USE_SX1276) && defined(USE_SX1262)) || \
-
340  (defined(USE_SX1262) && defined(USE_CC1101)) )
-
341  #error "Either USE_CC1101 OR USE_SX1276 OR USE_SX1262 must be defined!"
-
342 #endif
-
343 
-
344 #if defined(USE_CC1101)
-
345  #define RECEIVER_CHIP "[CC1101]"
-
346 #elif defined(USE_SX1276)
-
347  #define RECEIVER_CHIP "[SX1276]"
-
348 #elif defined(USE_SX1262)
-
349  #define RECEIVER_CHIP "[SX1262]"
-
350 #else
-
351  #error "Either USE_CC1101, USE_SX1276 or USE_SX1262 must be defined!"
-
352 #endif
-
353 
-
354 
-
355 // Arduino default SPI pins
-
356 //
-
357 // Board SCK MOSI MISO
-
358 // ESP8266 D5 D7 D6
-
359 // ESP32 D18 D23 D19
-
360 #if defined(LORAWAN_NODE)
-
361  // Use pinning for LoRaWAN_Node (https://github.com/matthias-bs/LoRaWAN_Node)
-
362  #define PIN_RECEIVER_CS 14
+
308  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
+
309  #define log_e(...) { printf(__VA_ARGS__); println(); }
+
310  #else
+
311  #define log_e(...) {}
+
312  #endif
+
313  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
+
314  #define log_w(...) { printf(__VA_ARGS__); println(); }
+
315  #else
+
316  #define log_w(...) {}
+
317  #endif
+
318  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
+
319  #define log_i(...) { printf(__VA_ARGS__); println(); }
+
320  #else
+
321  #define log_i(...) {}
+
322  #endif
+
323  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
+
324  #define log_d(...) { printf(__VA_ARGS__); println(); }
+
325  #else
+
326  #define log_d(...) {}
+
327  #endif
+
328  #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
+
329  #define log_v(...) { printf(__VA_ARGS__); println(); }
+
330  #else
+
331  #define log_v(...) {}
+
332  #endif
+
333 #endif
+
334 
+
335 #if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
+
336  (defined(USE_SX1276) && defined(USE_SX1262)) || \
+
337  (defined(USE_SX1262) && defined(USE_CC1101)) )
+
338  #error "Either USE_CC1101 OR USE_SX1276 OR USE_SX1262 must be defined!"
+
339 #endif
+
340 
+
341 #if defined(USE_CC1101)
+
342  #define RECEIVER_CHIP "[CC1101]"
+
343 #elif defined(USE_SX1276)
+
344  #define RECEIVER_CHIP "[SX1276]"
+
345 #elif defined(USE_SX1262)
+
346  #define RECEIVER_CHIP "[SX1262]"
+
347 #else
+
348  #error "Either USE_CC1101, USE_SX1276 or USE_SX1262 must be defined!"
+
349 #endif
+
350 
+
351 
+
352 // Arduino default SPI pins
+
353 //
+
354 // Board SCK MOSI MISO
+
355 // ESP8266 D5 D7 D6
+
356 // ESP32 D18 D23 D19
+
357 #if defined(LORAWAN_NODE)
+
358  // Use pinning for LoRaWAN_Node (https://github.com/matthias-bs/LoRaWAN_Node)
+
359  #define PIN_RECEIVER_CS 14
+
360 
+
361  // CC1101: GDO0 / RFM95W/SX127x: G0
+
362  #define PIN_RECEIVER_IRQ 4
363 
-
364  // CC1101: GDO0 / RFM95W/SX127x: G0
-
365  #define PIN_RECEIVER_IRQ 4
+
364  // CC1101: GDO2 / RFM95W/SX127x: G1
+
365  #define PIN_RECEIVER_GPIO 16
366 
-
367  // CC1101: GDO2 / RFM95W/SX127x: G1
-
368  #define PIN_RECEIVER_GPIO 16
+
367  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
368  #define PIN_RECEIVER_RST 12
369 
-
370  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
371  #define PIN_RECEIVER_RST 12
+
370 #elif defined(FIREBEETLE_ESP32_COVER_LORA)
+
371  #define PIN_RECEIVER_CS 27 // D4
372 
-
373 #elif defined(FIREBEETLE_ESP32_COVER_LORA)
-
374  #define PIN_RECEIVER_CS 27 // D4
+
373  // CC1101: GDO0 / RFM95W/SX127x: G0
+
374  #define PIN_RECEIVER_IRQ 26 // D3
375 
-
376  // CC1101: GDO0 / RFM95W/SX127x: G0
-
377  #define PIN_RECEIVER_IRQ 26 // D3
+
376  // CC1101: GDO2 / RFM95W/SX127x: G1
+
377  #define PIN_RECEIVER_GPIO 9 // D5
378 
-
379  // CC1101: GDO2 / RFM95W/SX127x: G1
-
380  #define PIN_RECEIVER_GPIO 9 // D5
+
379  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
380  #define PIN_RECEIVER_RST 25 // D2
381 
-
382  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
383  #define PIN_RECEIVER_RST 25 // D2
-
384 
-
385 #elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
-
386  // Use pinning for LILIGO TTGO LoRa32-OLED
-
387  #define PIN_RECEIVER_CS LORA_CS
+
382 #elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
+
383  // Use pinning for LILIGO TTGO LoRa32-OLED
+
384  #define PIN_RECEIVER_CS LORA_CS
+
385 
+
386  // CC1101: GDO0 / RFM95W/SX127x: G0
+
387  #define PIN_RECEIVER_IRQ LORA_IRQ
388 
-
389  // CC1101: GDO0 / RFM95W/SX127x: G0
-
390  #define PIN_RECEIVER_IRQ LORA_IRQ
-
391 
-
392  // CC1101: GDO2 / RFM95W/SX127x: G1
-
393  // n.c. on v1/v2?, LORA_D1 on v21
-
394  #define PIN_RECEIVER_GPIO 33
+
389  // CC1101: GDO2 / RFM95W/SX127x: G1
+
390  // n.c. on v1/v2?, LORA_D1 on v21
+
391  #define PIN_RECEIVER_GPIO 33
+
392 
+
393  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
394  #define PIN_RECEIVER_RST LORA_RST
395 
-
396  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
397  #define PIN_RECEIVER_RST LORA_RST
-
398 
-
399 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
-
400  // Use pinning for LILIGO TTGO LoRa32-OLED V2.1 (1.6.1)
-
401  // Same pinout for Heltec Wireless Stick
-
402  #define PIN_RECEIVER_CS LORA_CS
+
396 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
+
397  // Use pinning for LILIGO TTGO LoRa32-OLED V2.1 (1.6.1)
+
398  // Same pinout for Heltec Wireless Stick
+
399  #define PIN_RECEIVER_CS LORA_CS
+
400 
+
401  // CC1101: GDO0 / RFM95W/SX127x: G0
+
402  #define PIN_RECEIVER_IRQ LORA_IRQ
403 
-
404  // CC1101: GDO0 / RFM95W/SX127x: G0
-
405  #define PIN_RECEIVER_IRQ LORA_IRQ
+
404  // CC1101: GDO2 / RFM95W/SX127x: G1
+
405  #define PIN_RECEIVER_GPIO LORA_D1
406 
-
407  // CC1101: GDO2 / RFM95W/SX127x: G1
-
408  #define PIN_RECEIVER_GPIO LORA_D1
+
407  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
408  #define PIN_RECEIVER_RST LORA_RST
409 
-
410  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
411  #define PIN_RECEIVER_RST LORA_RST
-
412 
-
413 #elif defined(ARDUINO_heltec_wireless_stick) || defined(ARDUINO_heltec_wifi_lora_32_V2)
-
414  // Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
-
415  #define PIN_RECEIVER_CS SS
+
410 #elif defined(ARDUINO_heltec_wireless_stick) || defined(ARDUINO_heltec_wifi_lora_32_V2)
+
411  // Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
+
412  #define PIN_RECEIVER_CS SS
+
413 
+
414  // CC1101: GDO0 / RFM95W/SX127x: G0
+
415  #define PIN_RECEIVER_IRQ DIO0
416 
-
417  // CC1101: GDO0 / RFM95W/SX127x: G0
-
418  #define PIN_RECEIVER_IRQ DIO0
+
417  // CC1101: GDO2 / RFM95W/SX127x: G1
+
418  #define PIN_RECEIVER_GPIO DIO1
419 
-
420  // CC1101: GDO2 / RFM95W/SX127x: G1
-
421  #define PIN_RECEIVER_GPIO DIO1
+
420  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
421  #define PIN_RECEIVER_RST RST_LoRa
422 
-
423  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
424  #define PIN_RECEIVER_RST RST_LoRa
-
425 
-
426 #elif defined(ARDUINO_heltec_wifi_32_lora_V3)
-
427  // Use pinning for Heltec WiFi LoRa32 V3
-
428  #define PIN_RECEIVER_CS SS
+
423 #elif defined(ARDUINO_heltec_wifi_32_lora_V3)
+
424  // Use pinning for Heltec WiFi LoRa32 V3
+
425  #define PIN_RECEIVER_CS SS
+
426 
+
427  // CC1101: GDO0 / RFM95W/SX127x: G0 / SX1262: DIO0
+
428  #define PIN_RECEIVER_IRQ DIO0
429 
-
430  // CC1101: GDO0 / RFM95W/SX127x: G0 / SX1262: DIO0
-
431  #define PIN_RECEIVER_IRQ DIO0
+
430  // CC1101: GDO2 / RFM95W/SX127x: G1 / SX1262: BUSY
+
431  #define PIN_RECEIVER_GPIO BUSY_LoRa
432 
-
433  // CC1101: GDO2 / RFM95W/SX127x: G1 / SX1262: BUSY
-
434  #define PIN_RECEIVER_GPIO BUSY_LoRa
+
433  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
434  #define PIN_RECEIVER_RST RST_LoRa
435 
-
436  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
437  #define PIN_RECEIVER_RST RST_LoRa
-
438 
-
439 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
-
440  // Use pinning for Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
-
441  #define PIN_RECEIVER_CS 6
+
436 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+
437  // Use pinning for Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
+
438  #define PIN_RECEIVER_CS 6
+
439 
+
440  // CC1101: GDO0 / RFM95W/SX127x: G0
+
441  #define PIN_RECEIVER_IRQ 5
442 
-
443  // CC1101: GDO0 / RFM95W/SX127x: G0
-
444  #define PIN_RECEIVER_IRQ 5
+
443  // CC1101: GDO2 / RFM95W/SX127x: G1
+
444  #define PIN_RECEIVER_GPIO 11
445 
-
446  // CC1101: GDO2 / RFM95W/SX127x: G1
-
447  #define PIN_RECEIVER_GPIO 11
+
446  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
447  #define PIN_RECEIVER_RST 9
448 
-
449  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
450  #define PIN_RECEIVER_RST 9
-
451 
-
452 #elif defined(ARDUINO_FEATHER_ESP32)
-
453  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
-
454  #define PIN_RECEIVER_CS 14
+
449 #elif defined(ARDUINO_FEATHER_ESP32)
+
450  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
+
451  #define PIN_RECEIVER_CS 14
+
452 
+
453  // CC1101: GDO0 / RFM95W/SX127x: G0
+
454  #define PIN_RECEIVER_IRQ 32
455 
-
456  // CC1101: GDO0 / RFM95W/SX127x: G0
-
457  #define PIN_RECEIVER_IRQ 32
+
456  // CC1101: GDO2 / RFM95W/SX127x: G1
+
457  #define PIN_RECEIVER_GPIO 33
458 
-
459  // CC1101: GDO2 / RFM95W/SX127x: G1
-
460  #define PIN_RECEIVER_GPIO 33
+
459  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
460  #define PIN_RECEIVER_RST 27
461 
-
462  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
463  #define PIN_RECEIVER_RST 27
-
464 
-
465 #elif defined(ESP32)
-
466  // Generic pinning for ESP32 development boards
-
467  #define PIN_RECEIVER_CS 27
+
462 #elif defined(ESP32)
+
463  // Generic pinning for ESP32 development boards
+
464  #define PIN_RECEIVER_CS 27
+
465 
+
466  // CC1101: GDO0 / RFM95W/SX127x: G0
+
467  #define PIN_RECEIVER_IRQ 21
468 
-
469  // CC1101: GDO0 / RFM95W/SX127x: G0
-
470  #define PIN_RECEIVER_IRQ 21
+
469  // CC1101: GDO2 / RFM95W/SX127x: G1
+
470  #define PIN_RECEIVER_GPIO 33
471 
-
472  // CC1101: GDO2 / RFM95W/SX127x: G1
-
473  #define PIN_RECEIVER_GPIO 33
-
474 
-
475  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
476  #define PIN_RECEIVER_RST 32
-
477 
-
478 #elif defined(ESP8266)
-
479  // Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
-
480  #define PIN_RECEIVER_CS 15
+
472  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
473  #define PIN_RECEIVER_RST 32
+
474 
+
475 #elif defined(ESP8266)
+
476  // Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
+
477  #define PIN_RECEIVER_CS 15
+
478 
+
479  // CC1101: GDO0 / RFM95W/SX127x: G0
+
480  #define PIN_RECEIVER_IRQ 4
481 
-
482  // CC1101: GDO0 / RFM95W/SX127x: G0
-
483  #define PIN_RECEIVER_IRQ 4
+
482  // CC1101: GDO2 / RFM95W/SX127x: G1
+
483  #define PIN_RECEIVER_GPIO 5
484 
-
485  // CC1101: GDO2 / RFM95W/SX127x: G1
-
486  #define PIN_RECEIVER_GPIO 5
-
487 
-
488  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
489  #define PIN_RECEIVER_RST 2
-
490 
-
491 #elif defined(ARDUINO_AVR_FEATHER32U4)
-
492  // Pinning for Adafruit Feather 32u4
-
493  #define PIN_RECEIVER_CS 8
+
485  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
486  #define PIN_RECEIVER_RST 2
+
487 
+
488 #elif defined(ARDUINO_AVR_FEATHER32U4)
+
489  // Pinning for Adafruit Feather 32u4
+
490  #define PIN_RECEIVER_CS 8
+
491 
+
492  // CC1101: GDO0 / RFM95W/SX127x: G0
+
493  #define PIN_RECEIVER_IRQ 7
494 
-
495  // CC1101: GDO0 / RFM95W/SX127x: G0
-
496  #define PIN_RECEIVER_IRQ 7
+
495  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
+
496  #define PIN_RECEIVER_GPIO 99
497 
-
498  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
-
499  #define PIN_RECEIVER_GPIO 99
+
498  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
499  #define PIN_RECEIVER_RST 4
500 
-
501  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
502  #define PIN_RECEIVER_RST 4
-
503 
-
504 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
-
505  // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
-
506  #define PIN_RECEIVER_CS 7
+
501 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
+
502  // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
+
503  #define PIN_RECEIVER_CS 7
+
504 
+
505  // CC1101: GDO0 / RFM95W/SX127x: G0
+
506  #define PIN_RECEIVER_IRQ 8
507 
-
508  // CC1101: GDO0 / RFM95W/SX127x: G0
-
509  #define PIN_RECEIVER_IRQ 8
+
508  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
+
509  #define PIN_RECEIVER_GPIO 10
510 
-
511  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
-
512  #define PIN_RECEIVER_GPIO 10
+
511  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
512  #define PIN_RECEIVER_RST 11
513 
-
514  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
515  #define PIN_RECEIVER_RST 11
-
516 
-
517 #endif
-
518 
-
519 #define STR_HELPER(x) #x
-
520 #define STR(x) STR_HELPER(x)
-
521 #pragma message("Receiver chip: " RECEIVER_CHIP)
-
522 #pragma message("Pin config: RST->" STR(PIN_RECEIVER_RST) ", CS->" STR(PIN_RECEIVER_CS) ", GD0/G0/IRQ->" STR(PIN_RECEIVER_IRQ) ", GDO2/G1/GPIO->" STR(PIN_RECEIVER_GPIO) )
-
523 
-
524 #endif
+
514 #endif
+
515 
+
516 #define STR_HELPER(x) #x
+
517 #define STR(x) STR_HELPER(x)
+
518 #pragma message("Receiver chip: " RECEIVER_CHIP)
+
519 #pragma message("Pin config: RST->" STR(PIN_RECEIVER_RST) ", CS->" STR(PIN_RECEIVER_CS) ", GD0/G0/IRQ->" STR(PIN_RECEIVER_IRQ) ", GDO2/G1/GPIO->" STR(PIN_RECEIVER_GPIO) )
+
520 
+
521 #endif
diff --git a/class_weather_sensor-members.html b/class_weather_sensor-members.html index d690d178..df4323f4 100644 --- a/class_weather_sensor-members.html +++ b/class_weather_sensor-members.html @@ -97,10 +97,9 @@ genMessage(int i, uint32_t id=0xff, uint8_t s_type=1, uint8_t channel=0, uint8_t startup=0)WeatherSensor getData(uint32_t timeout, uint8_t flags=0, uint8_t type=0, void(*func)()=NULL)WeatherSensor getMessage(void)WeatherSensor - is_decode3in1(uint32_t id)WeatherSensor - rssiWeatherSensor - sensorWeatherSensor - sensor_t typedefWeatherSensor + rssiWeatherSensor + sensorWeatherSensor + sensor_t typedefWeatherSensor diff --git a/class_weather_sensor.html b/class_weather_sensor.html index 746c1b68..9fd83a6d 100644 --- a/class_weather_sensor.html +++ b/class_weather_sensor.html @@ -145,8 +145,6 @@   int findType (uint8_t type, uint8_t channel=0xFF)   -bool is_decode3in1 (uint32_t id) -  @@ -433,32 +431,6 @@

Returns
DecodeStatus
- - -
-

◆ is_decode3in1()

- -
-
-

Public Attributes

- - - - - - - -
bool WeatherSensor::is_decode3in1 (uint32_t id)
-
-

Check if sensor ID is in sensor_ids_decode3in1[]

-
Parameters
- - -
idsensor ID
-
-
-
Returns
true if sensor is in sensor_ids_decode3in1[], false otherwise
-

The documentation for this class was generated from the following files: