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: Linux gateway on RPi3 model B

Other Parts Discussed in Thread: LAUNCHXL-CC26X2R1, Z-STACK

Tool/software: Linux

Relating this thread:

I kindly ask what is the OS used into the RPI3 model B (stretch?).

Thank!

  • It is no problem to use stretch.

  • Hi,

    I've succesfully did the installation in a RPi3 model B+ with stretch OS.

    I've only a doubt, concerning the ZNP I'm using the LAUNCHXL-CC26X2R1 board and I'm flashed it with file:

    C:\ti\Zigbee_3_0_Linux_Gateway_1_0_1\Firmware\znp\CC2652R1LP_GW_ZNP_UART.hex

    After connecting the board to my RPi on a free USB, the dmesg command show that:

    [ 8977.984652] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
    [ 8978.115657] usb 1-1.3: New USB device found, idVendor=0451, idProduct=bef3, bcdDevice= 1.00
    [ 8978.115672] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 8978.115682] usb 1-1.3: Product: XDS110 (02.03.00.18) Embed with CMSIS-DAP
    [ 8978.115691] usb 1-1.3: Manufacturer: Texas Instruments
    [ 8978.115700] usb 1-1.3: SerialNumber: L110088V
    [ 8978.134097] hid-generic 0003:0451:BEF3.0003: hiddev96,hidraw2: USB HID v1.11 Device [Texas Instruments XDS110 (02.03.00.18) Embed with CMSIS-DAP] on usb-3f980000.usb-1.3/input5
    [ 8978.297614] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
    [ 8978.300375] cdc_acm 1-1.3:1.3: ttyACM1: USB ACM device
    [ 8978.301053] usbcore: registered new interface driver cdc_acm
    

    so I've two new USB VCP with name ttyACM0 and ttyACM1 so I think to avoid to change the reference into the configuration file to ttyUSB0 I'm right?

    Could you please drive me to the installed configuration file in order to perform the necessary change/restore?

    About the NZP I don't think that this is woorking properly because into the web page I can not see the channel and PAN information...

    root@raspberrypi:/home/source/Projects/node# sudo ./start_gateway.sh
    
    Start the Linux Zigbee Gateway
    
    root@raspberrypi:/home/source/Projects/node# Platform type selected automatically as bbb.
    To override this selection, please stop this script, and then run it again,
    specifying the desired platform type at the command line:
      ./zigbeeHAgw [help | bbb | x86 ]
    
    running ./zigbeeHAgw on an ARM
    file ZLSZNP_arm  is missing
    file GATEWAY_SRVR_arm  is missing
    file NWKMGR_SRVR_arm  is missing
    file OTA_SRVR_arm  is missing
    there are 4 missing files!
    exiting ./zigbeeHAgw
    

    Thank!

  • As you can see in your logs like the followings, it seems you don't setup GW correctly.

    file ZLSZNP_arm  is missing
    file GATEWAY_SRVR_arm  is missing
    file NWKMGR_SRVR_arm  is missing
    file OTA_SRVR_arm  is missing
    there are 4 missing files!

    I suggest you to follow the steps exactly in section "5.2 Installation and Setup" of "Zigbee Sensor to Cloud - User Guide.pdf" to test again.

  • Hi,

    yes, these file are missing, but the steps that I've followed is exactly the same as reported into the forum and the user manual.

    I've found these files into the out folder of the original /source installation (on my Win10 PC), I think that this file was deleted after comiling the source into the RPi then may be the original /out folders (where this file reside) was deleted and then rebuilded by the make process so these files are not be present now.

    So the next step may be discover what should be the right place where I've to copy these files...

    To discover where thse files should be I've opened the /source/Projects/node folder and then the file start_local.sh, inside we have:

    cd ../../ERROR__out/Precompiled/servers/ || cd ../../out/Precompiled/servers/
    echo -e "\nStarting the Linux Zigbee Gateway\n"
    ./zigbeeHAgw &

    so I've opened the folder /home/source/ERROR__out/Precompiled/servers and then here the file was missing so from the original (in my Win10 installation) I've found and copied into the /home/source/ERROR__out/Precompiled/servers folder these files and all start to work.

    Inside the folder /home/source/ERROR__out there are also two files:

    expected_content.txt

    content.txt

    comparing these one give me the above mentioned file difference plus another one:

    ./Precompiled/app/main.bin

    fond into the original installation folder at the following path C:\ti\Zigbee_3_0_Linux_Gateway_1_0_1\source\Projects\zstack\linux\demo\project so I've copied also this file into the RPi ./Precompiled/app folder.

    HoweverI think that there is other trouble please take a loog at the output log:

    root@raspberrypi:/home/source/Projects/node# sudo ./start_local.sh
    
    Starting the Linux Zigbee Gateway
    
    Platform type selected automatically as bbb.
    To override this selection, please stop this script, and then run it again,
    specifying the desired platform type at the command line:
      ./zigbeeHAgw [help | bbb | x86 ]
    
    running ./zigbeeHAgw on an ARM
    done processing arguments, board type bbb, target arm
    NPI                 is 'NPI_lnx_arm_server'
    Zstack linux server is 'ZLSZNP_arm'
    gateway server      is 'GATEWAY_SRVR_arm'
    network manager     is 'NWKMGR_SRVR_arm'
    OTA server        is 'OTA_SRVR_arm'
    Starting the ZigBee gateway subsystem
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    Executing reset from external scripts
    ===================================================
    starting NPI, cmd ' ./NPI_lnx_arm_server NPI_Gateway.cfg -v 0x0000010E ' on Thu 4 Jul 09:42:19 CEST 2019
    [09:42:19.955,454] [NPISRVR/MAIN] UNMSKBL:
    [09:42:19.955,857] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:19.955,889] [NPISRVR/MAIN] UNMSKBL:  *  NPI Server v1.0.2d                          *
    [09:42:19.955,915] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:19.955,941] [NPISRVR/MAIN] UNMSKBL:
    [09:42:19.957,946] [NPISRVR/MAIN] ERROR  : Could not initialize SoC... exiting
    Startup phase 1 failed
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    Executing reset from external scripts
    ===================================================
    starting NPI, cmd ' ./NPI_lnx_arm_server NPI_Gateway.cfg -v 0x0000010E ' on Thu 4 Jul 09:42:24 CEST 2019
    [09:42:24.165,533] [NPISRVR/MAIN] UNMSKBL:
    [09:42:24.165,926] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:24.165,959] [NPISRVR/MAIN] UNMSKBL:  *  NPI Server v1.0.2d                          *
    [09:42:24.165,987] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:24.166,011] [NPISRVR/MAIN] UNMSKBL:
    [09:42:24.167,994] [NPISRVR/MAIN] ERROR  : Could not initialize SoC... exiting
    Startup phase 1 failed
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    Executing reset from external scripts
    
    Wait for Node.js Zigbee IBM Gateway to Start...
    
    root@raspberrypi:/home/source/Projects/node# ===================================================
    starting NPI, cmd ' ./NPI_lnx_arm_server NPI_Gateway.cfg -v 0x0000010E ' on Thu 4 Jul 09:42:28 CEST 2019
    [09:42:28.380,544] [NPISRVR/MAIN] UNMSKBL:
    [09:42:28.380,804] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:28.380,830] [NPISRVR/MAIN] UNMSKBL:  *  NPI Server v1.0.2d                          *
    [09:42:28.380,842] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:28.380,854] [NPISRVR/MAIN] UNMSKBL:
    [09:42:28.382,101] [NPISRVR/MAIN] ERROR  : Could not initialize SoC... exiting
    Startup phase 1 failed
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    Executing reset from external scripts
    nwkmgr: getGwInfoReq
    sendMessage: no responseHndl
    sendMessage: no responseHndl
    webserver: Server running on http://192.168.2.230:5000
    Error:  connect ECONNREFUSED 127.0.0.1:2540
    Error:  connect ECONNREFUSED 127.0.0.1:2541
    ===================================================
    starting NPI, cmd ' ./NPI_lnx_arm_server NPI_Gateway.cfg -v 0x0000010E ' on Thu 4 Jul 09:42:32 CEST 2019
    [09:42:32.547,321] [NPISRVR/MAIN] UNMSKBL:
    [09:42:32.547,544] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:32.547,559] [NPISRVR/MAIN] UNMSKBL:  *  NPI Server v1.0.2d                          *
    [09:42:32.547,571] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [09:42:32.547,583] [NPISRVR/MAIN] UNMSKBL:
    [09:42:32.548,757] [NPISRVR/MAIN] ERROR  : Could not initialize SoC... exiting
    Startup phase 1 failed
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    caught SIGTERM, killing all the servers and cleaning up
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    terminating zigbeeHAGW (pid 9436)
    

    what sound starnge to me is the message " Could not initialize SoC... exiting" and then the:

    Error:  connect ECONNREFUSED 127.0.0.1:2540
    Error:  connect ECONNREFUSED 127.0.0.1:2541

    Thank

  • Ok I've did a little step, the ZNP now is working properly, I've to change the serial port ttyACM0 directly inside the configuration file that is into the folder:

    /home/source/ERROR__out/Precompiled/servers

    so for my RPI3B+ stretch the correct port is ttyACM0 and not ttyUSB0 as shown into the forum (may be the installation was not for stretch?).

    Then the log now is the following:

    root@raspberrypi:/home/source/Projects/node# sudo ./start_local.sh
    
    Starting the Linux Zigbee Gateway
    
    Platform type selected automatically as bbb.
    To override this selection, please stop this script, and then run it again,
    specifying the desired platform type at the command line:
      ./zigbeeHAgw [help | bbb | x86 ]
    
    running ./zigbeeHAgw on an ARM
    done processing arguments, board type bbb, target arm
    NPI                 is 'NPI_lnx_arm_server'
    Zstack linux server is 'ZLSZNP_arm'
    gateway server      is 'GATEWAY_SRVR_arm'
    network manager     is 'NWKMGR_SRVR_arm'
    OTA server        is 'OTA_SRVR_arm'
    Starting the ZigBee gateway subsystem
    making sure there are no lingering servers...
    there are 0 NPI servers
    there are 0 ZLS servers
    there are 0 GATEWAY servers
    there are 0 NWKMGR servers
    there are 0 OTA servers
    (total 0)
    done
    Executing reset from external scripts
    ===================================================
    starting NPI, cmd ' ./NPI_lnx_arm_server NPI_Gateway.cfg -v 0x0000010E ' on Thu 4 Jul 10:09:46 CEST 2019
    [10:09:46.937,114] [NPISRVR/MAIN] UNMSKBL:
    [10:09:46.937,560] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [10:09:46.937,593] [NPISRVR/MAIN] UNMSKBL:  *  NPI Server v1.0.2d                          *
    [10:09:46.937,620] [NPISRVR/MAIN] UNMSKBL:  ************************************************
    [10:09:46.937,645] [NPISRVR/MAIN] UNMSKBL:
    Startup phase 1 completed successfully, server started (NPI_PID=10210) on Thu 4 Jul 10:09:46 CEST 2019
    ===================================================
    starting ZLSZNP, cmd ' ./ZLSZNP_arm 127.0.0.1:2533 config.ini -v 0x0000460E ' on Thu 4 Jul 10:09:46 CEST 2019
    ./ZLSZNP_arm: error while loading shared libraries: libprotobuf-c.so.0: cannot open shared object file: No such file or directory
    Startup phase 2 failed
    
    

    Inside the /usr/lib the lib file is till present:

    To be sure about library path the file /etc/ld.so.conf.d/libc.conf was edited as below (added the /usr/lib path):

    # libc default configuration
    /usr/local/lib
    /usr/lib

    may be this issue related the release version of the libprotobuf-c.so.0 that in my version is instead libprotobuf-c.so.1 ?

    Actually the protobuf-c-compiler installed release was the following one:

    root@raspberrypi:/home/source/Projects/node# dpkg -s protobuf-c-compiler
    Package: protobuf-c-compiler
    Status: install ok installed
    Priority: optional
    Section: devel
    Installed-Size: 189
    Maintainer: Robert Edmonds <edmonds@debian.org>
    Architecture: armhf
    Multi-Arch: foreign
    Source: protobuf-c
    Version: 1.2.1-2
    Depends: libc6 (>= 2.4), libgcc1 (>= 1:3.5), libprotobuf10, libprotoc10, libstdc++6 (>= 5.2)
    Description: Protocol Buffers C compiler (protobuf-c)
     Protocol Buffers are a flexible, efficient, automated mechanism for
     serializing structured data - similar to XML, but smaller, faster, and
     simpler. You define how you want your data to be structured once, then you can
     use special generated source code to easily write and read your structured
     data to and from a variety of data streams and using a variety of languages.
     You can even update your data structure without breaking deployed programs
     that are compiled against the "old" format.
     .
     This is the "protobuf-c" implementation of Protocol Buffers in C.
     .
     This package contains the "protoc-c" code generator that creates C stubs from
     Protocol Buffers .proto files. These stubs must be compiled and linked against
     the libprotobuf-c support library.
    Homepage: https://github.com/protobuf-c/protobuf-c
    

    Thank.

  • Well, after some time I think to have solved the ZLSZNP_arm issue.

    What I did was perform a cross compilation inside UBUNTU 19.04 64-bit under VirtualBOX 6.0.8 r130520 (Qt5.6.2), here below the steps:

    copy the "Zigbee_3_0_Linux_Gateway_1_0_1.run" file inside the home/<your_user_folder> folder

    Set the execution permission:

    $ chmod +x Zigbee_3_0_Linux_Gateway_1_0_1.run

    Start the installation:

    $ ./Zigbee_3_0_Linux_Gateway_1_0_1.run

    After the installation finish:

    $ sudo apt-get update

    $ sudo apt-get install git

    Now (from the /home/<user> folder) download the cross compiling tools:

    $ git clone https://github.com/raspberrypi/tools

    Set the $PATH and the $TCLIB environment variable as below:

    $ export PATH="$(pwd)/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:${PATH}"
    $ export TCLIB="$(pwd)/tools/arm-bm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/"

    If you are in a new fresh UBUNTU installation on a 64bit os install also these packages otherwise you get error due to missing compiler:

    $ sudo apt-get -y install lib32ncurses5
    $ sudo apt-get install libc6-i386 lib32z1 lib32stdc++6

    Now go into the /source folder and run the compilation:

    $ cd ti

    $ cd Zigbee_3_0_Linux_Gateway_1_0_1

    $ cd source

    $ ./build_all

    When the steps finish go into the /out folder (this was created during the compilation stage), inside this folder you should have another folder called /Precompiled and a file with name /content.txt.

    Open the /Precompiled folder you should have a sigle compressed file with name: z-stack_linux_gateway_arm_binaries_.tar.

    Double click on it in order to open the extraction utility, select the /servers folder and take out the following files:

    GATEWAY_SRVR_arm

    NWKMGR_SRVR_arm

    OTA_SRVR_arm

    ZLSZNP_arm

    go back and select the /app folder and extract the main.bin file.

    Now transfer all the *_arm previously extracted from the tar file to the RPi and copy them to the corresponding /servers folder and set permissions to 0777.

    In a similar way operate with main.bin file, so copy it to the corresponding /app folder inside the RPi and set permissions to 0777.

    Now you can run the servers inside the RPi with the command:

    $:/home/source/Projects/node# sudo ./start_local.sh

    Now I've to chek about the web interface...

    Bye for now!

  • As first test I've tested an IKEA light bulb but this one is not correctly recognized, here below the Log:

    [21:00:27.916,260] [NWK_MGR/HNDL] PKTTYPE: [                           NWK_MGR>>OTASRVR         ] NwkZigbeeDeviceInd
    [21:00:27.916,295] [NWK_MGR/HNDL] PKTBODY:                                                          cmdId = NWK_ZIGBEE_DEVICE_IND
    [21:00:27.916,311] [NWK_MGR/HNDL] PKTBODY:                                                          deviceInfo :
    [21:00:27.916,325] [NWK_MGR/HNDL] PKTBODY:                                                            networkAddress = 0x0000885C (34908)
    [21:00:27.916,342] [NWK_MGR/HNDL] PKTBODY:                                                            ieeeAddress = 90:FD:9F:FF:FE:DA:F0:CE
    [21:00:27.916,358] [NWK_MGR/HNDL] PKTBODY:                                                            parentIeeeAddress = 00:12:4B:00:1C:A1:4E:59
    [21:00:27.916,375] [NWK_MGR/HNDL] PKTBODY:                                                            manufacturerId = 0x0000117C (4476)
    [21:00:27.916,389] [NWK_MGR/HNDL] PKTBODY:                                                            simpleDescList :
    [21:00:27.916,403] [NWK_MGR/HNDL] PKTBODY:                                                              [000] :
    [21:00:27.916,416] [NWK_MGR/HNDL] PKTBODY:                                                                endpointId = 0x00000001 (1)
    [21:00:27.916,431] [NWK_MGR/HNDL] PKTBODY:                                                                profileId = 0x0000C05E (49246)
    [21:00:27.916,446] [NWK_MGR/HNDL] PKTBODY:                                                                deviceId = 0x00000220 (544)
    [21:00:27.916,461] [NWK_MGR/HNDL] PKTBODY:                                                                deviceVer = 0x00000000 (0)
    [21:00:27.916,475] [NWK_MGR/HNDL] PKTBODY:                                                                inputClusters :
    [21:00:27.916,489] [NWK_MGR/HNDL] PKTBODY:                                                                  [000] = 0x00000000 (0)
    [21:00:27.916,504] [NWK_MGR/HNDL] PKTBODY:                                                                  [001] = 0x00000003 (3)
    [21:00:27.916,517] [NWK_MGR/HNDL] PKTBODY:                                                                  [002] = 0x00000004 (4)
    [21:00:27.916,531] [NWK_MGR/HNDL] PKTBODY:                                                                  [003] = 0x00000005 (5)
    [21:00:27.916,544] [NWK_MGR/HNDL] PKTBODY:                                                                  [004] = 0x00000006 (6)
    [21:00:27.916,558] [NWK_MGR/HNDL] PKTBODY:                                                                  [005] = 0x00000008 (8)
    [21:00:27.916,571] [NWK_MGR/HNDL] PKTBODY:                                                                  [006] = 0x00000300 (768)
    [21:00:27.916,585] [NWK_MGR/HNDL] PKTBODY:                                                                  [007] = 0x00000B05 (2821)
    [21:00:27.916,599] [NWK_MGR/HNDL] PKTBODY:                                                                  [008] = 0x00001000 (4096)
    [21:00:27.916,613] [NWK_MGR/HNDL] PKTBODY:                                                                outputClusters :
    [21:00:27.916,629] [NWK_MGR/HNDL] PKTBODY:                                                                  [000] = 0x00000005 (5)
    [21:00:27.916,643] [NWK_MGR/HNDL] PKTBODY:                                                                  [001] = 0x00000019 (25)
    [21:00:27.916,656] [NWK_MGR/HNDL] PKTBODY:                                                                  [002] = 0x00000020 (32)
    [21:00:27.916,670] [NWK_MGR/HNDL] PKTBODY:                                                                  [003] = 0x00001000 (4096)
    [21:00:27.916,685] [NWK_MGR/HNDL] PKTBODY:                                                            deviceStatus = DEVICE_ON_LINE
    [21:00:27.916,804] [NWK_MGR/HNDL] PKTTYPE: [                           NWK_MGR>>GATEWAY         ] NwkZigbeeDeviceInd
    [21:00:27.916,839] [NWK_MGR/HNDL] PKTBODY:                                                          cmdId = NWK_ZIGBEE_DEVICE_IND
    [21:00:27.916,855] [NWK_MGR/HNDL] PKTBODY:                                                          deviceInfo :
    [21:00:27.916,870] [NWK_MGR/HNDL] PKTBODY:                                                            networkAddress = 0x0000885C (34908)
    [21:00:27.916,888] [NWK_MGR/HNDL] PKTBODY:                                                            ieeeAddress = 90:FD:9F:FF:FE:DA:F0:CE
    [21:00:27.916,906] [NWK_MGR/HNDL] PKTBODY:                                                            parentIeeeAddress = 00:12:4B:00:1C:A1:4E:59
    [21:00:27.916,920] [NWK_MGR/HNDL] PKTBODY:                                                            manufacturerId = 0x0000117C (4476)
    [21:00:27.916,935] [NWK_MGR/HNDL] PKTBODY:                                                            simpleDescList :
    [21:00:27.916,948] [NWK_MGR/HNDL] PKTBODY:                                                              [000] :
    [21:00:27.916,961] [NWK_MGR/HNDL] PKTBODY:                                                                endpointId = 0x00000001 (1)
    [21:00:27.916,976] [NWK_MGR/HNDL] PKTBODY:                                                                profileId = 0x0000C05E (49246)
    [21:00:27.916,991] [NWK_MGR/HNDL] PKTBODY:                                                                deviceId = 0x00000220 (544)
    [21:00:27.917,009] [NWK_MGR/HNDL] PKTBODY:                                                                deviceVer = 0x00000000 (0)
    [21:00:27.917,023] [NWK_MGR/HNDL] PKTBODY:                                                                inputClusters :
    [21:00:27.917,037] [NWK_MGR/HNDL] PKTBODY:                                                                  [000] = 0x00000000 (0)
    [21:00:27.917,050] [NWK_MGR/HNDL] PKTBODY:                                                                  [001] = 0x00000003 (3)
    [21:00:27.917,065] [NWK_MGR/HNDL] PKTBODY:                                                                  [002] = 0x00000004 (4)
    [21:00:27.917,079] [NWK_MGR/HNDL] PKTBODY:                                                                  [003] = 0x00000005 (5)
    [21:00:27.917,092] [NWK_MGR/HNDL] PKTBODY:                                                                  [004] = 0x00000006 (6)
    [21:00:27.917,105] [NWK_MGR/HNDL] PKTBODY:                                                                  [005] = 0x00000008 (8)
    [21:00:27.917,119] [NWK_MGR/HNDL] PKTBODY:                                                                  [006] = 0x00000300 (768)
    [21:00:27.917,134] [NWK_MGR/HNDL] PKTBODY:                                                                  [007] = 0x00000B05 (2821)
    [21:00:27.917,148] [NWK_MGR/HNDL] PKTBODY:                                                                  [008] = 0x00001000 (4096)
    [21:00:27.917,162] [NWK_MGR/HNDL] PKTBODY:                                                                outputClusters :
    [21:00:27.917,175] [NWK_MGR/HNDL] PKTBODY:                                                                  [000] = 0x00000005 (5)
    [21:00:27.917,189] [NWK_MGR/HNDL] PKTBODY:                                                                  [001] = 0x00000019 (25)
    [21:00:27.917,202] [NWK_MGR/HNDL] PKTBODY:                                                                  [002] = 0x00000020 (32)
    [21:00:27.917,216] [NWK_MGR/HNDL] PKTBODY:                                                                  [003] = 0x00001000 (4096)
    [21:00:27.917,231] [NWK_MGR/HNDL] PKTBODY:                                                            deviceStatus = DEVICE_ON_LINE

    then:

    Device Type Not Recognized:  49246 : 544

    [21:01:41.525,096] [NPISRVR/U_RX] PKT_HEX: [SOCZIGB>>NPISRVR                                    ] [ASNC] 03:45:C4:5C:88:00
    [21:01:41.525,199] [NPISRVR/ACBK] PKT_HEX: [         NPISRVR>>Z_STACK                           ] [bcst] 03:45:C4:5C:88:00
    [21:01:41.525,479] [Z_STACK/HNDL] PKTTYPE: [                  Z_STACK>>NWK_MGR                  ] zdoSrcRtgInd
    [21:01:41.525,525] [Z_STACK/HNDL] PKTBODY:                                                          cmdID = <NOT_FOUND>
    [21:01:41.525,544] [Z_STACK/HNDL] PKTBODY:                                                          srcAddr = 0x0000885C (34908)
    [21:01:41.525,564] [Z_STACK/HNDL] PKTBODY:                                                          relayCnt = 0x00000000 (0)
    [21:01:43.562,323] [NPISRVR/U_RX] PKT_HEX: [SOCZIGB>>NPISRVR                                    ] [ASNC] 03:45:C4:5C:88:00
    [21:01:43.562,507] [NPISRVR/ACBK] PKT_HEX: [         NPISRVR>>Z_STACK                           ] [bcst] 03:45:C4:5C:88:00
    [21:01:43.563,023] [Z_STACK/HNDL] PKTTYPE: [                  Z_STACK>>NWK_MGR                  ] zdoSrcRtgInd
    [21:01:43.563,110] [Z_STACK/HNDL] PKTBODY:                                                          cmdID = <NOT_FOUND>
    [21:01:43.563,157] [Z_STACK/HNDL] PKTBODY:                                                          srcAddr = 0x0000885C (34908)
    [21:01:43.563,200] [Z_STACK/HNDL] PKTBODY:                                                          relayCnt = 0x00000000 (0)
    [21:01:43.614,858] [NPISRVR/U_RX] PKT_HEX: [SOCZIGB>>NPISRVR                                    ] [ASNC] 22:44:81:00:00:19:00:5C:88:01:0E:00:9F:00:CC:01:E6:00:00:0E:01:00:01:01:7C:11:02:22:72:75:21:12:01:00:5C:88:1D
    [21:01:43.615,151] [NPISRVR/ACBK] PKT_HEX: [         NPISRVR>>Z_STACK                           ] [bcst] 22:44:81:00:00:19:00:5C:88:01:0E:00:9F:00:CC:01:E6:00:00:0E:01:00:01:01:7C:11:02:22:72:75:21:12:01:00:5C:88:1D
    [21:01:43.615,762] [Z_STACK/MAIN] PKTTYPE: [                  Z_STACK>>>>>>>>>>>OTASRVR         ] afIncomingMsgInd
    [21:01:43.615,855] [Z_STACK/MAIN] PKTBODY:                                                          cmdID = <NOT_FOUND>
    [21:01:43.615,896] [Z_STACK/MAIN] PKTBODY:                                                          srcAddr :
    [21:01:43.615,940] [Z_STACK/MAIN] PKTBODY:                                                            addrMode = SHORT
    [21:01:43.615,977] [Z_STACK/MAIN] PKTBODY:                                                            shortAddr = 0x0000885C (34908)
    [21:01:43.616,015] [Z_STACK/MAIN] PKTBODY:                                                            endpoint = 0x00000001 (1)
    [21:01:43.616,054] [Z_STACK/MAIN] PKTBODY:                                                            panID = 0x00000000 (0)
    [21:01:43.616,093] [Z_STACK/MAIN] PKTBODY:                                                          groupID = 0x00000000 (0)
    [21:01:43.616,129] [Z_STACK/MAIN] PKTBODY:                                                          clusterId = 0x00000019 (25)
    [21:01:43.616,164] [Z_STACK/MAIN] PKTBODY:                                                          macDestAddr = 0x00000000 (0)
    [21:01:43.616,203] [Z_STACK/MAIN] PKTBODY:                                                          endpoint = 0x0000000E (14)
    [21:01:43.616,239] [Z_STACK/MAIN] PKTBODY:                                                          wasBroadcast = 0
    [21:01:43.616,275] [Z_STACK/MAIN] PKTBODY:                                                          securityUse = 0
    [21:01:43.616,314] [Z_STACK/MAIN] PKTBODY:                                                          linkQuality = 0x0000009F (159)
    [21:01:43.616,350] [Z_STACK/MAIN] PKTBODY:                                                          correlation = 0x00000000 (0)
    [21:01:43.616,416] [Z_STACK/MAIN] PKTBODY:                                                          rssi = 0x00000000 (0)
    [21:01:43.616,481] [Z_STACK/MAIN] PKTBODY:                                                          timestamp = 0x00E601CC (15073740)
    [21:01:43.616,536] [Z_STACK/MAIN] PKTBODY:                                                          nwkSeqNum = 0x00000040 (64)
    [21:01:43.616,580] [Z_STACK/MAIN] PKTBODY:                                                          macSrcAddr = 0x00009FFF (40959)
    [21:01:43.616,615] [Z_STACK/MAIN] PKTBODY:                                                          transSeqNum = 0x00000000 (0)
    [21:01:43.616,696] [Z_STACK/MAIN] PKTBODY:                                                          payload (hex string) = 01:00:01:01:7C:11:02:22:72:75:21:12:01:00
    [21:01:43.617,200] [OTASRVR/HNDL] PKTTYPE: [                  Z_STACK<<<<<<<<<<<OTASRVR         ] afDataReq
    [21:01:43.617,324] [OTASRVR/HNDL] PKTBODY:                                                          cmdID = AF_DATA_REQ
    [21:01:43.617,407] [OTASRVR/HNDL] PKTBODY:                                                          dstAddr :
    [21:01:43.617,444] [OTASRVR/HNDL] PKTBODY:                                                            addrMode = SHORT
    [21:01:43.617,483] [OTASRVR/HNDL] PKTBODY:                                                            shortAddr = 0x0000885C (34908)
    [21:01:43.617,520] [OTASRVR/HNDL] PKTBODY:                                                            endpoint = 0x00000001 (1)
    [21:01:43.617,558] [OTASRVR/HNDL] PKTBODY:                                                            panID = 0x00000000 (0)
    [21:01:43.617,599] [OTASRVR/HNDL] PKTBODY:                                                          srcEndpoint = 0x0000000E (14)
    [21:01:43.617,634] [OTASRVR/HNDL] PKTBODY:                                                          clusterID = 0x00000019 (25)
    [21:01:43.617,673] [OTASRVR/HNDL] PKTBODY:                                                          transID = 0x00000000 (0)
    [21:01:43.617,710] [OTASRVR/HNDL] PKTBODY:                                                          options :
    [21:01:43.617,763] [OTASRVR/HNDL] PKTBODY:                                                          radius = 0x0000001E (30)
    [21:01:43.617,811] [OTASRVR/HNDL] PKTBODY:                                                          payload (hex string) = 19:01:02:98
    [21:01:43.618,252] [Z_STACK/LSTN] PKTTYPE: [         NPISRVR<<Z_STACK                           ] [SREQ] 18:24:02:02:5C:88:00:00:00:00:00:00:01:00:00:0E:19:00:00:00:1E:04:00:19:01:02:98
    [21:01:43.618,713] [NPISRVR/MAIN] PKT_HEX: [SOCZIGB<<NPISRVR                                    ] [send] 18:24:02:02:5C:88:00:00:00:00:00:00:01:00:00:0E:19:00:00:00:1E:04:00:19:01:02:98
    [21:01:43.623,903] [NPISRVR/U_RX] PKT_HEX: [SOCZIGB>>NPISRVR                                    ] [SRSP] 01:64:02:00
    [21:01:43.624,798] [NPISRVR/MAIN] PKT_HEX: [         NPISRVR>>Z_STACK                           ] [ucst] 01:64:02:00
    [21:01:43.625,488] [Z_STACK/LSTN] PKTTYPE: [                  Z_STACK>>>>>>>>>>>OTASRVR         ] zstackDefaultRsp
    [21:01:43.625,601] [Z_STACK/LSTN] PKTBODY:                                                          cmdID = AF_DATA_REQ
    [21:01:43.625,645] [Z_STACK/LSTN] PKTBODY:                                                          status = ZSuccess
    [21:01:43.630,327] [NPISRVR/U_RX] PKT_HEX: [SOCZIGB>>NPISRVR                                    ] [ASNC] 03:44:80:00:0E:00
    [21:01:43.630,567] [NPISRVR/ACBK] PKT_HEX: [         NPISRVR>>Z_STACK                           ] [bcst] 03:44:80:00:0E:00
    [21:01:43.670,599] [Z_STACK/MAIN] PKTTYPE: [                  Z_STACK>>>>>>>>>>>OTASRVR         ] afDataConfirmInd
    [21:01:43.670,730] [Z_STACK/MAIN] PKTBODY:                                                          cmdID = <NOT_FOUND>
    [21:01:43.670,789] [Z_STACK/MAIN] PKTBODY:                                                          status = ZSuccess
    [21:01:43.670,838] [Z_STACK/MAIN] PKTBODY:                                                          endpoint = 0x0000000E (14)
    [21:01:43.670,875] [Z_STACK/MAIN] PKTBODY:                                                          transID = 0x00000000 (0)

    From Wireshark all the data exchange betwwen the ZC and the ZED seems correct and the device type is know:

    Frame 1210: 158 bytes on wire (1264 bits), 158 bytes captured (1264 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 84
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x885c
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x885c
    ZigBee Application Support Layer Data, Dst Endpt: 0, Src Endpt: 0
    ZigBee Device Profile, Simple Descriptor Response, Nwk Addr: 0x885c, Status: Success
        Sequence Number: 6
        Status: Success (0)
        Nwk Addr of Interest: 0x885c
        Simple Descriptor Length: 34
        Simple Descriptor
            Endpoint: 1
            Profile: ZLL (0xc05e)
            Application Device: Color temperature light (0x0220)
            Application Version: 0x0002
            Input Cluster Count: 9
            Input Cluster List
                Input Cluster: Basic (0x0000)
                Input Cluster: Identify (0x0003)
                Input Cluster: Groups (0x0004)
                Input Cluster: Scenes (0x0005)
                Input Cluster: On/Off (0x0006)
                Input Cluster: Level Control (0x0008)
                Input Cluster: Color Control (0x0300)
                Input Cluster: Unknown (0x0b05)
                Input Cluster: ZLL Commissioning (0x1000)
            Output Cluster Count: 4
            Output Cluster List
                Output Cluster: Scenes (0x0005)
                Output Cluster: OTA Upgrade (0x0019)
                Output Cluster: Poll Control (0x0020)
                Output Cluster: ZLL Commissioning (0x1000)
    

    Then I think that this is somethings to change inside the section that is able to recognize the profile, in this scenario this is ZLL (0xc05e - 49246), there are some hints how to overcome this and the integrate also these type of devices?

    Thanks in advance!

  • If you factory reset a ZLL light, it should send beacon requests trying to join Zigbee HA network first. I suggest you use sniffer to check what happens over the air.

  • Hi @YK Chen,

    the step I've used is the same as my test with the zc_switch design, the log from Wireshark seems correct and is here attached.

    Just some note about the Log, at the packet 1069 the ligh bulb send the Association Request, at packet 1085 the ZC send to the bulb the Transport Key, then on 1200 the ZC ask for the Active Endpoint Request and in 1204 the Light Bulb send the related responce, on 1206 there is the Simple Descriptor Request and related response from the Ligh Bulb is at 1210 so I think that all the protocol is managed properly.

    The difference, I think, is that inside my initial experiment with the zc_switch example ( e2e.ti.com/.../3016844 ) I made the binding only by looking if the On/Off input cluster (0x0006) was discovered. Now, with this application (the Linux Gateway), I think that the system try to know what type of device is joining the network by looking at the Device Type regarding the cluster type that may be into the device itself (and of course this is the correct way to indentify a device), hence if this Device Type is not recognized the light bulb is not managed because considered as a invalid device regarding the presence or not of the On/Off cluster.

    To solve I think that we have to find a way to expand the supported device type in order to let also this type of devices, classified as "Color temperature light (0x0220)" being managed from the system when we did this we will also able to manage other device and then expand the range of the supported device.

    Following this idea I've did a text search through the source files with the string "Device Type Not Recognized", this bring me on this source file:

    C:\ti\Zigbee_3_0_Linux_Gateway_1_0_1\source\Projects\node\nodejs_zb_gateway\devices\device.js

    opening it the interesting function is the "function createDevType(nwkmgr, ieee, simpleDesc)" that is responsible for properly understanding the device type, the strange things is that either the simpleDesc.profileId and the simpleDesc.deviceId was properly identified, in fact into the "Device Type Not Recognized" message we have the correct profileId and deviceId so I don't understand why the check fail and the device is not properly recognised...

    To check if the execution is correct I've did a simple console.log just inside the two if section into the function createDevType(nwkmgr, ieee, simpleDesc) function:

    ...
     }
          //ZLL profile
          else if(simpleDesc.profileId  === ZBL.ZB_PROFILE_ID.LIGHT_LINK)
          {
    
    	 console.log("ZLL profile found...");
    
            //ZLL Dimmalbe Light
            if(simpleDesc.deviceId === ZBL.ZLL_DEVICE_ID.DIMMABLE_LIGHT)
            {
              return new LightDevice(nwkmgr, ieee, simpleDesc.endpointId, "DimmableLight");
            }
            //ZLL Color Light
            if(simpleDesc.deviceId === ZBL.ZLL_DEVICE_ID.COLOR_LIGHT)
            {
              return new LightDevice(nwkmgr, ieee, simpleDesc.endpointId, "ColorLight");
            }
            //ZLL Extended Color Light
            if(simpleDesc.deviceId === ZBL.ZLL_DEVICE_ID.EXTENDED_COLOR_LIGHT)
            {
              return new LightDevice(nwkmgr, ieee, simpleDesc.endpointId, "ColorLight");
            }
    
    ...

    and into the output log I can see effectively the ZLL profile found... message so the execution is correct until this point... and seems trhat I've to add another definition because the only that was managed are the following ones:

    DIMMABLE_LIGHT: 0x0100
    COLOR_LIGHT: 0x0200
    EXTENDED_COLOR_LIGHT: 0x0210

    and I need also to add the COLOR_TEMPERATURE_LIGHT: 0x0220 extension...

    making this code adding at the /Projects/node/nodejs_zb_gateway/devices/devices.js file:

    I'm able to correctly recognise the device and drive it from the web page:

    So next step is see how integrate other not really supported ZED devices like smart power outlet...

    P.S.

    About the *_arm compilation issue I think that the problem was mainly somethings wrong inside the RPi (may be the gcc compiler release or other stuff that will be investigated) but for sure cross compilation has an undeniable advantage of the compilation speed, just some seconds to perform the compilation instead long time directly inside the RPi.

    Thank.

    IKEA-LOG-RPI3-ZNP-CC26X2R1.zip

  • Hi,

    I'm try to integrate a Mijia Temperature and Humidity sensor inside the Zigbee Sensor to Cloud example.

    This sensor have a non standard cluster structure, it's not possible to query for standard cluster, but the sensor by itself send back to the ZC some  Report Attributes commands.

    Here below the Endpoint and cluster composition:

    Frame 803: 156 bytes on wire (1248 bits), 156 bytes captured (1248 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 82
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Application Support Layer Data, Dst Endpt: 0, Src Endpt: 0
        Frame Control Field: Data (0x40)
        Destination Endpoint: 0
        Simple Descriptor Response (Cluster ID: 0x8004)
        Profile: ZigBee Device Profile (0x0000)
        Source Endpoint: 0
        Counter: 88
    ZigBee Device Profile, Simple Descriptor Response, Nwk Addr: 0x13fd, Status: Success
        Sequence Number: 6
        Status: Success (0)
        Nwk Addr of Interest: 0x13fd
        Simple Descriptor Length: 32
        Simple Descriptor
            Endpoint: 1
            Profile: Home Automation (0x0104)
            Application Device: Unknown (0x5f01)
            Application Version: 0x0001
            Input Cluster Count: 5
            Input Cluster List
                Input Cluster: Basic (0x0000)
                Input Cluster: Identify (0x0003)
                Input Cluster: OTA Upgrade (0x0019)
                Input Cluster: Manufacturer Specific (0xffff)
                Input Cluster: Multistate Input (Basic) (0x0012)
            Output Cluster Count: 7
            Output Cluster List
                Output Cluster: Basic (0x0000)
                Output Cluster: Groups (0x0004)
                Output Cluster: Identify (0x0003)
                Output Cluster: Scenes (0x0005)
                Output Cluster: OTA Upgrade (0x0019)
                Output Cluster: Manufacturer Specific (0xffff)
                Output Cluster: Multistate Input (Basic) (0x0012)
    
    ****************************************************************************************************
    Frame 823: 144 bytes on wire (1152 bits), 144 bytes captured (1152 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 70
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Application Support Layer Data, Dst Endpt: 0, Src Endpt: 0
        Frame Control Field: Data (0x40)
        Destination Endpoint: 0
        Simple Descriptor Response (Cluster ID: 0x8004)
        Profile: ZigBee Device Profile (0x0000)
        Source Endpoint: 0
        Counter: 91
    ZigBee Device Profile, Simple Descriptor Response, Nwk Addr: 0x13fd, Status: Success
        Sequence Number: 7
        Status: Success (0)
        Nwk Addr of Interest: 0x13fd
        Simple Descriptor Length: 20
        Simple Descriptor
            Endpoint: 2
            Profile: Home Automation (0x0104)
            Application Device: Unknown (0x5f02)
            Application Version: 0x0001
            Input Cluster Count: 2
            Input Cluster List
                Input Cluster: Identify (0x0003)
                Input Cluster: Multistate Input (Basic) (0x0012)
            Output Cluster Count: 4
            Output Cluster List
                Output Cluster: Groups (0x0004)
                Output Cluster: Identify (0x0003)
                Output Cluster: Scenes (0x0005)
                Output Cluster: Multistate Input (Basic) (0x0012)
    ****************************************************************************************************
    Frame 838: 144 bytes on wire (1152 bits), 144 bytes captured (1152 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 70
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x13fd
    ZigBee Application Support Layer Data, Dst Endpt: 0, Src Endpt: 0
        Frame Control Field: Data (0x40)
        Destination Endpoint: 0
        Simple Descriptor Response (Cluster ID: 0x8004)
        Profile: ZigBee Device Profile (0x0000)
        Source Endpoint: 0
        Counter: 94
    ZigBee Device Profile, Simple Descriptor Response, Nwk Addr: 0x13fd, Status: Success
        Sequence Number: 8
        Status: Success (0)
        Nwk Addr of Interest: 0x13fd
        Simple Descriptor Length: 20
        Simple Descriptor
            Endpoint: 3
            Profile: Home Automation (0x0104)
            Application Device: Unknown (0x5f03)
            Application Version: 0x0001
            Input Cluster Count: 2
            Input Cluster List
                Input Cluster: Identify (0x0003)
                Input Cluster: Analog Input (Basic) (0x000c)
            Output Cluster Count: 4
            Output Cluster List
                Output Cluster: Groups (0x0004)
                Output Cluster: Identify (0x0003)
                Output Cluster: Scenes (0x0005)
                Output Cluster: Analog Input (Basic) (0x000c)

    Concerning the Report Attributes command I can see at least 4 type, the most interesting concerning the Temperature and Humidity are addressed to the standard cluster, one is a textual description of the sensor and the last is a non standard type that I've try to decoded and that is sent rarely to the ZC. The Temperature and Humidity are sent when this parameters change upper or lower respect the previous measurement value of one or either parameters change.

    Temperature measurement

    Frame 56: 127 bytes on wire (1016 bits), 127 bytes captured (1016 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 53
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x808e
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x808e
    ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
        Frame Control Field: Data (0x00)
        Destination Endpoint: 1
        Cluster: Temperature Measurement (0x0402)
        Profile: Home Automation (0x0104)
        Source Endpoint: 1
        Counter: 46
    ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 2
        Frame Control Field: Profile-wide (0x18)
        Sequence Number: 2
        Command: Report Attributes (0x0a)
        Attribute Field
            Attribute: Measured Value (0x0000)
            Data Type: 16-Bit Signed Integer (0x29)
            Measured Value: 31,41 [°C]

    Humidity measurement:

    Frame 58: 127 bytes on wire (1016 bits), 127 bytes captured (1016 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 53
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x808e
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x808e
    ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
        Frame Control Field: Data (0x00)
        Destination Endpoint: 1
        Cluster: Relative Humidity Measurement (0x0405)
        Profile: Home Automation (0x0104)
        Source Endpoint: 1
        Counter: 47
    ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 3
        Frame Control Field: Profile-wide (0x18)
        Sequence Number: 3
        Command: Report Attributes (0x0a)
        Attribute Field
            Attribute: Measured Value (0x0000)
            Data Type: 16-Bit Unsigned Integer (0x21)
            Measured Value: 58.87 [%]

    The sensor identification string is sent by the sensor when a button on the sensor cover is pushed:

    Frame 977: 140 bytes on wire (1120 bits), 140 bytes captured (1120 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 66
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x808e
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x808e
    ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
        Frame Control Field: Data (0x00)
        Destination Endpoint: 1
        Cluster: Basic (0x0000)
        Profile: Home Automation (0x0104)
        Source Endpoint: 1
        Counter: 118
    ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 70
        Frame Control Field: Profile-wide (0x18)
        Sequence Number: 70
        Command: Report Attributes (0x0a)
        Attribute Field, String: lumi.sensor_ht
            Attribute: Model Identifier (0x0005)
            Data Type: Character String (0x42)
            String: lumi.sensor_ht
    

    Pushing the button on the sensor will provide also the following non standard Report Attributes packet:

    Frame 152047: 157 bytes on wire (1256 bits), 157 bytes captured (1256 bits) on interface 0
    Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
    Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
    User Datagram Protocol, Src Port: 17754, Dst Port: 17754
    ZigBee Encapsulation Protocol, Channel: 13, Length: 83
    IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x808e
        Frame Control Field: 0x8861, Frame Type: Data, Acknowledge Request, PAN ID Compression, Destination Addressing Mode: Short/16-bit, Frame Version: IEEE Std 802.15.4-2003, Source Addressing Mode: Short/16-bit
        Sequence Number: 201
        Destination PAN: 0x5ed5
        Destination: 0x0000
        Source: 0x808e
        [Extended Source: Jennic_00:02:b5:40:20 (00:15:8d:00:02:b5:40:20)]
        [Origin: 2782]
        TI CC24xx-format metadata: FCS OK
            FCS Valid: True
            RSSI: 0dB
            LQI Correlation Value: 0
    ZigBee Network Layer Data, Dst: 0x0000, Src: 0x808e
        Frame Control Field: 0x0248, Frame Type: Data, Discover Route: Enable, Security Data
        Destination: 0x0000
        Source: 0x808e
        Radius: 30
        Sequence Number: 241
        [Extended Source: Jennic_00:02:b5:40:20 (00:15:8d:00:02:b5:40:20)]
        [Origin: 2782]
        ZigBee Security Header
            Security Control Field: 0x28, Key Id: Network Key, Extended Nonce
                ...0 1... = Key Id: Network Key (0x1)
                ..1. .... = Extended Nonce: True
            Frame Counter: 60
            Extended Source: Jennic_00:02:b5:40:20 (00:15:8d:00:02:b5:40:20)
            Key Sequence Number: 0
            Message Integrity Code: 6d85b6e9
            [Key: 5ea120fb6ef62dd856ac6fa381a826f7]
            [Key Origin: 2780]
    ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
        Frame Control Field: Data (0x00)
            .... ..00 = Frame Type: Data (0x0)
            .... 00.. = Delivery Mode: Unicast (0x0)
            ..0. .... = Security: False
            .0.. .... = Acknowledgement Request: False
            0... .... = Extended Header: False
        Destination Endpoint: 1
        Cluster: Basic (0x0000)
        Profile: Home Automation (0x0104)
        Source Endpoint: 1
        Counter: 99
    ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 51
        Frame Control Field: Profile-wide (0x18)
            .... ..00 = Frame Type: Profile-wide (0x0)
            .... .0.. = Manufacturer Specific: False
            .... 1... = Direction: Server to Client
            ...1 .... = Disable Default Response: True
        Sequence Number: 51
        Command: Report Attributes (0x0a)
        Attribute Field, String: !�!�!�
            Attribute: Unknown (0xff01)
            Data Type: Character String (0x42)
            String: \001!\357\277\275\v\004!\357\277\275\023\005!\357\277\275

    After some checking this packet may have inside the battery voltage value and the Temperature and Humidity information with also other data that is unknow but may be not so important for this purpose, here below the hypothetical packet dissection:

    00            : Frame control Field data (0x00)
    01            : Destination Endpoint 
    00 00         : Basic Cluster
    04 01         : Profile Home Automation (0x0104)
    01            : Source Endpoint
    63            : Counter (0x63 = 99)
    18            : Profile-wide
    33            : Sequence Number (0x33 = 51)
    
    0a            : Report Attributes Command
    01 ff         : Attribute (unknow value)
    42            : data type (string)
    1f            : packet lenght in bytes (here is 31 bytes long)
    01 21         : 01=tag battery voltage - 21=ZCL datatype 16-bit unsigned int)
    bd 0b         : battery voltage value (0BBD = 3005 -> 3.005 V)
    04 21         : 04=tag ??? 21= Analog ZCL datatype 16-bit unsigned int
    a8 13         : 5032
    05 21         : 05=tag ??? 21= Analog ZCL datatype 16-bit unsigned int
    89 00         : 137
    06 24         : 06=tag ??? 24= Analog ZCL datatype 40-bit unsigned int
    18 00 00 00 00: 24 (0x18 = 24) - may be the LQI or RSSI
    64 29         : 64=tag ??? 29= Analog ZCL datatype 16-bit signed int (temperature)
    43 0b         : 2883
    65 21         : 65=tag ??? 21= Analog ZCL datatype 16-bit unsigned int (Humidity)
    d6 18         : 6358
    0a 21         : 0a=tag ??? 21= Analog ZCL datatype 16-bit unsigned int
    00 00         : 0

    This is all the info discovered through the sensor sniffing for some time.

    Because this is an unsupported devices inside the TI example design (Zigbee Sensor to Cloud) the next step will be search a suitable way to integrate this sensor inside the Cloud Application through the knowledge of these informations.

    Every hint of course is welcomed, just to start I think that the work should be:

    - identify the sensor on the commissioning stage by means his 0x5f02 non standard application device code and then perform a mapping through the discovered Endpoint structure and a device description that I think should be coded inside the node.js application on the /devices folder as a new custom class and also extend the zb_lib.js file inside the /zigbee_library folder with this custom ID written inside the HA_DEVICE_ID table.

    - define a some sort of callback function to trigger when the ZCL: Report Attributes command event is received from the ZNP, process the payload and then send the relevant info to the web page

    Someone have some suggest?

    Thank!

  • Hi,

    You are definitely on the right track.

    When receiving an Attribute Report, the hagateway module will emit 'hagateway:gw:report', and zb-gateway module receives this.

    The zb-gateway will emit to its client (eg local webserver, cloud adapter).

    Regards,
    Toby

  • Thank @Toby Pan,

    from your perspective what should be the best modular way to perform this task?

    Extending the ZCL description may be inside the zb_lib.js file, but in order to keep separated the custom descriptions from the standard ones I'm thinking to setup a new zb_cst_lib.js file where I will store all the custom definitions and then make it easier to insert new devices.

    About the custom device description my goal is to made this procedure repeatable with simplicity also I've to found a way to define the callback function that must be invoked when the system receives the message 'hagateway:gw:report' the question is how/where integrate this behaviour inside the framework to get the framework easily extendeable.

    I'll to search inside the code because there is no indeep informations concerning the application structure inside the various document like the "Z-Stack Linux Gateway - User's Guide" (C:\ti\Zigbee_3_0_Linux_Gateway_1_0_1\Documents).

    From what I've understood:

    start_local.sh -> main.js -> webserver.js

    inside the webserver.js source file there is the code needed to configure the webserver used to interact with the user by listening on port 5000. This server is configured in order to send back to the client browser, for each incoming connection ("get" command received), the web page described inside the webapp.html source file. This is the page that is shown on the client browser and basically is the web page template and also contain the code responsible to manage all user actions on the objects that is on the web page through the class inside the file webapp.js.

    Thank!

  • To see where to send/receive/handle events, please refer to the nodejs_zb_gateway API guide: C:/ti/Zigbee_3_0_Linux_Gateway_1_0_1/source/Projects/node/nodejs_zb_gateway/API.html

    How many new devices do you expect to have?

    Adding it to zb_lib.js is a valid way, and will probably be the easiest to get it working functionally.

    That being said, you are free to add modules if necessary for your use case.

  • Hi @Toby Pan,

    thank for your time, well, ideally there is no limit, but actually the purpose is find a sistematic and easy way to add noew device type to the framework.

    In order to have a complete management I'll think to add some intelligent power outlet (this can be switched on/off and also give bak the energy and power measurements), some low cost thermometer/humidity sensor, pressure sensor, and PIR sensor for surveillance.

    I'll read what you suggest to me, thank to point me in the right direction I'll try and report back my results... of course feel free to let me know anything you think that be useful for my better understanding and implementation...

    Thank!