Hi all,
I'm trying to integrate joiner into my project, here's my goal:
We will start a device as our commissioner, and while it is active, we will start the other devices as joiners such that they will handshake with the active commissioner and obtain the network parameters. Then we can enable them in the joiner callback function on success (currently not added in the code below, as I simply only want to see the outputs of the joiner callback function).
Currently, the workflow in my main.c goes like: otInstanceInitSingle -> otIp6SetEnabled -> start_joiner.
The problem is, I don't think the callback function was ever executed, as no outputs are shown, and the joiner is always stuck in the Discover state.
When I simply flash the CLI sample into 2 devices, commissioning works via the command line inputs:
- Start device A with new dataset, wait until it is leader, then start commissioner and add joiner (wildcard) with PSKd J01NME
- Start device B, factory reset, ot ifconfig up, ot joiner start J01NME
- Then the join is successful and I get the command line outputs.
However, using my current program approach:
- Flash CLI sample into device A, start it as usual, start as commissioner (same as the CLI approach)
- Flash a modified CLI sample code (shown below, implemented callback and start_joiner) onto device B
- Check commissioner state of device A, verify that it is active
- ot factoryreset on device B to reboot it, and it should start joiner with the defined PSKd.
- No further logs are displayed, after time limit reaches for commissioner, it will output Commissioner: Joiner remove.
The logs and implementation of start_joiner and joiner_callback are shown below, the left terminal is the commissioner, and the right terminal is the joiner.
How could it be that the joiner_callback was never called? The joiner is also stuck in the Discover state forever, even after the commissioner has expired. No errors were given.
I am experimenting on two 54L15DKs, with SDK v2.9.1. I would appreciate any help on this, thanks.
Best regards,
Allan