Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
Fix for #82, workaround for #81
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Feb 22, 2024
1 parent 1008e7a commit b630609
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
#declare -a required_libs=("https://github.com/matthias-bs/BresserWeatherSensorReceiver.git"
declare -a required_libs=(
"[email protected]"
"BresserWeatherSensorReceiver@0.22.1"
"BresserWeatherSensorReceiver@0.23.1"
"MCCI LoRaWAN LMIC [email protected]"
"MCCI Arduino LoRaWAN [email protected]"
"MCCI Arduino Development Kit [email protected]"
Expand Down
10 changes: 9 additions & 1 deletion BresserWeatherSensorTTN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
// 20231223 Updated to BresserWeatherSensorReceiver v0.20.1
// 20240116 Fixed rain counter overflow value for SENSOR_TYPE_WEATHER0
// (see https://github.com/matthias-bs/BresserWeatherSensorReceiver/releases/tag/v0.5.1)
// 20240222 Added weatherSensor.clearSlots() (part of fix for #82), added workaround for (#81)
//
// ToDo:
// - Split this file
Expand Down Expand Up @@ -1342,7 +1343,13 @@ void printDateTime(void) {

/// Determine sleep duration and enter Deep Sleep Mode
void prepareSleep(void) {
uint32_t sleep_interval = prefs.sleep_interval;
// FIXME
// Workaround for
// https://github.com/matthias-bs/BresserWeatherSensorTTN/issues/81
//uint32_t sleep_interval = (uint32_t)prefs.sleep_interval;
preferences.begin("BWS-TTN", false);
uint32_t sleep_interval = preferences.getUShort("sleep_int", SLEEP_INTERVAL);
preferences.end();
longSleep = false;
#ifdef ADC_EN
// Long sleep interval if battery is weak
Expand Down Expand Up @@ -1607,6 +1614,7 @@ cSensor::setup(std::uint32_t uplinkPeriodMs) {

#ifndef LORAWAN_DEBUG
weatherSensor.begin();
weatherSensor.clearSlots();
//bool decode_ok = weatherSensor.getData(prefs.ws_timeout * 1000, DATA_TYPE | DATA_COMPLETE, SENSOR_TYPE_WEATHER1);
bool decode_ok = weatherSensor.getData(prefs.ws_timeout * 1000, DATA_ALL_SLOTS);
#else
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/matthias-bs/BresserWeatherSensorTTN#README",
"dependencies": {
"BresserWeatherSensorReceiver": "matthias-bs/BresserWeatherSensorReceiver#semver:^0.22.1",
"BresserWeatherSensorReceiver": "matthias-bs/BresserWeatherSensorReceiver#semver:^0.23.1",
"arduino-lmic": "mcci-catena/arduino-lmic.git#v4.1.1",
"arduino-lorawan": "mcci-catena/arduino-lorawan.git#v0.10.0",
"Catena-mcciadk": "mcci-catena/Catena-mcciadk.git#v0.2.2",
Expand Down

0 comments on commit b630609

Please sign in to comment.