From eb4da9d637f5ef9b9e1dec3e5fab2b496c920b08 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Wed, 3 Jun 2020 16:04:47 +0200 Subject: [PATCH] add debugging info, bug fix --- mini-beieli-node.ino | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index 16f4cad..6e63a67 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -763,6 +763,7 @@ void StartNewIteration() { if (config_data.debug_level > 0) { gCatena.SafePrintf("LMIC.opmode just before Sleeping: %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); } if (!fUsbPower) { @@ -817,22 +818,28 @@ void startSendingUplink(bool firstTime) package_counter++; if (config_data.debug_level > 0) { gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode); - } else { - gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); } } + else { + gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); + } } else { if (config_data.debug_level > 0) { gCatena.SafePrintf("LMIC.opmode just before SendBuffer: %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); gCatena.SafePrintf("SendBuffer not firstTime\n"); } if (gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort)) { package_counter++; if (config_data.debug_level > 0) { gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode); - } else { - gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); } + } else { + gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); + gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); } }