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/CC2531EMK: Z-Stack Linux GW reference design build failure on Ubuntu 16.04 LTS x86!

Part Number: CC2531EMK
Other Parts Discussed in Thread: Z-STACK, CC2531

Tool/software: Linux

I used to run Ubuntu 14.04.5 LTS 32 bit to build Z-Stack Linux GW on x86 and it worked. Recently, I move to use Ubuntu 16.04 LTS and get build error as attached. I suspect it's about version of protobuf but I can't solve the issue. Can you help me on fixing this issue?

build_err.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
yk@yk-VirtualBox:~/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1rc/Source$ ./build_all
./package_builder_bbb: line 24: svnversion: command not found
SVN Version =
Main project\'s base directory: GATEWAY=/home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1-src/Source (leave blank to use the detault)
NPI Project's base directory NPI_SOURCE=/home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1-src/Source/
Protobuf library directory: PROTOLIB=/home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1-src/Source/protobuf-c-arm/lib
Protobuf include directory: PROTOINC=/home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1-src/Source
Project output subdirectory: PKGS_OUTPUT_DIR=/home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Z-Stack_Linux_Gateway-1.0.1-src/Source/out (leave blank to use the detault)
Building RUNTIME package for x86 platform
********************************************************
Cleaning all
if test -d out; then rm -rf out; fi
rm -f project_file_list.txt
********************************************************
Check existance of output folder
if test ! -d out; then mkdir out; fi
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi YK,

    We will take a look into this issue.
  • Thanks and look forward to having solution from you.
  • Do you have any update?
  • Hi,

    Can you try to compile a clean setup directly on the Beglebone board? I see several compilation errors in this log but maybe is just that the current setup has something that is not configured properly.

    Regards,

  • I can build GW on BBB without problem. My problem happens when I try to build it on Ubuntu 16.04 LTS 32 bit or 64 bit.

  • Hi YK,

    Did you try to execute the .run file from the TI webpage?, If you didn't, could you try that?.

    Can you provide more information about your setup and what you did in order to get the current result.

    Regards,

    Jose Maria
  • I did the steps in sunmaysky.blogspot.tw/.../build-ti-z-stack-linux-home-gateway.html on Ubuntu 16.04 and get those compile error. It works on Ubuntu 14.04.
  • Hello YK, I followed the steps from the link you provided and it works fine for me. From the log you provided (build_err.txt) the lines where the first problem is found do not match the lines on the source code. Could you try removing all the files from the source code and uninstalling / reinstalling the Z-Stack_LinuxGateway-1_0_1-src-linux-installer.run again.
  • I have tried to install it many time in different Ubuntu 16.04 VM and I see the same issue on both 32 and 64 bit Ubuntu 16.04. Which Ubuntu version do you use?
  • I downloaded the ubuntu-16.04.2-desktop-i386 (32-bit) desktop image from http://releases.ubuntu.com/16.04/ 

  • I installed that image on a Virtual Box VM. The Host is a PC running Windows 10 64-bit (x64 based processor). With the blank installation I followed this guides: "marksolters.com/programming/2016/06/22/arm-toolchain-16-04.html", "askubuntu.com/questions/314803/command-not-found-when-running-svn", "linux-sunxi.org/Toolchain#Linaro_toolchain". But had no luck trying to compile the project. I followed the guide from the link you provided ("sunmaysky.blogspot.tw/.../build-ti-z-stack-linux-home-gateway.html") and it worked perfectly.
  • What I want is to build a Z-Stack Linux GW binary that can run on Ubuntu 16.04 64/32 bit x86. I don't mean to build a binary for ARM and it seems that you are try to build binary for ARM on a Ubuntu 16.04.
  • Ok, I think I misunderstood. I thought you were just trying to build the project on the Ubuntu machine. You actually want to run the zigbeehagw and the user interface app from Ubuntu. I'll look further into it.
  • Yes, that's what I mean form beginning.
  • Hi, I was able to find a solution. I tried this on a blank ubuntu 16.04.2 LTS virtual machine. I followed the tutorial that you provided up to step number 4.a (sunmaysky.blogspot.mx/.../build-ti-z-stack-linux-home-gateway.html. But instead of using the sudo apt-get install protobuf-c-compiler and sudo apt-get install protobuf-compiler you need to use an specific version. I downloaded this ones launchpad.net/.../0.15-1build1
    launchpad.net/.../2.5.0-9ubuntu1 which correspond to the ones downloaded for the ubuntu 14.04 LTS. After downloading you need to install the protobuf-compiler before the protobuf-c-compiler.
    1.First you extract the contents of the folder. Then you need to navigate to the new extracted folder.
    2.Once inside you run './configure', and wait until it finishes.
    3. Then you use 'make' and wait until it finishes and then 'sudo make install'.
    4. Then you need to use 'sudo ldconfig'.
    You need to repeat this steps again for the protobuf-c-compiler. After that you can proceed with step 4.b on the tutorial previously mentioned and complete it.

    So basically install the protobuf-compiler version 2.5.0-9build1 and protobuf-c-compiler 0.15-1build1 and you'll be able to both compile and execute from x86 ubuntu 16.04.2 LTS.
  • When I tried to build protobuf-c-0.15, it pops the following errors:

    make[2]: Leaving directory '/home/yk/protobuf-c-0.15/src'
    Making all in test
    make[2]: Entering directory '/home/yk/protobuf-c-0.15/src/test'
    mkdir -p generated-code
    ../protoc-c -I. --c_out=generated-code ./test.proto
    ../protoc-c: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory
    Makefile:712: recipe for target 'generated-code/test.pb-c.c' failed
    make[2]: *** [generated-code/test.pb-c.c] Error 127
    make[2]: Leaving directory '/home/yk/protobuf-c-0.15/src/test'
    Makefile:725: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/home/yk/protobuf-c-0.15/src'
    Makefile:280: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1

    Any idea?

  • Sorry, I miss the step "sudo ldconfig" and after doing it, the errors are gone.
  • I can build successfully now but when I run "./zigbeeHAgw x86", it shows "connect: Connection refused"... like the followings:

    yk@yk-VirtualBox:~/z-stack_linux_gateway_x86_binaries/servers$ ./zigbeeHAgw x86
    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 13981) at 公曆 20十七年 六月 廿日 週二 十一時卅分二秒
    connect: Connection refused
    [ZSTACKZNP_SRVR/MAIN] FATAL: appMain> Connection to NPI server failed. Exiting...
    ZLSZNP started (pid 13985) at 公曆 20十七年 六月 廿日 週二 十一時卅分六秒
    [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...

    I am sure I download CC2531-GW-ZNP_38724.hex to my CC2531USB dongle and see it is emulated as ttyACM0 when I do "ls /dev" . Do you have idea about what's going wrong?
  • After I run "sudo ./zigbeeHAgw x86", I get rid of "connect: Connection refused" problem. But I get the following error:

    [NWK_MGR/MAIN] ERROR: Endpoint Registration Failed
    [NWK_MGR/MAIN] ERROR: Registering ZDO Callbacks Failed
    [NWK_MGR/MAIN] ERROR: Reading Local Network Information Failed
    [NWK_MGR/MAIN] : Initialization failed. Quitting now. mhoyt

    The followings are my running log. Do you know how to solve this?

    yk@yk-VirtualBox:~/z-stack_linux_gateway_x86_binaries/servers$ sudo ./zigbeeHAgw x86
    running zigbeegw.scr on an x86
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    deviceKey = 0 (0 )
    devPath = '/dev/ttyACM0'
    logPath = './NpiLnxLog.txt'
    ... freeing memory (ret 0)
    Port: 2533
    Following IP addresses are available:

    IPv4: interface: lo IP Address 127.0.0.1
    IPv4: interface: enp0s3 IP Address 10.0.2.15
    IPv6: interface: lo IP Address ::1
    IPv6: interface: enp0s3 IP Address fe80::642e:c062:bfd8:b212
    The socket will listen on the following IP addresses:

    IPv4: 0.0.0.0
    IPv6: ::
    0.0.0.0 means it will listen to all available IP address

    waiting for first connection on #3...
    NPI started (pid 14344) at 公曆 20十七年 六月 廿日 週二 十一時39分五秒
    Connected to #5.(127.0.0.1 / ::)
    ZLSZNP started (pid 14349) at 公曆 20十七年 六月 廿日 週二 十一時39分九秒
    [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
    [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] : ************************************************

    NETWORK MANAGER started (pid 14355) at 公曆 20十七年 六月 廿日 週二 十一時39分十秒
    [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 SERVER started (pid 14361) at 公曆 20十七年 六月 廿日 週二 十一時39分十二秒
    [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] : ************************************************

    [NWK_MGR/MAIN] ERROR: Endpoint Registration Failed
    [NWK_MGR/MAIN] ERROR: Registering ZDO Callbacks Failed
    [NWK_MGR/MAIN] ERROR: Reading Local Network Information Failed
    [NWK_MGR/MAIN] : Initialization failed. Quitting now. mhoyt

    OTA SERVER started (pid 14369) at 公曆 20十七年 六月 廿日 週二 十一時39分十四秒
    [OTASRVR/MAIN] :
    Error - Could not register OTA endpoint with zstackserver.Exiting...

    starting tracker with our pid ./zigbeeHAgw and pid list 14344 14349 14361 14369
    ===================================================
    NETWORK MANAGER exited with code 255 at 公曆 20十七年 六月 廿日 週二 十一時39分十四秒
    ./zigbeeHAgw: line 482: 14381 Killed ./track_servers $$ "$pids"
    send: Connection reset by peer
    OTA_SRVR_x86: no process found
    unexpected exit code (255) from netmgr!
  • I was able to find the same problem as you did. I fixed it by rebuilding the project and extracting it again.
  • If you can, try deleteing the whole folder for the z-stack_linux_gateway_x86_binaries and using the tar command to extract..

  • How do you rebuild the project to fix this issue? I build Z-Stack Linux GW on both Ubuntu 16.04 32 and 64 bit. Both of them have the same errors.
  • As context: I turned on the Ubuntu machine the following day. I connected the CC2531 dongle. I launched the application running 'sudo ./zigbeehagw x86'. That's when I noticed the error you're asking about. I tried re-programming the CC2531 dongle, and had no success. I decided to run the ./build_all script to rebuild the project. Then I deleted the existing folder with the binaries from the previous build I made, and extracted the contents of Error_out to a folder called z-stack_linux_gateway_x86_binaries_ on my Source folder. I launched the application again using the sudo ./zigbeehagw x86, and it worked.

    I'm using Ubuntu 16.04.2 - 32bit LTS image for i386 Desktop.

  • I try to run "./build_all" again on Ubuntu 16.04 64 bits and still see the same errors. Can you test this again?
  • Did you try to run on a 32bit system too?
  • I see the same problem on 32 bit system. I am setting up a new 32 bits VM and testing again now. Can you also check 64 bit version?
  • At the moment we don't have the hardware to use a 64bit system. On the 32bit version you should be able to both compile and execute the application.
  • I redo build_all on Ubuntu 16.04 32 bit 3 times and it still doesn't work. What do you mean "don't have the hardware to use a 64bit system?"
  • I fix the issue by disable flowcontrol in NPI_Gateway.cfg and it works now. I have summarized the steps in sunmaysky.blogspot.tw/.../build-ti-z-stack-linux-home-gateway.html