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.

CC2538: Every two resets, join to network fails

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK

Hello,

Using CC2538, with Z-Stack Mesh v1.0.0 due to compatibility reasons.

I have already a ZC that creates a network and then I connect a ZR. To do this test I have used the GenericApp example of the library.

 

I have used HOLD_AUTO_START to perform a network connection at application level. Moreover I don’t want to use NV network parameters so I set the NV flag to force a new join if the NV_RESTORE is defined. As specified in documentation (Z-Stack Developer’s Guide - SWRA176) NV_RESTORE must be always enabled in a real ZigBee network. So I added these two lines just at the end of the function GenericApp_Init() of GenericApp.c.

 

zgWriteStartupOptions( ZG_STARTUP_SET, (ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE) );

ZDOInitDevice(0);

 

First time, the ZR connects successfully to the network that ZC has created. But when the router is reset, no beacon request is seen neither attempt to reconnect.

If I restart the node again, it perform the connection successfully. And again, if I restart the node, no attempt to reconnect is seen. Therefore, every two resets ZR doesn’t connect to the network.

 

I debug the code and seems that in the function ZDO_StartDevice() from ZDObject.c, NLME_NetworkDiscoveryRequest() returns ZNwkInvalidRequest every two resets.

I don’t know what I am doing wrong, I only want a node that connects not automatically to a network without using the NV network parameters.

 

Anyone could explain me why all this is happening?

 

Thanks.

 

Melvin.

  • Melvin,

    To understand this more, you are wanting your device to connect to your ZC and then be able to automatically rejoin the network without using NV to restore the network parameters after a reset? Or are you wanting the ZR to not automatically rejoin the network after a reset?

    Best,

    Sean

  • You have to do reset to device to make zgWriteStartupOptions work after you call zgWriteStartupOptions( ZG_STARTUP_SET, (ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE) );

  • I want to be able to automatically rejoin to the network without using the NV network parameters. As specified in specifications, it says that NV_RESTORE must be used. Therefore, the solution was to use the flag of force new join. But this startupOption only works and is applied after a reset as YK Chen said.
  • Melvin, thanks for your clarification. I'm glad you were able to get this resolved!

    Yes, looking further into the Z-Stack API.pdf inside Section 3.1.2 ZDO Device Network Startup, it talks about exactly these things on what you must do including the flag for forcing a new join. Thank you for providing your solution :)

    Best,
    Sean