Showing posts with label BeagleBone Black. Show all posts
Showing posts with label BeagleBone Black. Show all posts

Tuesday, October 16, 2018

How to build TI Z-Stack Linux Home Gateway for Beaglebone Black


The following steps show you how to build TI Z-Stack Linux Home Gateway from source codes for Beaglebone Black.

1.Setup and run Ubuntu 18.04.01 on VirtualBox

2. Install build-essential with the following command

    sudo apt-get install build-essential

3. Change to home directory (mine is /home/yk) and install cross compiler for building BBB binary.
    
    wget -c https://releases.linaro.org/components/toolchain/binaries/6.4-2018.05/arm-linux-gnueabihf/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
    
    tar xf gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz

4. Add cross compiler path into PATH variable

     export PATH=$PATH:/home/yk/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf/bin

5. Add TCLIB path by the following command

     export TCLIB=/home/yk/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf/lib

6. Download Z-STACK-LINUX-GATEWAY and install to home directory (mine is ~/Z-Stack_Linux_Gateway-1.0.1-src).

7. Change directory to ~/Z-Stack_Linux_Gateway-1.0.1-src/Source and run "./build_all"

8. Will see the following error after build finished and it doesn't matter. You can find z-stack_linux_gateway_arm_binaries_.tar under /home/yk/Z-Stack_Linux_Gateway-1.0.1-src/Source/ERROR__out and you can scp z-stack_linux_gateway_arm_binaries_.tar to BBB to run/test it.




Monday, January 4, 2016

How to run TI Z-Stack Linux Home Gateway on BeagleBone Black with CC2530DK.

The following steps show you how to run TI Z-Stack Linux Home Gateway on BeagleBone Black with CC2530DK.

1. Add ENABLE_MT_SYS_RESET_SHUTDOWN to compile options of ZNP CC2530-ProdHex project and set znpCfg1 = ZNP_CFG1_UART in InitBoard().

2. Build it to get CC2530ZNP-Prod.hex under \Projects\zstack\ZNP\CC253x\dev and download it to CC2530DK using Flash Programmer.

3. Connect the following pins between CC2530DK UART (P0.2 as RX and P0.3 as TX) and BeagleBone Black UART4.

       CC2530DK UART RX P0.2 (P18 Pin9)   <-------> BBB UART4 TX (P9 Pin13)
       CC2530DK UART TX P0.3 (P18 Pin11) <-------> BBB UART4 RX (P9 Pin11)
       CC2530DK GND (P18 Pin20)                 <-------> BBB DGND (P9 Pin1)




4. Change devPath="/dev/ttyACM0" to devPath="/dev/ttyO4" in NPI_Gateway.cfg

5. Revise the followings in zigbeeHAgw.

    "ZBEE_SERIAL_PORT=ttyACM0" to "ZBEE_SERIAL_PORT=ttyO4"

    "../tools/gw_soc_fw_version_query.bin /dev/ttyACM0" to "../tools/gw_soc_fw_version_query.bin /dev/ttyO4"

6. Comment out the folllowing lines in in zigbeeHAgw.

    "../tools/bbb_usbreset.bin"
    "echo -n  " sleeping $hw_reset_sleep seconds after reset... ""
    "sleep $hw_reset_sleep"

7. Add the following line to /media/BEAGLEBONE/uEnv.txt to enable UART4 on BBB.

    optargs=quiet drm.debug=7 capemgr.enable_partno=BB-UART4

8. Restart BBB and make sure ttyO4 shows under /dev

9. run ./zigbeeHAgw bbb on current terminal and ./start_application on another to test TI Z-Stack Linux Home Gateway.

Wednesday, September 9, 2015

How to build Contiki 6lbr Slip Radio on CC2650 SensorTag or SmartRF06EB+CC2650EM

Do the following steps to build Contiki 6lbr Slip Radio for CC2650 SensorTag+CC-DEVPACK-DEBUGGER.

1. Change "#if BOARD_CONF_DEBUGGER_DEVPACK" to "#if 1" in \contiki\platform\srf06-cc26xx\sensortag\cc2650\board.h.

