From 22982235fb155fdc8666788e22c3d24e4220148e Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Mon, 8 Jun 2020 20:40:57 +0200 Subject: [PATCH] do not send on first position --- mini-beieli-node.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index 96f87dd..84d496e 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -679,7 +679,7 @@ void StartNewIteration() { // we send data the first time the system is started, when the array is full // or when the weight has fallen more than threshold or the first measurement is // more than one hour old (which should not happen :-) ) - if ( (next_package_is_init_package) || (my_position >= MAX_VALUES_TO_SEND) || (abs(last_sensor_reading.weight - current_sensor_reading.weight) > SEND_DIFF_THRESHOLD_5GRAMS) || ((millis() - timer_pos0) > 3600000)) { + if ( (next_package_is_init_package) || (my_position >= MAX_VALUES_TO_SEND) || ((my_position > 1) && (abs(last_sensor_reading.weight - current_sensor_reading.weight) > SEND_DIFF_THRESHOLD_5GRAMS)) || ((millis() - timer_pos0) > 3600000)) { lora_data.offset_last_reading = (uint8_t)((millis() - timer_pos0) / 1000 / 60); if (config_data.debug_level > 0) { gCatena.SafePrintf("startSendingUplink(), my_position: %d, iteration: %d, package_counter: %d\n", my_position, iteration, package_counter);