Closed David-2D3FE9 closed 3 years ago
Ok,
I've just used a more reasonable sleep mode:
esp_light_sleep_start();
instead of esp_deep_sleep_start();
So no need of saveKeys();
or restoreKeys();
No more useless join request, keys are restored automaticaly everything work great !
Hello, I am building a node witch will going to sleep for hour(s) before sending data to TTN and going to sleep again ( what originality! :-) )
My aim is to avoid proceeding a join request after each wake up. So I try differents examples and tests, but each time a join request is sended to TTN and new keys are returned.
My basic test sketch consist in this code execution while i am also looking at the "live data" in my TTN console:
So at the first loop I have printed:
NwkSKey: 0000000000000000
After the first joint the key is not empty anymore (normal it is joined)NwkSKey: 9589D7F246FC4CC2E586B7CA5F2A190
But after the sleep / wake up the key is back toNwkSKey: 0000000000000000
and a new join request is sentI tried to use the
saveKeys();
just after joining ,andrestoreKeys();
at the begin of thevoid setup( ){
But it is still display empty keys before joining.Without sending the board to sleep the keys are correctly kept and an new request is not resent:
Does anyone have an exemple of how to deal with storing keys with sleep mode ?