Friday, June 23, 2017

Build TI Z-Stack Linux Home Gateway reference design to run on both Linux 16.04 AMD64 (64Bit) and x86 (32Bit).

1. Download from

2.a. If you use  Linux 16.04 x86 (32Bit), you can run to extract Z-Stack Linux Gateway source code to your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src

2.b. If you use  Linux 16.04 AMD64 (64Bit),you can refer to and have to run the following apt-get install command to install necessary packages before you run 32 bit script to unpack Z-Stack Linux Gateway source code to your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src.

 sudo apt-get install libc6:i386
 sudo apt-get install libx11-6:i386 libasound2:i386 libatk1.0-0:i386 libcairo2:i386 libcups2:i386 libdbus-glib-1-2:i386 libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libgtk-3-0:i386 libice6:i386 libncurses5:i386 libsm6:i386 liborbit2:i386 libudev1:i386 libusb-0.1-4:i386 libstdc++6:i386 libxt6:i386 libxtst6:i386 libgnomeui-0:i386 libusb-1.0-0-dev:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386

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="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

4.Download protobuf 2.5.0-9ubuntu1 source package from and build/install it with the following steps.
   4.a. Extra protobuf 2.5.0-9ubuntu1 to protobuf 2.5.0 folder and switch into protobuf 2.5.0 folder
   4.b. run "./configure"
   4.c. run "make"
   4.d. run "sudo make install"
   4.e. run "sudo ldconfig"

5.Download protobuf-c 0.15-1build1 source package from and build/install it with the following steps.
   5.a. Extra protobuf-c 0.15-1build1 to protobuf-c-0.15 folder and switch into protobuf-c-0.15 folder
   5.b. run "./configure"
   5.c. run "make"
   5.d. run "sudo make install"
   5.e. run "sudo ldconfig"

6. Create a new folder "tools" and export TCLIB to it using the following lines:

   cd ~
   mkdir tools
   export TCLIB=~/tools

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

8. 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.

9. Copy and untar “z-stack_linux_gateway_x86_binaries.tar” to your working directory on x86 (called ).

10. Disable flowcontrol in NPI_Gateway.cfg like the followings:

    speed=115200 ; speed
    flowcontrol=0 ; 1=enabled 0=disable

11. 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" in one terminal and run "./start_application" on another terminal.


  1. I am thankful for this blog to gave me much knowledge regarding my area of work. I also want to make some addition on this platform which must be in knowledge of people who really in need. Thanks. Mu Origin

  2. Thank you so much. But can it run on MIPS architect with given cross compiler and how to do that? I'm trying to run it on a MIPS architect.