Showing posts with label CC2531EMK. Show all posts
Showing posts with label CC2531EMK. Show all posts

Wednesday, October 31, 2018

How to use CC2531EMK and Wireshark as Zigbee sniffer.

The following steps show you how to use CC2531EMK and Wireshark as Zigbee sniffer.

1. Download and install TI Wireshark Packet Converter 1.

2. Download and install TI Packet sniffer to get sniffer_fw_cc2531.hex under C:\Program Files (x86)\Texas Instruments\SmartRF Tools\Packet Sniffer\bin\general\firmware. After getting sniffer_fw_cc2531.hex, you can download it to your CC2531EMK using CC Debugger.

3. Plug CC2531EMK into PC and start TiWsPc to select CC2531EMK and Zigbee channel to start TI Wireshark Packet Converter 1.



4. Download and install TI Packet sniffer 2. Copy ti802154ge-x64-2x.dll and tirpi-x64-2x.dll from C:\Program Files (x86)\Texas Instruments\SmartRF Tools\SmartRF Packet Sniffer 2\wireshark\plugins\2.4.x to C:\Program Files (x86)\Wireshark\plugins\2.4.8 (my Wireshar version is 2.4.8 and yours might be different.)

5. Open Wireshark go to Edit > Preferences > Protocols > Zigbee add the Zigbee TC Link Key 5a6967426565416c6c69616e63653039

6. Create a new Desktop shortcut for Wireshark and add the following to the path: -i\\.\pipe\tiwspc_data -k



7. Start Wireshark with the new shortcut created in step 6 and you will see Wireshark sniffing Zigbee data.


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 Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.run from http://www.ti.com/tool/z-stack-archive.

2.a. If you use  Linux 16.04 x86 (32Bit), you can run Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.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 http://processors.wiki.ti.com/index.php/Sitara_Linux_SDK_64_Bit_Ubuntu_Support and have to run the following apt-get install command to install necessary packages before you run Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.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="BEAGLEBONE_BLACK"
    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
cp $NPI_SOURCE/Projects/tools/LinuxHost/out/NPI_lnx_${PLATFORM_SUBSTRING}_server $BINARIES_SERVERS_DIR/NPI_lnx_${PLATFORM_SUBSTRING}_server


4.Download protobuf 2.5.0-9ubuntu1 source package from https://launchpad.net/ubuntu/+source/protobuf/2.5.0-9ubuntu1 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 https://launchpad.net/ubuntu/+source/protobuf-c/0.15-1build1 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:

    ...
    [UART]
    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.

















Thursday, April 27, 2017

Running 6lbr on Raspberry Pi with WiFi enable

The following steps show you how to run 6lbr on Raspberry Pi with WiFi enable. I use Wi-Pi WiFi dongle in my test.

1. Run "sudo iwlist wlan0 scan" to scan WiFi AP

2. Edit wpa_supplicant.conf to add your WiFi AP SSID, password, and settings by running "sudo vi /etc/wpa_supplicant/wpa_supplicant.conf"



3. Run "sudo ifdown wlan0" and "sudo ifup wlan0" to restart wlan0.

4. Kill existing wpa_supplicant process by running "sudo kill -9 $(ps -ef | grep wpa | awk '{print $2}')" and run "sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf" to start it again with new settings in wpa_supplicant.conf.

5. Run "sudo dhclient" to get DHCP client IP and run "ifconfig wlan0" to check if you get correct client IP.


6. Restart Raspberry Pi and ssh to it using wlan0 DHCP client IP get in step 5.

7. Edit /etc/6lbr/6lbr.conf to use wlan0 as ETH interface.


8. Start 6lbr and you can test it with wlan0 now.

For details of running 6lbr with CC2531EMK on Raspberry Pi, you can refer to "Setup 6lbr to run 6LowPAN with CC2531 USB dongle on Raspberry Pi 2B."

Wednesday, March 29, 2017

Build TI Z-Stack Linux Home Gateway reference design for x86 Linux

The following steps show you hot to build TI Z-Stack Linux Home Gateway reference design for x86 Linux.

1. Download Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.run from http://www.ti.com/tool/z-stack-archive.

2. Setup a 32 bit Ubuntu and run Z-Stack_Linux_Gateway-1.0.1-src-linux-installer.run to extract Z-Stack Linux Gateway source code to your Linux Home folder\Z-Stack_Linux_Gateway-1.0.1-src

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="BEAGLEBONE_BLACK"
    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
cp $NPI_SOURCE/Projects/tools/LinuxHost/out/NPI_lnx_${PLATFORM_SUBSTRING}_server $BINARIES_SERVERS_DIR/NPI_lnx_${PLATFORM_SUBSTRING}_server


4.a Install protobuf by doing the following two apt-get install

       sudo apt-get install protobuf-c-compiler
       sudo apt-get install protobuf-compiler

4.b Create a new folder "tools" and export TCLIB to it using the following lines:
  
       cd ~
       mkdir tools
       export TCLIB=~/tools/

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

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

7. Copy and untar “z-stack_linux_gateway_x86_binaries.tar” to your working directory on x86 (called ). 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"

8. If you run it successfully, you will see the results like the following screen shot.