From 0c5c673e5ec1fcf2e768d59dbe3243bc25d86ae2 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Sat, 30 May 2020 18:01:13 +0200 Subject: [PATCH] add delay, see https://github.com/mcci-catena/arduino-lmic/issues/547 --- mini-beieli-node.ino | 7 ++++++- mini_beieli_node.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index a0c2b6c..f875239 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -698,6 +698,7 @@ void StartNewIteration() { while (send_in_progress && ((millis() - start_time) < 300000)) { os_runloop_once(); + delay(10); // gCatena.poll(); // yield(); } @@ -802,6 +803,7 @@ void startSendingUplink(bool firstTime) package_counter++; } else { if (config_data.debug_level > 0) { + gCatena.SafePrintf("LMIC.opmode just before SendBuffer: %#x\n", LMIC.opmode); gCatena.SafePrintf("SendBuffer not firstTime\n"); } gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); @@ -819,6 +821,7 @@ static void sendBufferDoneCb( if (config_data.debug_level > 1) { gLed.Set(LedPattern::Settling); + gCatena.SafePrintf("LMIC.opmode in sendBufferDoneCb: %#x\n", LMIC.opmode); } pFn = settleDoneCb; @@ -834,7 +837,7 @@ static void sendBufferDoneCb( gLoRaWAN.Shutdown(); } else if (config_data.debug_level > 0) { - gCatena.SafePrintf("send buffer failed\n"); + gCatena.SafePrintf("send buffer failed, LMIC.opmode: %#x\n", LMIC.opmode); } } @@ -961,6 +964,7 @@ void doSleepAlert(const bool fDeepSleep) while (uint32_t(millis() - tNow) < 1000) { os_runloop_once(); + delay(10); //gCatena.poll(); //yield(); } @@ -975,6 +979,7 @@ void doSleepAlert(const bool fDeepSleep) while (uint32_t(millis() - tNow) < 100) { os_runloop_once(); + delay(10); //gCatena.poll(); //yield(); } diff --git a/mini_beieli_node.h b/mini_beieli_node.h index 93997d3..bc06009 100644 --- a/mini_beieli_node.h +++ b/mini_beieli_node.h @@ -56,7 +56,7 @@ enum { | \****************************************************************************/ -static const int32_t fwVersion = 20200529; +static const int32_t fwVersion = 20200530; static const byte INIT_PACKAGE_INTERVAL = 100; // send an init package every 100 packages; static const byte MAX_VALUES_TO_SEND = 8;