diff --git a/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino b/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino index e1c0df1..d818772 100644 --- a/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino +++ b/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino @@ -12,7 +12,7 @@ BME280 bme280; /******************************************************************************/ /* Firmware Version */ /******************************************************************************/ -static const int32_t fwVersion = 20240622; +static const int32_t fwVersion = 20240624; /******************************************************************************/ /* LoraWAN Settings */ @@ -226,6 +226,7 @@ bool start_new_iteration = false; bool next_package_is_init_package = true; uint32_t gRebootMs; char last_channel = 'X'; +bool toobigweightchange = false; /******************************************************************************/ /* Functions for Global Data Structures */ @@ -879,6 +880,7 @@ bool TooBigWeightChange() Serial.printf("TooBigWeightChange (my_position: %d): %d...\n", my_position, big_difference); } + toobigweightchange = big_difference; return big_difference; } @@ -980,7 +982,7 @@ void loop() { if (ReadSensors(false)) { // we send confirmed packages when weight change is too big or for every init package - isTxConfirmed = (TooBigWeightChange()) || (iteration <= INIT_PACKETS) || (iteration % INIT_PACKAGE_INTERVAL == 0); + isTxConfirmed = (toobigweightchange) || (iteration <= INIT_PACKETS) || (iteration % INIT_PACKAGE_INTERVAL == 0); prepareTxFrame(appPort); LoRaWAN.send(); package_counter++;