Skip to content

Library not usable for a "once in a lifetime OTAA join" #80

@Alex9779

Description

@Alex9779

Think I have to explain what I mean with the title...
As far as I recall it is best practice to join a network as few as possible maybe just once when the device is provisioned.
That is why certain values can be saved by the module in EEPROM to survive a power cycle.
So the default join method of the lib is OTAA, the values are saved and yes they are stored on the EEPROM and when I call again to join with no keys passed the stored one are used. But the module actually joins the network again, getting a new device EUI.
But sending data after a power cycle is not possible without a join!
What I found is that it is possible by joining with ABP on subsequent power ups.
When joining with OTAA the module also receives needed values for subsequent ABP joins where actually no data is transmitted, it is just loading the keys for encrypting the communication. But actually this does not work out of the box, no idea if this is a firmware bug or something. As you can't read those values you have no idea if they are really there or just stored temporarily, fact is that a simple OTAA join works until the next power cycle but then you can't join by ABP because the module tell you it has no keys.
I found a clue here: https://www.thethingsnetwork.org/forum/t/otaa-join-status-showing-not-joined-after-power-cycle-rn2483/23948/11
So what you have to do is to network session key and app session key with zeros before joining with OTAA, then the module saves the values in EEPROM and they survive a power cycle.
This enables you to do an ABP join with the stored values.

Any thoughts?

When I get time, I might prepare a PR with a proposal of changes...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions