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.

Ztool : How to launch the network discovery by ZTOOL

Other Parts Discussed in Thread: CC2531, Z-STACK

Hi everyone,

I'm new, the zigbee stuff, so forgive my lack of understanding.

I'm working on Ztool using an usb Dongle CC2531 as coordinator. The stack is installed and ready to use. i have in the ZTOOL five Monitor and Test (MT) interface that is used for communication between the host tester and a ZigBee device through RS-232 serial port or USB port.

  • MT_SYS
  • MT_AF
  • MT_ZDO
  • MT_SAPI
  • MT_UTIL
  • MT_APP


my problem is that i don't find how to launch a network discovery request to let the ZED join the coordinators using ZTOOL.

I found that the ZD0_NWK_DISCOVERY_REQ is the command to send to the coordinator that tell him to iniate a network discovery ( active scan ) in channels. But when i use this command, i have the following error as answer :

    <TX>11:06:41.7 COM3 ZDO_NWK_DISCOVERY_REQ (0x2526)
        ScanChannels: ALL_CHANNELS (0x7FFF800)
        ScanDuration: 0x04

    <RX>11:06:41.71 COM3 ZDO_NWK_DISCOVERY_REQ_SRSP (0x6526)
        Status: ZNWK_INVALID_REQUEST (0xC2)

