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.

Add new device to beaglebone

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

Hi all,

I am new to beaglebnone and linux environment. I have installed z-stack on my beaglebone green and successfully run the application on it. Now i am trying to add new device to the gateway by enabling permit join but device is not getting added to it. The same end device is getting added to my custom zigbee coordinator and sending data. Do i need to use binding concept for adding devices. Any suggestion on how to learn like how it works. I have gone through the documents available after downloading the stack but not able to get much about the working.

2)Is it possible to use custom board with CC2530 as ZNP in stead of CC2531 dongle?

Regards

Kumar

  • 1. I would suggest you to use Ubiqua Packet Analyzer to check it.
    2. To use CC2530 ZNP, you can refer to sunmaysky.blogspot.tw/.../how-to-run-ti-z-stack-linux-home.html
  • Hi Yikai Chen,
    Thanks for your suggestion. right now i have only 1 cc2531 usb dongle which i am using in beaglebone. I will follow the steps and as given in the link to configure my CC2530 device act as ZNP and use CC2531 to sniff the over the air packet analysis.
    I want to know, for adding device, after starting the application only thing we need to do is press P button to enable permit join or anything else also required? Is there any step by step guide to learn about implementing z-stack in beaglebone like other documents provided by TI?
  • 1. The only step you need to do is to press P button to enable permit join.
    2. After you install Z-Stack Home Linux Gateway package on Ubuntu, you would find four documents, Z-Stack Linux Gateway - API document v1.1, Z-Stack Linux Gateway BeagleBone QuickStart Guide, Z-Stack Linux Gateway User Guide BeagleBone Addendum, and Z-Stack Linux Gateway User Guide.
  • Hi Yikai Chen,
    Adding "ENABLE_MT_SYS_RESET_SHUTDOWN" to compile options results in following error

    Error[Pe223]: function "MAC_RADIO_RXTX_OFF" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 2151
    Error[Pe223]: function "MAC_RADIO_FLUSH_RX_FIFO" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 2154
    Error[Pe223]: function "MAC_RADIO_CLEAR_RX_THRESHOLD_INTERRUPT_FLAG" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 2157
    Error[Pe223]: function "MAC_RADIO_TIMER_SLEEP" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 2160
    Error[Pe223]: function "MAC_RADIO_TURN_OFF_POWER" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 2163
    Error while running C/C++ Compiler

    Following is the definition of function in MT_SYS.c file related to the error

    #if defined( ENABLE_MT_SYS_RESET_SHUTDOWN )
    /******************************************************************************
    * @fn powerOffSoc
    *
    * @brief Put the device in lowest power mode infinitely
    *
    * @param None
    *
    * @return None
    *****************************************************************************/
    static void powerOffSoc(void)
    {
    HAL_DISABLE_INTERRUPTS();

    /* turn off the RF front end device */
    //TBD, based on the rf-front-end being used

    /* turn off the receiver */
    MAC_RADIO_RXTX_OFF();

    /* just in case a receive was about to start, flush the receive FIFO */
    MAC_RADIO_FLUSH_RX_FIFO();

    /* clear any receive interrupt that happened to squeak through */
    MAC_RADIO_CLEAR_RX_THRESHOLD_INTERRUPT_FLAG();

    /* put MAC timer to sleep */
    MAC_RADIO_TIMER_SLEEP();

    /* power of radio */
    MAC_RADIO_TURN_OFF_POWER();

    STIF = 0; //HAL_SLEEP_TIMER_CLEAR_INT;

    if (ZNP_CFG1_UART == znpCfg1)
    {
    HalUARTSuspend();
    }

    /* Prep CC2530 power mode */
    //HAL_SLEEP_PREP_POWER_MODE(3);
    SLEEPCMD &= ~PMODE; /* clear mode bits */
    SLEEPCMD |= 3; /* set mode bits to PM3 */
    while (!(STLOAD & LDRDY));

    while (1) //just in case we wake up for some unknown reason
    {
    /* Execution is supposed to halt at this instruction. Interrupts are
    disabled - the only way to exit this state is from hardware reset. */
    PCON = halSleepPconValue;
    asm("NOP");
    }
    }
    #endif

    All these functions are defined in "mac_radio_def.h". If i try to include this include file then later also i get some other error.
    Where do i need to include this header file?
  • You can add "#include "mac_radio_defs.h"" in MT_SYS.c to fix this error.
  • Already i had tried adding this header file before also but Adding "#include "mac_radio_defs.h"" in MT_SYS.c resulted in following error.
    Fatal Error[Pe1696]: cannot open source file "mac_radio_def.h" C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\MT_SYS.c 54
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\Source\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\Source\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\SE\Source\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\Utilities\BootLoad\Source\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\ZMain\TI2530ZNP\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\hal\include\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\hal\target\CC2530ZNP\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\mac\include\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\mac\high_level\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\mac\low_level\srf04\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\mac\low_level\srf04\single_chip\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\mt\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\osal\include\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\services\ecc\binary163\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\services\ecc\binary283\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\services\saddr\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\services\sdata\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\af\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\nwk\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\sapi\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\sec\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\sys\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\zcl\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\stack\zdo\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\zmac\"
    searched: "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\..\..\..\..\Components\zmac\f8w\"
    searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\8051\inc\"
    searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\8051\inc\clib\"
    Error while running C/C++ Compiler

    Then i tried to copy and paste the "mac_radio_defs.h" file in C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\mt\" and also
    "C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\" and other files but that resulted in multiple errors which i tried to solve a lot but error kept on occuring.

    If possible, can you please provide me the hex image file if you have? I will directly download the image using flash programmer.
  • I test to build CC2530 ProdHex ZNP with "#include "mac_radio_defs.h"" in MT_SYS.c and there's no build error. Do you build ProdHex config?
  • Ya I am building ProdHex config only.

  • There is typo in your code. It should be mac_radio_defs.h not "mac_radio_def.h
  • Extremely Sorry. It was typo.
    I was including #include "mac_radio_def.h" instead of #include "mac_radio_defs.h"
  • Is the build error fixed by revise the typo?

  • Hi Yikai Chen,
    Sorry for the late reply.
    Ya the error was fixed after revising the typo.
    Now i am able to read and write data using uart4. I was getting some error with firmware in network manager. I will tell about the error later after i test the same thing again. Now i have planned not to use gateway concept but use simple program to handle the network formation and data processing based on MT commands.
    Regards
    Kumar
  • OK, it's good to know the build error fixed.
  • Hi Yikai Chen,

    I am trying to test data transmission but device is not getting connected to the coordinator.

    Following parameters i have ensure while testing.

    1)Permit join is enabled for indefinite at coordinator.

    2)SECURE=1,TC_LINKKEY_JOIN and NV_RESTORE are defined both at ZC and ZED.

    What i observe that ZC joins with ZED and its sending data continuously. Later when i power reset ZED, zed doesn't connect to ZC and continuously it send beacon request which it should not be as i have enabled NV_RESTORE.

    Here i have included the sniffer log. Can you please tell why zed is not able to join to ZC? I have even tried factory resetting both ZC and ZED.

    sniff.rar

    Regards 

    Kumar

  • From the sniffer log, I only see your ZED sends beacon requests and ZC response with permit association. However, your ZED doesn't try to do association or rejoin. I suggest you connect CC Debugger and use IAR to trace why ZED doesn't try to do association or rejoin.
  • Hi Yikai Chen,
    Can you please tell the related function which i need to debug to check for device association problem?
    Regards
    Kumar
  • Try to set a breakpoint in the beginning of ZDApp_NwkDescListProcessing.
  • I had placed breakpoint in ZDApp_NwkDescListProcessing().
    pNwkDesc = nwk_getNwkDescList(); returns 'null' value. Hence 'ResultCount' is not incremented
    while (pNwkDesc)
    {
    ResultCount++;
    pNwkDesc = pNwkDesc->nextDesc;
    }

    and due to this

    if ( i == ResultCount )
    {
    nwk_desc_list_free();
    return (NULL); // couldn't find appropriate PAN to join !
    }
    gets executed. ZDApp_NwkDescListProcessing() is processed again and again.
  • Try to also set a breakpoint in ZDApp_ProcessNetworkJoin.
  • // Result of a Join attempt by this device.
    if ( nwkStatus == ZSuccess )
    returns MAC_NO_ACK(0xE9) and ZDApp_ProcessNetworkJoin() is called only once.
  • Does ZC turn on when you debug this?
  • Ya. ZC is in ON condition only.5658.abc.psd

  • 1)Is there any separate configuration required for configuring (CC2530+CC2591) as coordinator? What i observe is (CC2530+CC2591) is able to join with CC2530 module but two (CC2530+CC2591) modules with one configured as coordinator and other as end device is not associating.
    i want to test the range of communication in between two (CC2530+CC2591) modules but device is not able to connect.

    2)For industrial automation, range requirement will be more(may be 2-3 K.M) so will this combination be reliable? If not which wireless technology will be reliable?
  • 1. You can refer to www.ti.com/.../swra308a.pdf
    2. It's difficult to use Zigbee for transmitting 2-3km. If you have to transmit up to 2-3km, I would suggest you to use Sub GHz solution. You can refer to www.ti.com/.../overview.page
  • I had enabled HAL_PA_LNA in my ZED and now (CC2530+CC2591) modules are communicating.
    Thanks for your suggestions
  • You are welcome.
  • Hi Yikai Chen,
    Sometimes I continuously get "ZDO_MGMT_PERMIT_JOIN_RSP" FE 03 45 B6 00 00 00 F0. Why it comes and how to disable it.
    Regards
    Kumar
  • Where do you see this "ZDO_MGMT_PERMIT_JOIN_RSP"?
  • Through serial port. Checked In hyperterminal and CC2530 uart connected to beaglebone. This response arrives every1-2sec continuously which creates problem in problem in data processing in beaglebone. I am not making any request for permit join.

  • I never see this before. I suggest you trace your CC2530 ZNP to know why this "ZDO_MGMT_PERMIT_JOIN_RSP" is sent.
  • I am not getting that response always but if i get then i get continuously. Mostly it comes when zc is not connected to any zed. Next time if it comes i will debug it to find the actual cause.

    Another thing is zed is sending data but i am not getting AF_INCOMING_MSG response in hyperterminal. the function "zclSampleThermostat_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt ); " is not called when the data is sent from zed although it is captured by sniffer. Packet Number 5 and packet numbe r12. I want these incoming data to be transmitted through serial port so that i can process this data. Can you please tell where the packet would be received before so that i can debug it. Here is the sniffer log. 

    asd.psd

  • You can set a breakpoint at "afIncomingData()" in AF.c to debug it.
  • Thanks for your suggestion. I am able to get data in "afIncomingData()". Now i can modify the code to send the data through serial port.
  • You are welcome.
  • Hi Yikai Chen,

    Below i have included two images for different AF_INCOMING MESSAGE from the same ZED received in afIncomingData()" in AF.c

    Image 1 shows packet for active status of the device which is sent regularly by the end device but i am not able to get this data through serial port.

    Image 2 is door status report which i am able to get through serial port.

    What i conclude is the end point 0x15(image 1) is not registered in my coordinator. I want to receive the response for AF incoming message for image 1. what changes do i need to do for getting this response through serial port

    Can you please suggest me what do i need to do to send this data through serial port? Do i need to implement multiple end point for this?

    Regards

    Kumar

  • 1. You should use HA profile ID=0x0104 instead of 3849.
    2. Try to add cluster ID 4181 to your InCluster in device simple descriptor?
  • I had added 4181 into my IN cluster list but it doesn't send the data to serial port. I had tried to debug and found that afFindEndPointDesc( aff->DstEndPoint ) function returns 'null' and it exits the afIncomingData(). Do i need to register this endpoint?

  • I see you use 0x15 as dst/src endpoint to send message. Do you have endpoint 0x15 on device?
  • 0x15 endpoint is not available on my coordinator. i don't know about enddevice. Actually this is data from third party sensor and i don't know about their code. this data is used for knowing the active status of device.
  • If you don't use correct endpoint, you won't be able to receive message.
  • I am able to get data the sensor data everytime with 0x15 end point in afIncomingData() of my coordinator. Is there way to send this data to serial port by registering the 0x15 endpoint?
  • Which endpoint do you add clusterID 0x4181 to its simple descriptor?
  • I had implemented 4181 cluster on 0x0c endpoint which is the end point of my coordinator(i think it should be implemented on 0x15 endpoint). my coordinator is using single endpoint 0x0c. Can you please guide me a little what changes do i need to do in my thermostat code with coordinator coordinator configuration?
  • The easiest way is to change endpoint from 0x0c to 0x15.
  • if i change the endpoint to 0x15 then i will not get the actual sensor data which uses endpoint 0x0c.
  • Why? Shouldn't reporting destination and endpoint be according to binding?
  • the sensor uses indirect addressing and not binding and i don't know how sensor code is implemented. Whatever changes i want, i can do on my coordinator only.
  • Don't you do any binding to this device and it report to coordinator directly? Can you tell tell me which device you are testing?
  • I don't do binding. Coordinator is my own and using thermostat code. Sensor is from pilot labs and i don't have more information as i have got it from someone else.
  • I would say this pilot labs device does not follow normal Zigbee behavior. I can only suggest you to do binding to it and see if it can change report endpoint after binding.