This commit is contained in:
Joerg Lehmann 2020-06-06 08:37:28 +02:00
parent d0a173a54a
commit 57d795c36b
2 changed files with 15 additions and 9 deletions

View File

@ -498,7 +498,7 @@ uint8_t GetVBatValue(int millivolts)
void DoDeepSleep(uint32_t sleep_time) void DoDeepSleep(uint32_t sleep_time)
{ {
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("DoDeepSleep, now going to deep sleep\n"); gCatena.SafePrintf("DoDeepSleep, now going to deep sleep, millis: %d\n",millis());
} }
// Prepare Deep Sleep // Prepare Deep Sleep
@ -515,7 +515,7 @@ void DoDeepSleep(uint32_t sleep_time)
deepSleepRecovery(); deepSleepRecovery();
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("done with deep sleep\n"); gCatena.SafePrintf("done with deep sleep, millis: %d\n",millis());
} }
} }
@ -760,7 +760,8 @@ void StartNewIteration() {
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("LMIC.opmode just before Sleeping: %#x\n", LMIC.opmode); gCatena.SafePrintf("LMIC.opmode just before Sleeping: %#x\n", LMIC.opmode);
gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
} }
if (!fUsbPower) { if (!fUsbPower) {
@ -815,28 +816,33 @@ void startSendingUplink(bool firstTime)
package_counter++; package_counter++;
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode); gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode);
gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
} }
} }
else { else {
gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); 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 ); gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
} }
} else { } else {
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("LMIC.opmode just before SendBuffer: %#x\n", LMIC.opmode); 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("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
gCatena.SafePrintf("SendBuffer not firstTime\n"); gCatena.SafePrintf("SendBuffer not firstTime\n");
} }
if (gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort)) { if (gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort)) {
package_counter++; package_counter++;
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode); gCatena.SafePrintf("LMIC.opmode just after SendBuffer (successful): %#x\n", LMIC.opmode);
gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail ); gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
} }
} else { } else {
gCatena.SafePrintf("LMIC.opmode just before SendBuffer (failed): %#x\n", LMIC.opmode); 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 ); gCatena.SafePrintf("LMIC.globalDutyRate: %d, LMIC.globalDutyAvail: %d, os_getTime: %d\n", LMIC.globalDutyRate, LMIC.globalDutyAvail, os_getTime());
gCatena.SafePrintf("LMIC.seqnoUp: %d, LMIC.seqnoDn: %d\n",LMIC.seqnoUp, LMIC.seqnoDn);
} }
} }

View File

@ -56,7 +56,7 @@ enum {
| |
\****************************************************************************/ \****************************************************************************/
static const int32_t fwVersion = 20200604; static const int32_t fwVersion = 20200605;
static const byte INIT_PACKAGE_INTERVAL = 100; // send an init package every 100 packages; static const byte INIT_PACKAGE_INTERVAL = 100; // send an init package every 100 packages;
static const byte MAX_VALUES_TO_SEND = 8; static const byte MAX_VALUES_TO_SEND = 8;