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.

Linux: Issue with TI 'z-stack linux gateway' on Linux desktop system (Ubuntu 16.04)

Other Parts Discussed in Thread: CC1352R, Z-STACK, CC2652R

Tool/software: Linux

Hi

I am trying out sample application 'Zigbee Coordinator Light Example App' , with CC1352R Launchpad, by referring the following guide:

https://sunmaysky.blogspot.com/2017/03/build-ti-z-stack-linux-home-gateway.html#comment-form_1992352146564777383

when i run zigbeeHAgw app, it fails to run and exits complaining that files (listed below) do not exist (missing) :

ZLSZNP_x86 
GATEWAY_SRVR_x86 
NWKMGR_SRVR_x86 
OTA_SRVR_x86

Please refer the following screenshot:


1. Download Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.run from www.ti.com/.../z-stack-archive.

2. Setup a 32 bit Ubuntu and run Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.run to extract Z-Stack Linux Gateway source code to your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src

3. Revise the build script package_builder_bbb (in red) under “your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src\Source\scripts\”

...
#Target platform:
    #export TARGET_PLATFORM="BEAGLEBONE_BLACK"
    export TARGET_PLATFORM="x86"
...
    cd $NPI_SOURCE/Projects/tools/LinuxHost
    make clean
    make create_output
    #make arch-all-armBeagleBone CC_armBeagleBone=$COMPILER |& tee -a $MAKE_LOG_FILE
    make $BUILD_TYPE |& tee -a $MAKE_LOG_FILE
...
# *** Copy resources ***********************************************************************************

#cp $NPI_SOURCE/Projects/tools/LinuxHost/out/NPI_lnx_armBeagleBone_server $BINARIES_SERVERS_DIR/NPI_lnx_${PLATFORM_SUBSTRING}_server
cp $NPI_SOURCE/Projects/tools/LinuxHost/out/NPI_lnx_${PLATFORM_SUBSTRING}_server $BINARIES_SERVERS_DIR/NPI_lnx_${PLATFORM_SUBSTRING}_server

4.a Install protobuf by doing the following two apt-get install

       sudo apt-get install protobuf-c-compiler
       sudo apt-get install protobuf-compiler

4.b Create a new folder "tools" and export TCLIB to it using the following lines:
  
       cd ~
       mkdir tools
       export TCLIB=~/tools/

5. Switch to your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src\Source\ and run ./build_all

6. The output will be at "your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src\Source\ERROR_out\z-stack_linux_gateway_x86_binaries.tar". The build error is due to the lack of comparison file but the output binaries still work on x86 environment.

7. Copy and untar “z-stack_linux_gateway_x86_binaries.tar” to your working directory on x86 (called ). Please follow the (Z-Stack Linux Gateway User Guide.pdf, Chap 6.3) to start the application. Please note you have to specify x86 when you run zigbeeHAgw like "sudo ./zigbeeHAgw x86"

8. If you run it successfully, you will see the results like the following screen shot.

after the 5th steps two files gets in the ERROR_out directory one is  “z-stack_linux_gateway_x86_binaries.tar”  file and another one is extracted "z-stack_linux_gateway_x86" which is blank. Is this in the flow?

