Hi,
I'm working on AP and EDs network that need to be as tolerant as possible to various real environment events (out of range, restarts, ...)
While I have EDs normally working, and I also develope AP (frequent builds, restarts, etc...)
I spot that on EDs, when they don't receive ACK on their messages they try to repeat Join&Link procedure... Probably cause I also change AP address, but Link IDs on EDs grow and after some time I get SMPL_NOMEM status from SMPL_Link call. From code :
SMPL_NOMEM No room to allocate local Rx port, no more * room in Connection Table, or no room in * output frame queue.
I guess I ran out of resources, since I'm reconnecting from ED, it's safe to clear everything needed to get pass this problem. Any advice ?
Thanks in advance,
regards,
Bulek.
I've explored this problem further and found interesting thing. I can recreate this problem and it seems like a bug or at lest inconsistent behaviour in SIMPlCITI code.
Scenario :
1. run AP
2. run ED and it will JOIN&Link
3. power reset AP (it comes on with same address, but empty connection table)
4. ED occasionally sends message with ACK request to check if it's linked with AP. It doesn't receive ACK, cause AP is not responding to unconnected peer frames
5. ED goes into rejoin&link phase when it joins and links to the "new" AP. Regardless the fact, that the address of AP is the same it takes another entry in connection table for this new link (it doesn't recognize that AP with same address is already in connection table) under new Receive port number and same Send port number as previous connection. For the first time this works, cause there is one free entry in connection table, but for the second time it reports out of memory...
What I'll do right now as a workaround is to clean connection table with IOCTL call, but I think this should be managed properly in SIMPLICITI code...
On the other thought this may be intentional behaviour, cause this is ability to have more connections to same device ?
Regards,
Bulek 4. ED occasionally sends message with ACK request to check if it's linked with AP. It doesn't receive ACK, cause AP is not responding to unconnected peer frames 5. ED goes into rejoin&link phase when it joins and links to the "new" AP. Regardless the fact, that the address of AP is the same it takes another entry in connection table for this new link (it doesn't recognize that AP with same address is already in connection table) under new Receive port number and same Send port number as previous connection. For the first time this works, cause there is one free entry in connection table, but for the second time it reports out of memory...
Do you call SMPL_Unlink() between step 4 and 5 (if the ED recognizes that AP is gone and try to link to another AP)? I think this is necessary to free the resource from the old "connection", otherwise the nwk_getNextConnection() at the beginning of nwk_link() function will fail since the old connection still occupy the handle resources.
-Leo-
Leo Hendrawan
- Now that my signature has caught your attention, please click the "Verify Answer" button if this post answers your question. Thanks! -
I'm calling IOCTL that changes state of connections to FREE.
It seems to work, EDs now reconnect in all cases. But is this proper solution ?
altough you didn't mention it, i assume you are using the IOCTL_OBJ_CONNOBJ. Basically it should be the same, because if you see the code both calls nwk_freeConnection(). The only difference is only that SMPL_Unlink() will send an unlink message first and wait for the reply (with timeout).
So basically, no major difference between both function in terms of freeing connection resource on the local device. However for the remote device, it will a difference since by using SMPL_Unlink() the remote device will also know that the local device is unconnecting so that the remote device can also free the connection resources, while using the IOCTL_OBJ_CONNOBJ, the remote device will not get this information and still keep the connection information.
I think as good practice, i would advise to use the SMPL_Unlink() instead the IOCTL_OBJ_CONNOBJ.
Hope this helps.