From b77b320e3f6c4493f251fa818c508c6799b4d965 Mon Sep 17 00:00:00 2001 From: Matthias Prinke <83612361+matthias-bs@users.noreply.github.com> Date: Sat, 8 Jun 2024 10:34:35 +0200 Subject: [PATCH] Fix maximum number of 868 MHz sensors' default (#57) --- .github/workflows/CI.yml | 2 +- BresserWeatherSensorLWCfg.h | 4 ++++ package.json | 2 +- src/PayloadBresser.cpp | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3466a22..9e92f15 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -77,7 +77,7 @@ jobs: #declare -a required_libs=("https://github.com/matthias-bs/BresserWeatherSensorReceiver.git" declare -a required_libs=( "RadioLib@6.6.0" - "BresserWeatherSensorReceiver@0.28.5" + "BresserWeatherSensorReceiver@0.28.6" "LoRa Serialization@3.2.1" "ESP32Time@2.0.6" "OneWireNg@0.13.3" diff --git a/BresserWeatherSensorLWCfg.h b/BresserWeatherSensorLWCfg.h index 227d80a..2da0702 100644 --- a/BresserWeatherSensorLWCfg.h +++ b/BresserWeatherSensorLWCfg.h @@ -56,6 +56,7 @@ // 20240607 Added ARDUINO_DFROBOT_FIREBEETLE_ESP32 variant selection // Updated HELTEC_WIFI_LORA_32_V3 definition // Modified STATUS_INTERVAL +// 20240608 Added MAX_NUM_868MHZ_SENSORS // // Note: // Depending on board package file date, either @@ -313,6 +314,9 @@ const uint8_t UBATT_SAMPLES = 10; } #endif +/// Maximum number of 868 MHz sensors - should match the default configuration below +#define MAX_NUM_868MHZ_SENSORS 5 + /// AppLayer payload configuration size in bytes #define APP_PAYLOAD_CFG_SIZE 24 diff --git a/package.json b/package.json index 0f32151..d517832 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/matthias-bs/BresserWeatherSensorLW#README", "dependencies": { - "BresserWeatherSensorReceiver": "matthias-bs/BresserWeatherSensorReceiver#semver:^0.28.5", + "BresserWeatherSensorReceiver": "matthias-bs/BresserWeatherSensorReceiver#semver:^0.28.6", "RadioLib": "jgromes/RadioLib#semver:^6.6.0", "lora-serialization": "thesolarnomad/lora-serialization#semver:^3.2.1", "ESP32Time": "fbiego/ESP32Time#semver:^2.0.6", diff --git a/src/PayloadBresser.cpp b/src/PayloadBresser.cpp index a6b7b8c..8a0fec7 100644 --- a/src/PayloadBresser.cpp +++ b/src/PayloadBresser.cpp @@ -42,6 +42,7 @@ // 20240530 Weather sensor: Fixed encoding of invalid temperature // 20240601 Added mapping of invalid RainGauge values to INV_FLOAT // 20240603 Added encoding of sensor battery status +// 20240608 Modified default number of sensors // // ToDo: // - Add handling of Professional Rain Gauge @@ -52,7 +53,7 @@ void PayloadBresser::begin(void) { - weatherSensor.begin(); + weatherSensor.begin(MAX_NUM_868MHZ_SENSORS); weatherSensor.clearSlots(); appPrefs.begin("BWS-LW-APP", false); uint8_t ws_timeout = appPrefs.getUChar("ws_timeout", WEATHERSENSOR_TIMEOUT);