Other Parts Discussed in Thread: Z-STACK
Tool/software: TI C/C++ Compiler
Hi TI Team,
I used this functionUI_ActionConfigurePanId(panID) to set PAN ID. But need reset to take effect?
Regards,
Walter
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Why do you want to do that? Basically, PANID shouldn't be changed from application after coordinator forms Zigbee network. If there is PANID conflict, Z-Stack would handle it. Anyway, if you want to change it from application, you can try to use "ZMacSetReq( ZMacPanId, (uint8_t *)&panId );". I have no experience using this API so I don't know if it works in your case.
Hi YK,
This one only production line only. We want to communicate to specific PAN ID only.
Any one from TI can confirm this?
1. ZMacSetReq
2. UI_ActionConfigurePanId
Regards,
Walter
Hi,
If the device is not part of a network, then you can use UI_ActionConfigurePanId, which will update zgConfigPANID and the PANID NV item ZCD_NV_PANID.
For network formation capable devices, if this value is not 0xFFFF, then that device can form a network with PANID == zgConfigPANID.
For joining devices, if this value is not 0xFFFF, then that device will only join networks with that PANID.
Perhaps try this out by configuring a zc_* and a zed_* with the same PANID, and see if commissioning works as expected.
Also, configure a zc_* and a zed_* with different PANIDs, and see if zed_* does not join zc_*.
Regards,
Toby
Assuming you follow what I mentioned above, a reset should not be required.
Hi Tobby,
I tried setting PAN ID in zstack_config.h in ZC and ZED but always can pair.
Ex #1: ZC PAN = 0x0123, ZED =0x0124,
Ex #2: ZC PAN = 0x0123, ZED =0x0101,
We are using simplelink_cc13x2_26x2_sdk_3_10_00_53...
Regards,
Walter
Walter
Make sure to erase all flash before flashing the new image (with modified ZDAPP_CONFIG_PAN_ID).
What is the PANID of the network after erasing/flashing?
Also, as a debug step, check the value of zgConfigPANID in ZDO_StartDevice (for the ZC) and in bdb_filterNwkDisc (for the ZED).
Compare this to what you have defined for ZDAPP_CONFIG_PAN_ID and the PANID you see in the sniffer.
Hi Toby,
I used the UI_ActionConfigurePanId() to set PAN ID of my device but still can pair regardsless.
Alternatively, I used the call:
zstack_sysConfigWriteReq_t writeReq = {0};
writeReq.has_panID = true;
writeReq.panID = setmypanID;
(void)Zstackapi_sysConfigWriteReq(uiAppEntity, &writeReq);
Regards,
Walter
Regards,
Walter
If two projects are built with different ZDAPP_CONFIG_PAN_ID values, the launchpads (with flash erased) they are flashed on should not be able to join the same network (same PANID).
Let's first confirm that this is the case.
Can you set up a sniffer and re-try this? Then attach the sniffer log afterwards.
No, a reset is not necessary to change the PANID of a device which is not yet commissioned.
Hi TI Team,
When I write directly from config it can work by definition. SAme ID will pair, not similar cannot pair.
But, when I use the UI_ActionConfigurePanId(panID) it cannot work even if I reset.
I will try to use this API and let you know the result.. MacSetReq( ZMacPanId, (uint8_t *)&panId ).
Regards,
Walter
Hi TI Team,
The value allowed is 8 bits only for this API :ZMacSetReq(ZMacPanId, (uint8_t *)&PANID).
So, I use this call ,but stll cannot block pairing with my coordinator.
uint16_t PANID = 0x1111;
(ZMacStatus_t) MAP_MAC_MlmeSetReq( ZMacPanId, (uint16_t *)&PANID );
I need help.
Thanks,
Walter
Although the second argument passed to ZMacSetReq is a pointer to a uint8_t, this would likely be typecasted to the correct pointer by ZMacSetReq based on the attribute to be set (determined by first argument).
So you may use a 16-bit PANID for ZMacSetReq.
I just tried with UI_ActionConfigurePanId and it worked as expected. I called this before the devices performed commissioning.
However, if you are not using the UI (which is often the case for low power ZED), I would recommend using Zstackapi_sysConfigWriteReq. Again, make sure to do this before the device attempts to join/form a network.
zstack_sysConfigWriteReq_t writeReq = {0}; zgConfigPANID = panID; // Update the config PAN ID, defined in znwk_config.h writeReq.has_panID = true; writeReq.panID = zgConfigPANID; (void)Zstackapi_sysConfigWriteReq(uiAppEntity, &writeReq);
See the following functions for how a device forms a network or chooses a network to join:
- form network: ZDO_StartDevice --> NLME_NetworkFormationRequest
- filter network to join: bdb_ProcessOSALMsg --> bdb_filterNwkDisc
Yes, if you call Zstackapi_sysConfigWriteReq AND reset/power cycle the device before it joins/forms a network, then zgConfigPANID will be set with ZDAPP_CONFIG_PAN_ID, which results in the NV item ZCD_NV_PANID being set to zgConfigPANID (see zgInit).
So I would recommend calling Zstackapi_sysConfigWriteReq to set the appropriate PANID before commissioning.
Although that may work, I do not recommend writing directly to _NIB.nwkPanId, since the device interprets this as the PANID of the network it has already formed/joined.
It is much safer to use Zstackapi_sysConfigWriteReq before commissioning.
Before commissioning, check if the node is on a network (eg. function bdb_isDeviceNonFactoryNew checks bdbAttributes.bdbNodeIsOnANetwork). If not, then set the PANID as appropriate for your application.
In this way, even if PANID is reset to 0xFFFF, then you would set it to the desired value before commissioning (so that you are not commissioning by default with PANID 0xFFFF (any valid PANID)).