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.

Can i running the z-stack linux gateway in a normal x86 linux pc?

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

Hi,

i saw the z-stack linux only can running at the BBB board with arm precompiled binary files, my question is : is there a source codes can re-compile for who want try the gateway in x86 pc? not special in the arm cpu?

Thank you

  • You can try to contact TI local representative to see if you can sign SLA and get it.
  • Hi YiKai,

    I got Z-Stack Linux Gateway source from local TI. I changed the TARGET_PLATFORM to x86 in package_builder_bbb script, but encountered some errors (buildlog.txt). Are there any guideline document or prerequisite steps before building it? Thanks.

    buildlog.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    SVN Version =
    Main project\'s base directory: GATEWAY=/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source (leave blank to use the detault)
    NPI Project's base directory NPI_SOURCE=/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/
    Protobuf library directory: PROTOLIB=/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/protobuf-c-arm/lib
    Protobuf include directory: PROTOINC=/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source
    Project output subdirectory: PKGS_OUTPUT_DIR=/home/erison/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
    ********************************************************
    COMPILING SERVER FOR ARM BEAGLE BONE
    make[1]: Entering directory `/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/Projects/tools/LinuxHost'
    Compiling ipclib/server/npi_lnx_ipc.c ...
    gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
    ipclib/server/npi_lnx_ipc.c:1:0: error: bad value (armv7-a) for -march= switch
    /**************************************************************************************************
    ^
    ipclib/server/npi_lnx_ipc.c:1:0: error: bad value (cortex-a8) for -mtune= switch
    make[1]: *** [out/npi_lnx_ipc.o] Error 1
    make[1]: Leaving directory `/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/Projects/tools/LinuxHost'
    make: *** [arch-all-armBeagleBone] Error 2
    ********************************************************
    Cleaning all
    if test -d out; then rm -rf out; fi
    ********************************************************
    Check existance of output folder
    if test ! -d out; then mkdir out; fi
    ********************************************************
    COMPILING APP FOR x86
    make[1]: Entering directory `/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/Projects/zstack/linux/zstackserverznp'
    Compiling osal_zstack_server_znp.c ...
    Compiling ../source/zmain.c ...
    Compiling znp_af.c ...
    Compiling znp_misc.c ...
    Compiling znp_zdo.c ...
    Compiling ../zstackpb/zstack.pb-c.c ...
    In file included from ../zstackpb/zstack.pb-c.c:8:0:
    ../zstackpb/zstack.pb-c.h:6:42: fatal error: google/protobuf-c/protobuf-c.h: No such file or directory
    #include <google/protobuf-c/protobuf-c.h>
    ^
    compilation terminated.
    make[1]: *** [out/zstack.pb-c.o] Error 1
    make[1]: Leaving directory `/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/Projects/zstack/linux/zstackserverznp'
    make: *** [arch-all-x86] Error 2
    ********************************************************
    Cleaning all
    if test -d out; then rm -rf out; fi
    ********************************************************
    Check existance of output folder
    if test ! -d out; then mkdir out; fi
    ********************************************************
    COMPILING APP FOR x86
    make[1]: Entering directory `/home/erison/Z-Stack_Linux_Gateway-1.0.1-src/Source/Projects/zstack/linux/nwkmgr'
    Compiling ../srvepconfig/serverep.c ...
    In file included from ../srvepconfig/serverep.h:50:0,
    from ../srvepconfig/serverep.c:55:
    ../zstackpb/zstack.pb-c.h:6:42: fatal error: google/protobuf-c/protobuf-c.h: No such file or directory
    #include <google/protobuf-c/protobuf-c.h>
    ^
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Sorry, I don't have guideline document or prerequisite steps. Since you get the source code from local TI representative, you can ask them for guideline document or prerequisite steps.
  • Hi YiKai,

    I have built x86 binaries. But there are some error after I run the "./zigbeeHAgw x86". Do you know what's the possible root cause?

    running zigbeegw.scr on an x86
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    deviceKey = 0 (0 )
    devPath = '/dev/ttyACM0'
    logPath = './NpiLnxLog.txt'
    NPI started (pid 15105) at 五 6月 26 10:06:28 CST 2015
    ZLSZNP started (pid 15180) at 五 6月 26 10:06:32 CST 2015
    [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 15278) at 五 6月 26 10:06:33 CST 2015
    [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] : ************************************************

    [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

    GATEWAY SERVER started (pid 15294) at 五 6月 26 10:06:35 CST 2015
    [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 Network Manager Server Detected. Exiting...

    OTA SERVER started (pid 15321) at 五 6月 26 10:06:37 CST 2015
    starting tracker with our pid ./zigbeeHAgw and pid list 15105 15180 15294 15321
    ===================================================
    NETWORK MANAGER exited with code 255 at 五 6月 26 10:06:37 CST 2015
    unexpected exit code (255) from netmgr!
    skipping zigbee reset
    caught SIGTERM, killing all the servers and cleaning up
    terminating zigbeeHAGW (pid 15013)

  • Hi YiKai,

    I can run it on x86 successfully. I would like to buy light bulb or power outlet for testing. I heard that some light bulbs are not compatible with third party's gateways. Is there compatible devices list for z-stack linux gateway? Thanks.
  • TI Linux Home GW is based on Zigbee HA profile so all of Zigbee HA certified devices can be used by it. You can find Zigbee HA light bulbs in the following link.
    www.homedepot.com/.../205404345
  • I bought a Philips Hue bulb first since it's available in Taiwan now. But it doesn't appear in device list. Below is the packet sniffer log. Do you know how to make it work? Thanks.

    PhilipsHue.psd

  • I see a device with IEEE address 00:17:88:01:00:FB:2D:A8 sends association request and get response from coordinator with IEEE address 00:12:4B:00:02:F1:DC:40. Then, it stops there. Does your Philips Hue with IEEE address 00:17:88:01:00:FB:2D:A8? By the way, you can try to contact TI Taipei FAE to help you. The have good experiences in this.
  • Yes, that's Philips Hue's IEEE address. I restarted my linux pc and z-stack, then it can appear in device list now. It seems that z-stack is not reliable after I wake up my linux PC which has slept three days. By the way, I can adjust Level, Hue, Saturation successfully, but there are TIMEOUT message in log sometimes. Do you know the reason? Thanks.

  • I don't know why you have this timeout problem. Do you send on/off or change level command in short period? By the way, I would suggest you using Ubiqua Packet Analyzer to check over the air message. It will help you a lot to verify problem.
  • I tried to send command in long period, but it still displayed timeout message. However, the action is done successfully.
    Thanks for your suggestion, I will try to use Ubiqua Packet Analyzer later.
  • This sounds that the problem is on Linux Home GW. If you have sniffer log, you can attach it and I can have a look.
  • The followings are sniffer logs. Could you help check them? Thanks.

    6710.PhilipsHue_Timeout.psd

    PhilipsHue_Timeout.cubx.zip

  • I cannot decrypt the attached sniffer log. Please include your association into sniffer log and attach again.
  • I removed Philips Hue light bulb from device list and tried to let it join the network again, but it failed to appear in list even I restarted my linux PC. Could you help check below sniffer log first? Thanks.PhilipsHue_FailedJoinNetwork.psd

  • I see a device sends beacon request twice but no association happens.
  • I tried many ways and many times, but it still failed to appear in device list now. Is this related to factory reset of Philips Hue light bulb or it's GW issue? Do you have any suggestion about this issue?
  • How do you reset Philips hue?
  • Reset is by its bridge, right? But I only bought a light bulb. Is there any way to reset a single bulb? Is "Factory Reset" common or necessary in most ZigBee devices?

  • You can refer to Making ZLight2 Reset to Factory New without a button press at

    http://processors.wiki.ti.com/index.php/ZStack-Lighting-1.0.1_FAQ#How_can_I_use_the_ZStack-Lighting-1.0.1_Remote_to_reset_a_certified_ZLL_product_and_cause_it_to_leave_the_old_network

    . You have to do similar to Philip Hue. Yes, factory reset is common and necessary in most Zigbee devices.

  • I installed Z-Stack_Lighting_1_0_2 on my Windows PC and checked Z-Stack Lighting Sample Application Users Guide.pdf. I have only CC2531 usb dongle, can I run Remote sample application and send  zllInitiator_ResetToFNSelectedTarget command through CC2531? If yes, is there any document or wiki for this topic?

  • As I know, there is no document for this. However, you can contact TI Taiwan FAE. They know how to do this.
  • Before I contact TI Taiwan FAE, I found below wiki that is related to Z-Stack Lighting Kit and CC2531. Is this helpful for my issue?
    processors.wiki.ti.com/.../ZStack-Lighting_Kit_CC2531EMK
  • It doesn't help much to reset Philips Hue. I suggest you to contact TI Taiwan FAE.
  • Thanks for your suggestion. I got dedicated FW for CC2531 USB dongle and it can reset Philips Hue light bulb. I have some questions:
    1. Factory reset is common and necessary in most Zigbee devices. So most gateways need to support factory reset to devices?
    2. In different profiles(HA, ZLL...etc), factory reset action is the same?
    3. Can “Factory Reset” be done in Z-Stack Linux Gateway? If yes, is there any sample code, document or wiki for this?
  • You should implement factory reset on ZC, ZR, and ZED separately. Factory Reset just erase the NV flash on device. I am not familiar with Linux gateway but I think it is OK to do it on GW.
  • Is Factory Reset already defined in ZigBee spec? If ZED didn't implement factory reset, then we cannot reset it?
    TI Taiwan FAE said that factory reset is different in HA and ZLL. If gateway would like to support both HA and ZLL, then it needs to implement two kinds of factory reset?
  • 1. There is no factory reset defined in Zigbee spec.
    2. Yes, you cannot factory reset device if ZED doesn't implement it. That's why I say that most Zigbee devices would has a button pressed to do factory reset.
    3. HA and ZLL uses different Z-Stack so the reset is different.
  • Erison,

    Can you please post or share how you were able to compile and run on x86 machines. I encountered a lot of issues compiling, but after making minor tweaks to the Makefiles, recompiling protobuf-c-0.15 etc. I have successfully built the images (some warning were there, but I ignored them).

    When I try to run on ubuntu 14.04 32bit machine, I am encountering errors: see highlight below

    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: eth0     IP Address 192.168.1.130
     IPv6: interface: lo     IP Address ::1
     IPv6: interface: eth0     IP Address fe80::a00:27ff:fe03:8643
    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 3127) at Wed Aug  5 20:07:39 BST 2015
    Connected to #5.(127.0.0.1 / ::fd2f:5ab7:768b:408)
    ZLSZNP started (pid 3132) at Wed Aug  5 20:07:43 BST 2015
    [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 3138) at Wed Aug  5 20:07:44 BST 2015
    [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 3144) at Wed Aug  5 20:07:46 BST 2015
    [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 3152) at Wed Aug  5 20:07:48 BST 2015
    [OTASRVR/MAIN] :
    Error - Could not register OTA endpoint with zstackserver.Exiting...

    ...

  • The only way I could reset a philps hue bulb to factory default is using the philips living colors gen 3 remote.
  • Do you sign SLA with TI and get full source code of Linux GW?
  • Hi Venkateswar,

    I also encountered the errors sometimes. I just restart my linux pc, pull and plug the dongle again, then I can start those servers successfully. I think this might be Linux GW issue.

  • TI local FAE provided me with a firmware that can reset philips hue bulb.
  • I will try this for sure... thanks
  • how was you contact with TI local representative. ?? i also want Z-stack GW source code for Raspi.
  • I call TI local office for support.
  • sorry YiKai CHen i am confused. thats why i asked. now i got it.
    thank you. :-)
  • You are welcome and nothing you need to say sorry.

  • i have successfully done the setup of beaglebone+cc2531 (using linux gateway) as coordinator and cc3530dk as ZED.
    1. now i want to upload my end device status (data) on cloud. so what should i do first??
    in my ZED i build the sample temperature code from "C:\TI\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleTemperatureSensor\CC2530DB"

    2. how can i access the CC2531dk ZED from cloud ?? i have connected my beaglebone to internet.
  • HI Erison,

    Please can you share the code, of zstack. I downloaded from the TI site. But lib code is precompiled [Z-Stack_Linux_Gateway-1.0.1/Source/protobuf-c-arm/lib]]. Lib Code is not present.

    We are planning to compile the zstack code x86 machine. It would be helpful if you can share or guide.

    Regards,
    Amit.
  • Hi Amit,

    You need to contact with local TI to sign agreement to get the source code.

    Regards,

    Erison

  • Hi Erison,

    After compiling the zstack for x86 platform, where excatly your zsatck is running. Is in running on x86 linux machine or some board like beaglebone.??

    I want to know the use case after compiling the x86 for linux machine, and the list of devices/dongles which you are using to control your HA framework.

    I am trying to setup zigbee network, but getting the complete picture about the devices and hardware required.

    Regards,
    Amit
  • Hi Amit,

    After compiling the zstack for x86 platform, Z-Stack is running on x86 linux machine. My CC2531 dongle is connected to a Ubuntu PC. By Z-Stack gateway application, I can control Philips Hue light bulb, smart plug and get notification from PIR sensor. I also bought CC debugger for flash firmware into CC2531.

    Regards,

    Erison

  • hii Amit,
    Give me your email id, i can forward you files. ok
  • Hi Shyam,


    Please my mail Id.

    amitranjan.singh@lnttechservices.com

    ranjan.amit1984@gmail.com

    Thanks for the support.

  • Thank Erison for the detailed description.

    So your CC2531 dongle is connected to same machine, where your Z-Stack is running. Or they are running on Different PC ??

    Regards,
    Amit
  • Z-Stack application runs on Linux and Z-Stack ZNP runs on CC2531 USB dongle.
  • could you send me the source yy-fly@163.com , I want to build the x86 version.
1 2