methods to avoid joining in AT CMD mode after powerup
Tagged: join
- This topic has 6 replies, 3 voices, and was last updated 7 years, 8 months ago by
Husam Ismail.
-
AuthorPosts
-
July 12, 2017 at 1:25 pm #19918
Eric Tsai
ParticipantHi,
We have a use case where the xDot is operating in AT Command mode with an external MCU issuing the join/send/etc commands. The xDot is powered off completely, and power is reapplied when there is a sensor event and there is data to send to the Conduit. Even when the join mode is set to AUTO_OTA, join sessions are not preserved across power down states (only across sleep). This is a battery consumption issue because it forces us to join on every power-up/sensor event.I understand this would be easier if we can sleep/wake the xDot rather than having to power it off completely, as the Auto_OTA will save the session credentials in battery-backed registers and can be restored on wake. But if that’s not possible, what options are there to avoid having to re-join every single time but still use OTA / Auto_OTA on the initial join? I don’t see an AT command to write the session keys to flash and have it automatically read session keys from flash on power up. That would be a nice feature, as it gives the user complete control over re-join scheme.
When join mode is set to Auto_OTA, can we still use AT+NA, AT+NSK, and AT+DSK to basically set the credentials on the xDot on a power up? So, a possible scheme might be to AT&V, parse the output for the Network Address, NSK, and DSK, and save it off on external flash on the PIC. Then on power up, AT+NA, AT+NSK, and AT+DSK with the saved credentials? The external MCU can still issue join commands if needed to get valid keys. This seems like a very backwards way of doing it though.
Are there other options?
I wish Auto_OTA saved credentials to flash.
July 12, 2017 at 1:38 pm #19919Jason Reiss
KeymasterEnable saving session over power cycle.
AT+PS=1Or AT+SS before power down and AT+RS after power up to save and restore the session manually in AT+NJM=1 OTA mode.
-
This reply was modified 7 years, 8 months ago by
Jason Reiss.
July 12, 2017 at 2:07 pm #19921Eric Tsai
ParticipantLOL. Thanks Jason. I didn’t catch that when I RTFM 🙂
July 12, 2017 at 2:41 pm #19924Husam Ismail
ParticipantThanks Jason, this is very helpful.
The Dot seems to be able to AT+SS before power down and AT+RS after power up and send data (even receive ack back) just fine. However from the gateway side, for some reason, I don’t see the “up” packet while monitoring the UDP port, all I see is the packet_recv and packet_sent messages (usually I see “up” packet in between the two). Is there anything that I need to do/configure from the gateway side as well?Thanks again.
July 12, 2017 at 2:47 pm #19925Jason Reiss
KeymasterPerhaps first uplink is using the previous FCNT.
Was ACK received before power off?July 12, 2017 at 3:19 pm #19926Husam Ismail
ParticipantYes, before power off I could see “up” message on gateway and Ack was received by end node. after power off I don’t see the “up” message on gateway at all and only packet_recv and packet_sent messages, although sometimes I could see Ack back on the end node. I will check the FCNT, thanks again.
July 12, 2017 at 4:22 pm #19927Husam Ismail
ParticipantPilot error !!
OK, I think I figured what I was doing wrong. to get it working properly I moved the AT+SS to the very last step just before powering off (I was previously sending this command immediately after successful AT+join), Also I wasn’t sending AT+SS each and every time before powering off.
The sequence below works perfectly fine (this is very cool feature!)
1) Initializing App/EUI keys
2) AT + PS =1
3) AT + NJM =1
4) AT + JOIN
>> wait for successful join
5) AT + Send something
6) AT + SS
>> power off
>> power up
7) AT + RS
8) AT + Send onemorething
9) AT + SS
>> power off
>> power on
>> repeat steps 7/8/9Thanks again Jason and Eric.
-
This reply was modified 7 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.