diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index a00957a..f19095c 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -129,7 +129,7 @@ sMyExtraCommands_top( | \****************************************************************************/ -static const int32_t fwVersion = 20191003; +static const int32_t fwVersion = 20191004; static const byte MAX_VALUES_TO_SEND = 8; static const uint8_t LORA_DATA_VERSION = 1; static const uint8_t LORA_DATA_VERSION_FIRST_PACKAGE = 129; @@ -188,7 +188,6 @@ typedef struct { byte my_position = 0; // what is our actual measurement, starts with 0 long timer_pos0; -long timer_boot; // timer when node booted // Global Variables LORA_data lora_data; @@ -241,7 +240,6 @@ void sensorJob_cb(osjob_t* pJob); void setup(void) { - timer_boot = millis(); gCatena.begin(); ClearLoraData(); @@ -929,16 +927,17 @@ static void receiveMessage(void *pContext, uint8_t port, const uint8_t *pMessage port, nMessage ); // we print out the received message... + gCatena.SafePrintf("Current LMIC.seqnoUp: %d\n",LMIC.seqnoUp); gCatena.SafePrintf("Received Data (Payload): \n"); for (byte i = 0; i < nMessage; i++) { - gCatena.SafePrintf("%c", pMessage[i]); + gCatena.SafePrintf("%02x", pMessage[i]); } gCatena.SafePrintf("\n"); } - if ((millis() - timer_boot) > 120000) { + if (LMIC.seqnoUp > 2) { if (config_data.debug_level > 0) { - gCatena.SafePrintf("tare with downlink is only possible within 2 minutes after boot!\n"); + gCatena.SafePrintf("tare with downlink is only possible within first two uplink packets!\n"); return; }