methods to avoid joining in AT CMD mode after powerup

Home Forums mDot/xDot methods to avoid joining in AT CMD mode after powerup

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19918
    Eric Tsai
    Participant

    Hi,
    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.

    #19919
    Jason Reiss
    Keymaster

    Enable saving session over power cycle.
    AT+PS=1

    Or 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.
    #19921
    Eric Tsai
    Participant

    LOL. Thanks Jason. I didn’t catch that when I RTFM 🙂

    #19924
    Husam Ismail
    Participant

    Thanks 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.

    #19925
    Jason Reiss
    Keymaster

    Perhaps first uplink is using the previous FCNT.
    Was ACK received before power off?

    #19926
    Husam Ismail
    Participant

    Yes, 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.

    #19927
    Husam Ismail
    Participant

    Pilot 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/9

    Thanks again Jason and Eric.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.