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

Fix for #82, workaround for #81 #83

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BresserWeatherSensorTTN",
"version": "0.12.0",
"version": "0.12.1",
"description": "Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver; provides data via LoRaWAN",
"main": "BresserWeatherSensorTTN.ino",
"frameworks": "arduino",
Expand All @@ -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
Loading