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.

Z-Stack_Linux_Gateway 移植问题

Other Parts Discussed in Thread: Z-STACK, CC2530

您好,

我在mips平台上透过UART连接 TI CC2530, 从官网下载 Z-Stack_Linux_Gateway-1.0.1 然后移植到板子上运行会导致crash.

请问是移植过程中遗漏了哪些套件或是设定错误吗?

烦请提供建议, 谢谢!!

log 如下 : 


# ./zigbeeHAgw mips
running zigbeegw.scr on an mips
skipping zigbee reset
Starting the ZigBee gateway subsystem
deviceKey = 0  (0 )
devPath = '/dev/ttyS1'
logPath = '/tmp/NpiLnxLog.txt'
... freeing memory (ret 0)
Port: 2533
Following IP addresses are available:

NPI started (pid 1367) at Thu Jan  1 08:03:55 GMT 1970
connect: Connection refused
[ZSTACKZNP_SRVR/MAIN] ERROR: ERROR: signal 11 was trigerred:
[ZSTACKZNP_SRVR/MAIN] ERROR:   Fault address: (nil)
[ZSTACKZNP_SRVR/MAIN] ERROR:   Fault reason: address not mapped to object
[ZSTACKZNP_SRVR/MAIN] ERROR: Stack trace folows:
./ZLSZNP_mips(segmentation_fault_handler+0x540)[0x440f78]
[ZSTACKZNP_SRVR/MAIN] ERROR: Executing original handler...
ZLSZNP started (pid 1372) at Thu Jan  1 08:03:59 GMT 1970
[NWK_MGR/MAIN] :  there are 2 args
[NWK_MGR/MAIN] :  argv[0] = ./NWKMGR_SRVR_mips
[NWK_MGR/MAIN] :  argv[1] = 127.0.0.1:2536
connect: Connection refused
[NWK_MGR/MAIN] ERROR: ERROR: signal 11 was trigerred:
[NWK_MGR/MAIN] ERROR:   Fault address: (nil)
[NWK_MGR/MAIN] ERROR:   Fault reason: address not mapped to object
[NWK_MGR/MAIN] ERROR: Stack trace folows:
./NWKMGR_SRVR_mips(segmentation_fault_handler+0x540)[0x45a348]
[NWK_MGR/MAIN] ERROR: Executing original handler...
NETWORK MANAGER started (pid 1375) at Thu Jan  1 08:04:00 GMT 1970
connect: Connection refused
connect: Connection refused
[GATEWAY/MAIN] ERROR: ERROR: signal 11 was trigerred:
[GATEWAY/MAIN] ERROR:   Fault address: (nil)
[GATEWAY/MAIN] ERROR:   Fault reason: address not mapped to object
[GATEWAY/MAIN] ERROR: Stack trace folows:
./GATEWAY_SRVR_mips(segmentation_fault_handler+0x540)[0x46c268]
[GATEWAY/MAIN] ERROR: Executing original handler...
GATEWAY SERVER started (pid 1378) at Thu Jan  1 08:04:02 GMT 1970
connect: Connection refused
connect: Connection refused
[OTASRVR/MAIN] ERROR: ERROR: signal 11 was trigerred:
[OTASRVR/MAIN] ERROR:   Fault address: (nil)
[OTASRVR/MAIN] ERROR:   Fault reason: address not mapped to object
[OTASRVR/MAIN] ERROR: Stack trace folows:
./OTA_SRVR_mips[0x4229f8]
[OTASRVR/MAIN] ERROR: Executing original handler...
OTA SERVER started (pid 1381) at Thu Jan  1 08:04:04 GMT 1970
starting tracker with our pid ./zigbeeHAgw and pid list 1367 1372 1378 1381
===================================================
NETWORK MANAGER exited with code 139 at Thu Jan  1 08:04:04 GMT 1970
killall: GATEWAY_SRVR_mips: no process killed
killall: OTA_SRVR_mips: no process killed
killall: ZLSZNP_mips: no process killed
killall: NPI_lnx_mips_server: no process killed
unexpected exit code (139) from netmgr!
skipping zigbee reset

  • 您好,

          我修正了某些問題, 但運行之後還是會crash,  log 如下

          能否幫忙提供建議, 謝謝!

    # ./zigbeeHAgw mips
    running zigbeegw.scr on an mips
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    deviceKey = 0  (0 )
    devPath = '/dev/ttyS1'
    logPath = '/tmp/NpiLnxLog.txt'
    ... freeing memory (ret 0)
    Port: 2533
    Following IP addresses are available:

     IPv4: interface: lo     IP Address 127.0.0.1
     IPv4: interface: br0    IP Address 192.168.1.12
     IPv6: interface: lo     IP Address ::1
     IPv6: interface: eth0   IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: eth0.4         IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: eth0.5         IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: nas0   IP Address fe80::200:ff:fe01:2
     IPv6: interface: br0    IP Address fe80::1
     IPv6: interface: nas0_0         IP Address fe80::2e0:4cff:fe81:adc8
    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 #4...
    NPI started (pid 1518) at Thu Jan  1 08:05:00 GMT 1970
    Connected to #6.(127.0.0.1 / ::77c0:3000:0:0)
    ZLSZNP started (pid 1523) at Thu Jan  1 08:05:04 GMT 1970
    [NWK_MGR/MAIN] :  there are 2 args
    [NWK_MGR/MAIN] :  argv[0] = ./NWKMGR_SRVR_mips
    [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 1529) at Thu Jan  1 08:05:05 GMT 1970
    [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] :  ************************************************

    : Host name lookup failure.[main (299)] osgiManage Server is unreachable.
    GATEWAY SERVER started (pid 1535) at Thu Jan  1 08:05:07 GMT 1970
    [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: ERROR: signal 11 was trigerred:
    [NWK_MGR/MAIN] ERROR:   Fault address: (nil)
    [NWK_MGR/MAIN] ERROR:   Fault reason: address not mapped to object
    [NWK_MGR/MAIN] ERROR: Stack trace folows:
    ./NWKMGR_SRVR_mips(segmentation_fault_handler+0x540)[0x45a348]
    [NWK_MGR/MAIN] ERROR: Executing original handler...
    OTA SERVER started (pid 1543) at Thu Jan  1 08:05:09 GMT 1970
    [OTASRVR/MAIN] :
    Error - Could not register OTA endpoint with zstackserver.Exiting...

    starting tracker with our pid ./zigbeeHAgw and pid list 1518 1523 1535 1543
    ===================================================
    NETWORK MANAGER exited with code 139 at tracking 4 pids, 1518 1523 1535 1543
    when we see something missing we will send a SIGUSR2 to pid 1464
    Thu Jan  1 08:05:09 GMT 1970
    send: Connection reset by peer
    killall: OTA_SRVR_mips: no process killed
    unexpected exit code (139) from netmgr!

  • 移植上是有一些问题,我也尝试了很久,没有解决,刚开始是UART通讯异常,后来解决了UART,又是socket通讯异常,很多时候收不到netmgr发来的socket消息,而且这个gateway过于复杂,多个进程,超多线程等等,非常复杂,后来就放弃了,改用了znp-host-framework,在这个基础上新增了一些没有的功能,能实现组网,数据收发等等,后面再继续把OTA移植过去,就基本上没问题了。

    TI的这个linux gateway也很久没有再给更新过,目测应该是已经放弃了。

  • 其实TI的这个gateway实现了很多多余的功能,比如zcl的很多功能,他给在host上实现了。分析了gateway所有的源码,发现其实这样是多余的,既然最后都是通过UART收发消息的,无非就是打包解包,znp收到消息以后还是要在Mt.c里面调用各种ZDO、APP、NAC、AF的实现函数来处理。

    并没有减少多少znp端的SRAM的消耗,刚开始我还以为所有的路由表、邻居表等都给送到gateway来处理了,因为看到里面基本上实现了很多znp段的代码,后来才发现,其实并不是这样,也都是gateway端收到znp的消息,然后解包做对应的处理。

    另外,@VV 提到过,linux gateway并不适用最新的Z-Stack 3.0协议栈,想必很多地方都是要修改的,TI也没耐心在这上面了,毕竟zigbee的出货量也就那样了。

  • @hold li, 

    更正下,基于ZigBee 3.0的Linux Gateway方案目前已经处理研发和测试阶段,会在官网发布,请关注。谢谢!

  • Hi hold li, VV

        謝謝您的回覆, 修正了一些crash 問題, 但運行之後還是會發生Error. 請問是沒有End Device 連上的關係嗎?

    # ./zigbeeHAgw mips
    running zigbeegw.scr on an mips
    done processing arguments, board type mips, target mips
    NPI                 is 'NPI_lnx_mips_server'
    Zstack linux server is 'ZLSZNP_mips'
    gateway server      is 'GATEWAY_SRVR_mips'
    network manager     is 'NWKMGR_SRVR_mips'
    OTA server        is 'OTA_SRVR_mips'
    making sure there are no lingering servers...
    there are 0 NIP servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    making sure there are no lingering servers...
    there are 0 NIP servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    ===================================================
    starting NPI, cmd ' ./NPI_lnx_mips_server NPI_Gateway.cfg ' atThu Jan  1 08:02:04 GMT 1970
    will delay 4 secs before starting Zstack
    deviceKey = 0  (0 )
    devPath = '/dev/ttyS1'
    logPath = '/tmp/NpiLnxLog.txt'
    ... freeing memory (ret 0)
    Port: 2533
    Following IP addresses are available:

     IPv4: interface: lo     IP Address 127.0.0.1
     IPv4: interface: br0    IP Address 192.168.1.12
     IPv6: interface: lo     IP Address ::1
     IPv6: interface: eth0   IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: eth0.3         IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: eth0.5         IP Address fe80::2e0:4cff:fe81:adc3
     IPv6: interface: nas0   IP Address fe80::200:ff:fe01:2
     IPv6: interface: br0    IP Address fe80::1
     IPv6: interface: nas0_0         IP Address fe80::2e0:4cff:fe81:adc8
    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 #4...
    NPI started (pid 2282) at Thu Jan  1 08:02:08 GMT 1970
    ===================================================
    starting ZLSZNP, cmd ' ' atThu Jan  1 08:02:08 GMT 1970
    will delay 4 secs before starting GW
    Connected to #6.(127.0.0.1 / ::7766:4000:0:0)
    ZLSZNP started (pid 2336) at Thu Jan  1 08:02:12 GMT 1970
    ===================================================
    starting NETWORK_MGR, cmd './NWKMGR_SRVR_mips 127.0.0.1:2536 ' at Thu Jan  1 08:02:12 GMT 1970
    will delay 1 secs after starting netmgr
    [NWK_MGR/MAIN] :  there are 2 args
    [NWK_MGR/MAIN] :  argv[0] = ./NWKMGR_SRVR_mips
    [NWK_MGR/MAIN] :  argv[1] = 127.0.0.1:2536
    [startupInfo][860] getifaddrs ok
    [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: Endpoint Registration Failed
    [NWK_MGR/MAIN] : Initialization failed. Quitting now. mhoyt

    NETWORK MANAGER started (pid 2391) at Thu Jan  1 08:02:13 GMT 1970
    ===================================================
    starting GATEWAY_SERVER, cmd './GATEWAY_SRVR_mips 127.0.0.1:2536 127.0.0.1:2540 ' at Thu Jan  1 08:02:13 GMT 1970
    will delay 2 secs before starting netmgr
    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 Network Manager Server Detected. Exiting...

    GATEWAY SERVER started (pid 2402) at Thu Jan  1 08:02:15 GMT 1970
    ===================================================
    starting OTA_SERVER, cmd './OTA_SRVR_mips 127.0.0.1:2536 127.0.0.1:2540 ' at Thu Jan  1 08:02:15 GMT 1970
    will delay 2 secs after starting ota server
    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 Network Manager Server Detected. Exiting...

    OTA SERVER started (pid 2433) at Thu Jan  1 08:02:17 GMT 1970
    starting tracker with our pid ./zigbeeHAgw and pid list 2282 2336 2402 2433
    ===================================================
    waiting for netmgr to exit ( pid 2391 ) @tracking 4 pids, 2282 2336 2402 2433
    when we see something missing we will send a SIGUSR2 to pid 2183
    Thu Jan  1 08:02:17 GMT 1970
    NETWORK MANAGER exited with code 255 at Thu Jan  1 08:02:17 GMT 1970
    killall: GATEWAY_SRVR_mips: no process killed
    waiting for GATEWAY SERVER to exit
    killall: OTA_SRVR_mips: no process killed
    waiting for OTA SERVER to exit
    Removing connection #6
    waiting for Zstack linux to exit

    waiting for NPI to exit

  • 方案什么时候发布?遵循zigbee gateway 标准码?

  • 请问支持  zigebee3.0 的网关方案什么时候能出来呢 ?  和以前的开发模式差别大不大。

  • 请关注ti官网,开发差别几乎一致,唯一的不同就是关于BDB部分的功能。

  • 您好,,请问您先前的错误

    ERROR: signal 11 was trigerred

    是怎么修正的??我也出现了这个错误,不知怎么解决~

    谢谢!

  • 请问楼主的问题解决了吗?是什么原因呢。我也遇到了同样的问题,运行的时候报这个错误?请问怎么解决呢

    Synchronous Request Timeout...Receive message...
    NPI SREQ: (len 11) 0x08 0x21 0x09 0x84 0x00 0x00 0x04 0x00 0x08 0x00 0x00
    GATEWAY SERVER started (pid 21333) at Wed Jan 24 11:03:57 UTC 2018
    [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] DEBUG: Registering OTA end point 0xe, profile id 0x104 device id 0x0
    [OTASRVR/MAIN] DEBUG: Sending AF Register Request.
    OTA SERVER started (pid 21348) at Wed Jan 24 11:03:59 UTC 2018
    [OTASRVR/MAIN] DEBUG: apicSendSynchData_pRsp < 0
    [OTASRVR/MAIN] DEBUG: AF Register Request status 0x3
    [OTASRVR/MAIN] DEBUG: *** Error doing AF Register , return status 0x3
    [OTASRVR/MAIN] :
    Error - Could not register OTA endpoint with zstackserver.Exiting...