2. do "make clean".

3. do "make TARGET=srf06-cc26xx BOARD=sensortag/cc2650 slip-radio.bin".

4. Download slip-radio.bin to CC2650 SensorTag and connect CC2650 SensorTag+CC-DEVPACK-DEBUGGER to 6lbr router (could be Raspberry Pi or BeagleBone Black).

5. On 6lbr router, do "sudo vi /etc/6lbr/6lbr.conf" and make sure "DEV_RADIO=/dev/ttyACM0".

6. On 6lbr router, start 6lbr with "sudo service 6lbr start"


Do the following steps to build Contiki 6lbr Slip Radio for SmartRF06EB+CC2650EM.

1. do "make clean".

2. do "make TARGET=srf06-cc26xx BOARD=srf06/cc26xx slip-radio.bin".

3. Download slip-radio.bin to SmartRF06EB+CC2650EM and connect FT232 Serial-to-USB dongle to P412 on SmartRF06EB. Connect FT232 to 6lbr router (could be Raspberry Pi or BeagleBone Black).

4. On 6lbr router, do "sudo vi /etc/6lbr/6lbr.conf" and make sure "DEV_RADIO=/dev/ttyUSB0".

5. On 6lbr router, start 6lbr with "sudo service 6lbr start"


Thursday, September 3, 2015

Contiki SubG Hz 6LowPAN on CC1350

To test on Contiki SubG Hz 6LowPAN on CC1350, I use SmartRF06EB+CC1350EM with FT232 USB-to-Serial dongle to act as Slip Radio which is connected to Raspberry Pi (It also works on BeagleBone Black too).

1. Git the latest Contiki source code by using "git clone --recursive https://github.com/contiki-os/contiki".

2. Open /examples/ipv6/slip-radio/project-conf.h. Comment out the QUEUEBUF_CONF_NUM and UIP_CONF_BUFFER_SIZE and add "#define RF_CORE_CONF_CHANNEL 25"

#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
/*
 #undef QUEUEBUF_CONF_NUM
 #define QUEUEBUF_CONF_NUM          4

 #undef UIP_CONF_BUFFER_SIZE
 #define UIP_CONF_BUFFER_SIZE    140
*/

#define RF_CORE_CONF_CHANNEL                 25
#undef UIP_CONF_ROUTER
#define UIP_CONF_ROUTER                 0

3. Bulid slip-radio.bin using the following steps.
cd examples/ipv6/slip-radio
make clean
make TARGET=srf06-cc26xx BOARD=srf06/cc13xx slip-radio.bin

4. Flash slip-radio.bin to SmartRF06EB+CC1350EM using SmartRF Flash programmer 2.0.

5. Connect FT232 USB-to-Serial dongle to UART pins on SmartRF06EB and plug FT232 USB dongle to Raspberry Pi. You should see "ttyUSB0" get listed under /dev.

6. Refer to "Setup 6lbr to run 6LowPAN with CC2531 USB dongle on Raspberry Pi 2B" and revise "DEV_RADIO=/dev/ttyACM0" to "DEV_RADIO=/dev/ttyUSB0" in /etc/6lbr/6lbr.conf.

7. Use "sudo service 6lbr start" to start 6lbr and you can use Firefox to access to 6lbr web page ([bbbb:100]).




Then, I use anther SmartRF06EB+CC1350EM and a CC1350 SensorTag to act as Contiki SubG Hz 6LowPAN devices.

1. Build cc26xx-web-demo.bin for SmartRF06EB+CC1350EM and CC1350 SensorTag.
cd ../examples/cc26xx/cc26xx-web-demo
make clean
make TARGET=srf06-cc26xx BOARD=srf06/cc13xx cc26xx-web-demo.bin

2. Flash cc26xx-web-demo.bin to SmartRF06EB+CC1350EM and CC1350 SensorTag using SmartRF Flash programmer 2.0.


3. Check 6lbr Sensors web page and you will see these two device on it.