do not send on first position

This commit is contained in:
Joerg Lehmann 2020-06-08 20:40:57 +02:00
parent 23de8b8f4b
commit 22982235fb
1 changed files with 1 additions and 1 deletions

View File

@ -679,7 +679,7 @@ void StartNewIteration() {
// we send data the first time the system is started, when the array is full // 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 // or when the weight has fallen more than threshold or the first measurement is
// more than one hour old (which should not happen :-) ) // 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); lora_data.offset_last_reading = (uint8_t)((millis() - timer_pos0) / 1000 / 60);
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("startSendingUplink(), my_position: %d, iteration: %d, package_counter: %d\n", my_position, iteration, package_counter); gCatena.SafePrintf("startSendingUplink(), my_position: %d, iteration: %d, package_counter: %d\n", my_position, iteration, package_counter);