Is anyone has an idea of how i can launch the network discovery ?

  • You should use ZDO_JOIN_REQ.

  • Hi YiKai,

    In fact, i found that i had to leave the actual network and reset the stack before using the ZDO_NWK_DISCOVERY_REQ.

    But this is just a discovery, when i send the command with the following parametter i have the following response :

    <TX>03:59:55.22 COM3 ZDO_NWK_DISCOVERY_REQ (0x2526)
        ScanChannels: ALL_CHANNELS (0x7FFF800)
        ScanDuration: 0x05

    <RX>03:59:55.23 COM3 ZDO_NWK_DISCOVERY_REQ_SRSP (0x6526)
        Status: SUCCESS (0x0)

    <RX>04:00:03.4 COM3 ZDO_BEACON_NOTIFY_IND (0x45C5)
        BeaconCount: 0x01
        BeaconList:
        SourceAddress: 0xD81E
        PanId: 0x9716
        LogicalChannel: 0x0B
        PermitJoining: 0x00
        RouterCapacity: 0x01
        DeviceCapacity: 0x01
        ProtocolVersion: 0x02
        StackProfile: 0x02
        LQI: 0x4E
        Depth: 0x01
        UpdateId: 0x00
        ExtendedPanId: 0x00124B00015A63FC

    i guess that the sourceaddress given is the address of my zigbee device who send the beacon detected by the coordinator.

    But this device not have the permission to join the network.

    even when i used the following parameter in the ZDO_JOIN_REQ, the response is :

    <TX>04:06:47.07 COM3 ZDO_JOIN_REQ (0x2527)
        LogicalChannel: 0x0B
        PanID: 0x9716
        ExtendedPanID: 0x00124B00015A63FC
        ChosenParent: 0xFFFE
        ParentDepth: 0x00
        StackProfile: 0x02

    <RX>04:06:47.08 COM3 ZDO_JOIN_REQ_SRSP (0x6527)
        Status: ZNWK_NOT_PERMITTED (0xC3)

    i guess that the network don't let the devices to join the network. how can i manage that ?

  • You need to do permitjoin on your coordinator.

  • The problem, is that i already done that but it send me an error :

    <TX>04:36:25.83 COM3 ZDO_MGMT_PERMIT_JOIN_REQUEST (0x2536)
        DstAddr: 0xFFFC
        Duration: 0xFF
        TCSignificance: 0x00

    <RX>04:36:25.85 COM3 ZDO_MGMT_PERMIT_JOIN_REQ_SRSP (0x6536)
        Status: ZNWK_INVALID_REQUEST (0xC2)

    i also tried the  ZB_PERMIT_JOINING_REQUEST  but i have the same error :

    <TX>04:37:13.07 COM3 ZB_PERMIT_JOINING_REQUEST (0x2608)
        Destination: 0xFFFC
        Timeout: 0xFF

    <RX>04:37:13.07 COM3 ZB_PERMIT_JOINING_REQUEST_RSP (0x6608)
        Status: ZNWK_INVALID_REQUEST (0xC2)

    ...

  • The DstAddr should be 0x0000. Try it to see if it works.

  • Nop it's not working, i have the same error :

    <TX>05:24:48.14 COM3 ZDO_MGMT_PERMIT_JOIN_REQUEST (0x2536)
        DstAddr: 0x0000
        Duration: 0xFF
        TCSignificance: 0x00

    <RX>05:24:48.16 COM3 ZDO_MGMT_PERMIT_JOIN_REQ_SRSP (0x6536)
        Status: ZNWK_INVALID_REQUEST (0xC2)

    ps : By the way, thanks for taking the time to help me !

  • It is weird. Could you specify which ZStack version do you use? By the way, do you define MT_ZDO_MGMT in your coordinator project to enable permit join MT command?

  • Hi,

    Status 0xC2 means that the device is already on a network.

    Regards,

    Ilya

  • Hi Chen,

    The ZStack version: ZNP-Prod-25.1.0-002_000-cc2531

    I'm not the one who define the MT interfaces, i'm just trying to testing it, but yes i think that it's defined in the coordinator projet to enable permit joint MT command.

  • I think that this status just mean that the command doesn't success, it doesn't mean that the device is in the network. i already try to reach it but with no success....

  • For all the cases I've seen the error status 0xC2 meant the device is already on a network. 

    Look at  Z-stack Monitor and Test API and CC2530ZNP Interface documents as an example.

    The fault in reaching the node can be caused by very different reasons.

    regards,

    Ilya

  • hi Ilya

    I already read the documents but if the device was already in the network, it will be listed as associated device when i run the command  UTIL_GET_DEVICE_INFO, which is not the case ! look :

    <TX>09:48:17.15 COM3 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>09:48:17.16 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
        Status: SUCCESS (0x0)
        IEEEAddr: 0x00124B00015A63FC
        ShortAddress: 0xFFFE
        DeviceType: COORDINATOR, ROUTER, END_DEVICE (0x7)
        DeviceState: DEV_HOLD (0x0)
        NumAssocDevices: 0x00
        AssocDevicesList

    there is no associated device.

    and when i try the command ZDO_NWK_ADDR_REQ to get the 16bit address of the device, there is no response.

    <TX>10:05:08.29 COM3 ZDO_NWK_ADDR_REQ (0x2500)
        IEEEAddress: 0x00137A00000080CA
        ReqType: SINGLE_DEVICE_RESPONSE (0x0)
        StartIndex: 0x00

    <RX>10:05:08.3 COM3 ZDO_NWK_ADDR_REQ_SRSP (0x6500)
        Status: 194 (0xC2)

    so i don't think that the device is already in the network because in that case i will have something like that i guess :

    <TX>09:20:42.36 COM4 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>09:20:42.38 COM4 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
        Status: SUCCESS (0x0)
        IEEEAddr: 0x12A1050DFF005C00
        ShortAddress: 0x0000
        DeviceType: COORDINATOR (0x1)
        DeviceState: DEV_ZB_COORD (0x9)
        NumAssocDevices: 0x01
        AssocDevicesList: 0x2320

    ( this result was made with another zigbee dongle who already have some devices associated)

  • what I need  to do is open a window association of 15 seconds from ZTool, as it is possible to do it on CleoBee. how to do that since the permit join command doesn't ?

  • Hi,

    I'm not sure whether I understand your tests correctly.

    First of all, the result like

    <TX>09:48:17.15 COM3 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>09:48:17.16 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
        Status: SUCCESS (0x0)
        IEEEAddr: 0x00124B00015A63FC
        ShortAddress: 0xFFFE
        DeviceType: COORDINATOR, ROUTER, END_DEVICE (0x7)
        DeviceState: DEV_HOLD (0x0)
        NumAssocDevices: 0x00
        AssocDevicesList

    means that the device is initialized but hasn't started.

    If you have just 2 devices in the network, you should  launch one of them as the coordinator and another as the router.

    Next steps are dependant on what firmware you are using.

    In case of ZNP, given the coordinator has already started, the start of the router will result in the appearance of ZDO_END_DEVICE_ANNCE message.

    Also, subject to ZNP usage, there are no restrictions on network joining. This means that you doesn't have to set any time window for joining.

    regards,

    Ilya

  • Hi Chen, the permit join request does not worked before, because i had a little problem with the ZSTACK, i changed my Zigbee Dongle to another and run the tests agains, and now it's work but we need also after that to do a ZDO_MGMT_NWK_DISC_REQ to discover the ZPLUG or other devices.

    Anyway thanks for the help !

  • You are welcome and nice to hear that your problem is fixed.

  • Hi,

    I am facing a similar issue.Here is the brief explanation :

    I am using cc2531 as coordinator with znp flashed inside it.I can successfully on/off a HA Bulb and also get the simple descriptor using z-tool.

    For simple descriptor i use zdo simple descriptor request and for on/off the bulb i use Af data register and Af data request MT commands.

    When i send zb start request at the beginning to start the device as a coordinator and turn on my HA bulb the bulb continuosly sends the beacons in unfomatted response.Here is a screen shot of that.

  • I do not see your screen shot.

  • Hi,
    I am sorry i had problem attaching the screen shot so here i attached it in my previous post.
    MY problem is that i need to set such configurations in coordinator that when i send a discovery command for a certain time period at that time only it allows any device to join the network.

    I tried using zdo mgmt nwk disc command and it worked successfully.

    But after the time window completes the end device stops sending the beacons as in the screen shot.And the end device does not respond once it stops sending this unformatted data.

    I debugged this issue by capturing over the air frames and i observed that once the device is associated and stops sending the unformatted data still when we issue any command to communicate with end device for eg simple descriptor request then the coordinator sends the frame and is captured in packet analyzer.But the end device does not send any response to this.

    Please help me solving this issue.
    Thanks Charmi.
  • You should use ZDO_MGMT_PERMIT_JOIN_REQ to enable permit join on ZC so device can join it.
  • What are these files? I cannot open them.
  • Hi Yk,

    I have attached the documents of the responses recieved from ztool.
    The first attach.docx is the file without using permit join request.It will always allow any device to join the network.
    As soon as the zigbee stack starts the bulb starts sending the data in unformatted form contionuosly.
    At this time the communication with the buolb is possible.here i have shown this by sending simple descriptor req command.we get the response from the bulb;.

    In the next document attach with permit join.docx.
    I start the zigbee stack and send permit join request command and set the join time 10 sec.Then i on the bulb within 10 sec and the bulb joins the network.
    But after 10 sec it stops sending the raw data.so after this when i send simple descriptor req the bubl does not respond to it.

    Please guide me solving this issue.

    Thanks
    Charmi.
  • Hi Yk

    attach.doc

    Here are the files.you have to download and open it.

    Thanks

    Charmi

  • Hi YK,

    Did you get the files??

    Thanks
    Charmi.
  • I suggest you to enable permit join for a longer time, e.g. 180 seconds.
  • Hi YK,
    I tried setting the time to 180 sec.The bulb will send the raw data for 180 sec and in that time the communication is possible.After that it stops sending the raw data and again the same problem no response after that time.

    I need to set such configurations that once the bulb is associated the communication should be possible any time.

    Please guide me for setting such configurations.
    Thanks
    Charmi.
  • I cannot judge what happens according to your descriptions. I suggest you can use Ubiqua Packet Analyzer to check over the air messages.
  • By the way, I see there are lots of "Unsupported or unformatted message received. Raw data: 0C 45 CA B8 F5 F8 C5 41 03 00 6F 0D 00 00 00". Is this sent by the bulb?
  • the command "0C 45 CA B8 F5 F8 C5 41 03 00 6F 0D 00 00 00" is a ZDO callback for Trust Center Device Indication. The reason why it shows as unsupported is because this command was added to the ZNP firmware fairly recently and it has not been added to Z-Tool.
    if you are wondering what is the format of this command here it is:

    (1B)Length = 0x0C |  (1B)Cmd0 = 0x45 | (1B)Cmd1 = 0xCA | (2B)SrcNwkAddr | (8B)SrcIEEEAddr | (2B)Parent Nwk Addr

    Regards,
    Hector.

  • HI ,

    Please can you briefly explain this zdo call back trust center device indication is the response for which command?
    Also tell me that what this call back indicates?
    Or please send me any link which gives me details for this I am not able to find it.

    Thanks a lot for the kind help.

    Thanks
    Charmi.
    charmi.
  • Hi,

    This command indicates that a device has joined the network.
    You don't need to take any actions when you get the command unless you have a use for the information it contains.

    Regards,
    Hector