Please advise how to resolve the issue.

  • Nishikant,

    I would recommend if you could please try using the latest Zigbee 3.0 Linux Gateway, which can be found here: www.ti.com/.../ZIGBEE-LINUX-SENSOR-TO-CLOUD

    Once this is downloaded you can follow the instructions from the document 'Z-Stack Linux Gateway User Guide.pdf' for using the local gateway sample application. Or if you want to setup the Zigbee Sensor-to-Cloud, then you can follow the document 'Zigbee Sensor to Cloud - User Guide.pdf'.

    Unfortunately the Zigbee Linux Gateway SLA is not yet published in our SimpleLink Academy, but should be out in the near future.

    Hopefully this should help you out more, as Zigbee 3.0 is used in our CC1352R/CC2652R devices.


    Best,
    Sean

  • Hello Sean,

    Tell me
    --> My path is correct ?
    --> Do i need to change any script regarding this??
    --> i am using 2X CC1352r with loaded example of door lock from given example in CCS.
    On the 7th step it say that "Copy and untar “z-stack_linux_gateway_x86_binaries.tar” to your working directory on x86 (called )"
    working directory means in "Home folder\Z-Stack_Linux_Gateway-1.0.1-src\" or in the same folder where it locate originally, i.e. in "..\ERROR_out\z-stack_linux_gateway_x86_binaries.tar”?


    Thank you

    Nishikant
  • Do you see those x86 binaries under your \Z-Stack_Linux_Gateway-1.0.1-src\Source\ERROR_out\z-stack_linux_gateway_x86_binaries\servers folder?
  • Hello  YK Chen

    This is what i got

  •  Can u check this ??

  • Try to run it with "sudo ./zigbeeHAgw x86" instead of "./zigbeeHAgw x86".
  • Hello YK Chen

    Regarding the above thing i followed all the necessary paths as you said.

    Now i am facing the problem is that only one binary file " NPI_lnx_x86_server" is formed remaining are still missing  under Precompiled_x86/server/

    Please resolve my issue or tell me any alternatives

    I am using cc1352r LP loaded with the sampleswitchrouter_ota.hex.

    Ubuntu16.04  32 bit on VMware Workstation.

  • I am not clear about your question. What's the issue when you run "sudo ./zigbeeHAgw x86" now?
  • Thanks for reply

    According to your steps when i made changes in package_builder_bbb and installs needful and run ./build all.
    A folder is created naming Precompiled_x86 under the Error out folder
    As you say copy and untar the binaries naming Precompiled_x86, i done it, but before doing this Precompiled_x86 this folder is already existed their but it is blank nothing inside it when we do it manually subfolders get appeared under server i get this config.ini, gateway_config.tlg, NPI_Gateway.cfg, NPI_lnx_x86_server, sample_app_ota.cfg, start_application, track_servers, zigbeeHAgw
    Remaining _x86 files are missing
  • After you build x86 binary successfully, you should get z-stack_linux_gateway_x86_binaries_.tar under /your z-stack source installation folder/Z-Stack_Linux_Gateway-1.0.1-src/Source/ERROR__out. Then, you can untar z-stack_linux_gateway_x86_binaries_.tar into your home folder such as /home/xxx/Z-Stack_Linux_Gateway-1.0.1-x86 and switch to /home/xxx/Z-Stack_Linux_Gateway-1.0.1-x86/servers to see those NPI_lnx_x86_server, GATEWAY_SRVR_x86, NWKMGR_SRVR_x86, OTA_SRVR_x86, and ZLSZNP_x86. You can run "sudo ./zigbeeHAgw x86" in the folder.

  • Hello Chen 

    Thanks for help

    please do more 

    i am still stuck in the problem that ./zigbeeHAgw x86 is running but i got this problems please solve 

    running zigbeegw.scr on an x86
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    deviceKey = 0 (0 )
    devPath = '/dev/ttyACM0'
    logPath = './NpiLnxLog.txt'
    connect: Connection refused
    ... freeing memory (ret -1)
    Could not open device... exiting
    NPI started (pid 2614) at Fri Dec 14 01:25:03 PST 2018
    connect: Connection refused
    [ZSTACKZNP_SRVR/MAIN] FATAL: appMain> Connection to NPI server failed. Exiting...
    ZLSZNP started (pid 2618) at Fri Dec 14 01:25:07 PST 2018
    [NWK_MGR/MAIN] : there are 2 args
    [NWK_MGR/MAIN] : argv[0] = ./NWKMGR_SRVR_x86
    [NWK_MGR/MAIN] : argv[1] = 127.0.0.1:2536
    connect: Connection refused
    [NWK_MGR/MAIN] : ************************************************
    [NWK_MGR/MAIN] : * Network Manager Server v1.0.1 *
    [NWK_MGR/MAIN] : * The following are the avaible key commands: *
    [NWK_MGR/MAIN] : * Exit Program. - q *
    [NWK_MGR/MAIN] : ************************************************

    [NWK_MGR/MAIN] : Error - No ZStack Server Detected. Exitting...
    NETWORK MANAGER started (pid 2622) at Fri Dec 14 01:25:08 PST 2018
    connect: Connection refused
    connect: Connection refused
    [GATEWAY/MAIN] : 
    [GATEWAY/MAIN] : ************************************************
    [GATEWAY/MAIN] : * Gateway Server v1.0.1 *
    [GATEWAY/MAIN] : * The following are the avaible key commands: *
    [GATEWAY/MAIN] : * Exit Program. - q *
    [GATEWAY/MAIN] : ************************************************

    [GATEWAY/MAIN] : Error - No ZStack Server Detected. Exiting...

    GATEWAY SERVER started (pid 2629) at Fri Dec 14 01:25:10 PST 2018
    connect: Connection refused
    connect: Connection refused
    [OTASRVR/MAIN] : 
    [OTASRVR/MAIN] : ************************************************
    [OTASRVR/MAIN] : * OTA Upgrade Server 1.0.1 *
    [OTASRVR/MAIN] : * The following are the avaible key commands: *
    [OTASRVR/MAIN] : * Exit Program. - q *
    [OTASRVR/MAIN] : ************************************************

    [OTASRVR/MAIN] : 
    Error - No ZStack Server Detected. Exiting...

    OTA SERVER started (pid 2633) at Fri Dec 14 01:25:12 PST 2018
    starting tracker with our pid ./zigbeeHAgw and pid list 2614 2618 2629 2633
    ===================================================
    NETWORK MANAGER exited with code 254 at Fri Dec 14 01:25:12 PST 2018
    ./zigbeeHAgw: line 482: 2641 Killed ./track_servers $$ "$pids"
    GATEWAY_SRVR_x86: no process found
    ^Ccaught SIGTERM, killing all the servers and cleaning up
    OTA_SRVR_x86: no process found
    ZLSZNP_x86: no process found
    NPI_lnx_x86_server: no process found
    terminating zigbeeHAGW (pid 2560)
    Killed

    please tell me the details procedure 

    do i need LP flashed with the SampleSwitchRouter_OTA.hex as it is provided in Z-stack../././sample app 

    or just need to connect flashed  LP with PC???

    I am a BEGINNER with this.

    Thank you 

  • Try to run “sudo ./zigbeeHAgw x86“
  • Nishikant,

    I suggest you take a read into the Z-Stack Linux Gateway User Guide.pdf. There's a step-by-step user guide on how to setup the environment, etc.

    Is there any reason behind why you are wanting to use the old gateway and not using the newest Zigbee 3.0 Linux Gateway that was recently released?

    Best,
    Sean
  • Hello Sean
    Thanks for reply
    Yes i read the related docs and found proper hex file of ZNP for CC1352R1 from zigbee linux gateway not from Z-stack
    and it is working.
    Still exploring the gateway if any problem occurs i'll definitely connect you on forum.

    Thanks for guidelines Sean.

  • Hello Chen
    Thanks for guiding

    Nishikant