I have started to use Cayenne following your example presented here - it is really easy and quick built-in integration (although I miss some data types like “date” or “time” for example…).
Were you restarting the frame counter when temperature/humidity sensor was replaced?
Does this board keep the state of variables during the deep sleep phase?
I didn’t replace the sensor nor the frame counter , it’s still the bme280
this board uses a different technique for sleep, it’s not the processor that wakes up and then wakes the radio module RN2483 but the other way.
that saves some energy, especially when you have long sleep periods (like one week)
the processor doesn’t have to wake up every 8 seconds to increase a counter and get back to sleep, it sleeps all the time until woken by the rn2483.
I use it for 5 min #define SLEEP_PERIOD 300000// max = 4294967296 - 49.7days
ttn.sleep(SLEEP_PERIOD); sends the rn2483 to sleep
attachInterrupt (digitalPinToInterrupt(2), awake, LOW); set the interrupt for the mcu on pin 2 when the rn2483 wakes up it sets the Tx line low, on that signal the MCU wakes
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
set the MCU to sleep
so at this point in the loop both are a sleep, when the rn2483 wakes up, it wakes the processor and
returns in the loop were it start again with
OK, now I understand that the state of variables (like frame counter) is unaffected by the sleep.
It is different from esp8266 which does not return to the loop() but goes to setup() when woken up (I think). Thanks!
In my code I generate a node ‘frame counter’ and also the TTN backend has a frame counter.
Every time I transmit a frame the arduino increases the counter variable by one and transmit that value.
(for Cayenne I use ‘luminosity’)
The TTN backend , when receives this packet, also increases by one so these 2 values must be equal or we missed a frame.
For example, if it starts freezing like -5, there is a chance that the RN2483 (old model) wil stop transmitting and when then later the temperature rises, it will start working again… these 2 counters could point to that possible problem.