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.

Help on porting software from XBee API to TI Monitor and Test API

Other Parts Discussed in Thread: CC2530, Z-STACK, CC2531

I'm porting software which uses a Digi XBee (Series 2 PRO) as a computer to ZigBee network interface  to use a TI CC2530 based USB dongle as an alternative network interface device (it's sourced from a 3rd party, so I don't have direct control over the firmware yet, but it talks the TI Monitor and Test API through a FTDI  USB/serial chip).

I was using (mostly) just two of the XBee API calls:

0x11 to send a ZigBee packet (takes parameters, destination IEEEAddr, NWKAddr, ClusterID, ProfileID, SrcEP, DstEP, radius, flags, payload)

The XBee (if configured properly) then returns all ZigBee related packets as a type 0x91 API packet which has source IEEEAddr, NWKAddr, ClusterID, ProfileID, SrcEP, DstEP, flags, payload)

From my understanding of the TI protocol, AF_DATA_REQUEST seems to be the closest thing to the XBee  send  method (it only takes 16bit NWK address, whereas the XBee accepts both NWK and IEEE -- but I can work with that).  

My problem is with the receive, especially with responses from ZDP/ZDO. These are returned as separate command codes in the TI protocol. I would much prefer to get the raw packet and do the parsing myself (as I've the software already written for that). Is this possible?

 

 

  • As discussed here:

    http://e2e.ti.com/support/low_power_rf/f/158/t/127446.aspx

    You can try using extended address in the AF data request.

    For incoming messages, you get basically all of the packet details:

    typedef struct
    {
      osal_event_hdr_t hdr;     /* OSAL Message header */
      uint16 groupId;           /* Message's group ID - 0 if not set */
      uint16 clusterId;         /* Message's cluster ID */
      afAddrType_t srcAddr;     /* Source Address, if endpoint is STUBAPS_INTER_PAN_EP,
                                   it's an InterPAN message */
      uint16 macDestAddr;       /* MAC header destination short address */
      uint8 endPoint;           /* destination endpoint */
      uint8 wasBroadcast;       /* TRUE if network destination was a broadcast address */
      uint8 LinkQuality;        /* The link quality of the received data frame */
      uint8 correlation;        /* The raw correlation value of the received data frame */
      int8  rssi;               /* The received RF power in units dBm */
      uint8 SecurityUse;        /* deprecated */
      uint32 timestamp;         /* receipt timestamp from MAC */
      afMSGCommandFormat_t cmd; /* Application Data */
    } afIncomingMSGPacket_t;

    But you want all of those details on an incoming packet for ZDO instead of the many notifications the Application gets from ZDO and the many ZDO callbacks for which the Application can register? Be carefull, but you have access to all of the ZDO source code here:

    C:\Texas Instruments\ZStack-CC2530-2.4.0-1.4.0\Components\stack\zdo

    Also, you can intercept the incoming ZDO messages here in afIncomingData() in AF.c. You could hijack the ZDO message and send it to yourself (not recommended). You could send the message to yourself in parallel to the ZDO in afBuildMSGIncoming(), and thereby you could sniff the stuff coming in without acting on it the way that ZDO has to.

     

     

     

     

  • Thanks for the tips. The problem is that (for the moment) I don't have the option of updating the firmware on the USB coordinator device because it's supplied by a 3rd party. The Z-Stack Monitor and Test serial port API is compiled in and I've got a Java application on a PC talking to it. So for the moment I have to make do with the serial port protocol as is.

  • You don't have to make due if you're willing to invest $49 in a better solution - buy the CC2531USB dongle:

    http://focus.ti.com/docs/toolsw/folders/print/cc2531emk.html

    Then load the ZigBee Network Processor (ZNP) onto it. The ZNP source code is part of any Z-Stack release installer:

    http://focus.ti.com/docs/toolsw/folders/print/z-stack.html

    swrc126.zip (59.0MB) - contains ZStack-CC2530-2.5.0.exe

    But if you don't want to buy the IAR compiler for 8051 and build your own ZNP, there are fully capable pre-built images in any installer of the ZAP (ZNP Application Processor):
    swrc173.zip (57.0MB) - contains ZStack-ZAP-MSP430-1.0.4.exe (the ZigBee Applications processor to be used with MSP430 product family).

    So the ZNP will be talking to your cool Java App on the PC in the exact same MT protocol (in the greater context, known as RPC - it is literally the remote procedure call API with which your Java app is remotely controlling the Z-Stack running on the CC2531). The CC2531USB will enumerated as a CDC class device and appear in device manager as a COM port - open it at 115200 no flow control. The difference is that ZNP gives your Java app total control - you can make the device a ZC, a ZR, or a ZED. You can setup to erase network config, re-configure it, reset it, and come up as something different!

     

     

     

  • Good suggestion re the CC2531 dongle. Is that the same dongle that's supplied with the CC2533 Basic RF4CE Development Kit (CC2533DK-RF4CE-BA)?

  • Yes, that is another way to get the CC2531USB dongle.