Showing posts with label rpl-border-router. Show all posts
Showing posts with label rpl-border-router. Show all posts

Thursday, April 19, 2018

How to build and run Contiki-NG cc26xx-web-demo running on LAUNCHXL-CC1310 and rpl-border-router on Raspberry Pi with slip radio running on LAUNCHXL-CC1310

The following steps show how to build and run Contiki-NG cc26xx-web-demo running on LAUNCHXL-CC1310 (or LAUNCHXL-CC2650) and rpl-border-router on Raspberry Pi with slip radio running on LAUNCHXL-CC1310 (or LAUNCHXL-CC2650) .

1. Do "git clone --recursive https://github.com/contiki-ng/contiki-ng" on your InstantContiki or Cygwin (you can build Cygwin develop environment according to here)

2. Build slip radio for LAUNCHXL-CC1310

  • 2.1 Change directory to contiki-ng/examples/slip-radio
  • 2.2 Add "#define IEEE802154_CONF_DEFAULT_CHANNEL 25" to project-conf.h
  • 2.3 Build slip-radio.bin by "make TARGET=srf06-cc26xx BOARD=launchpad/cc1310 slip-radio.bin"
  • 2.4 Download slip-radio.bin to one of LAUNCHXL-CC1310 to act as slip radio for usage of rpl-border-router.
3. Build cc26x0-web-demo for LAUNCHXL-CC1310

  • 3.1 Change directory to contiki-ng/examples/platform-specific/cc26xx/cc26x0-web-demo
  • 3.2 Make sure "#define IEEE802154_CONF_DEFAULT_CHANNEL 25" is defined in project-conf.h
  • 3.3 Build cc26xx-web-demo.bin by "make TARGET=srf06-cc26xx BOARD=launchpad/cc1310 cc26xx-web-demo.bin"
  • 3.4 Download cc26xx-web-demo.bin to another of LAUNCHXL-CC1310 to connect with rpl-border-router later.
4. Build and run rpl-border-router on Raspberry Pi
  • 4.1 Do "git clone --recursive https://github.com/contiki-ng/contiki-ng" on your Raspberry Pi.
  • 4.2 Change directory to contiki-ng/examples/rpl-border-router
  • 4.3 Build border-router.native by "make TARGET=native all"
  • 4.4 Connect LAUNCHXL-CC1310 (running slip radio) to Raspberry Pi and make sure it emulates ttyACM0.
  • 4.5 Run rpl-border-router by "sudo ./border-router -native fd00::1/64 -s /dev/ttyACM0"

5. You can type "help" on rpl-border-router console to know more available commands.



6. You can login to Raspberry Pi using another terminal and do "ping6 fd00::212:4b00:e00:cc00" to see reply from rpl-border-router.


6. Power on cc26xx-web-demo on another LAUNCHXL-CC1310. The green led on LAUNCHXL-CC1310 should blink fast in the beginning. When you see green led blinking slows down, it means cc26xx-web-demo joins rpl-border-router.

7. You can type "ip-nbr" on rpl-border-router console to know reachable nodes.



8. Now, you can do "ping6 fd00::212:4b00:a27:f319" (fd00::212:4b00:a27:f319 is the IPv6 address of cc26xx-web-demo) and see reply from cc26xx-web-demo.




Wednesday, November 11, 2015

How to build/set Contiki rpl-border-router on SmratRF06EB+CC1350EM and run tunslip6

The following steps show how to build/set Contiki rpl-border-router on SmratRF06EB+CC1350EM and run tunslip6 in Contiki VMPlayer.
1. Go to "/contiki/examples/ipv6/rpl-border-router" directory and change "#define DEBUG DEBUG_NONE" to "#define DEBUG DEBUG_PRINT" in border-router.c. Also remember to add "#define RF_CORE_CONF_CHANNEL 25" in project-conf.h to set default channel to 25 (If you don't add this, it will use channel 0 which is defined in contiki-conf.h under /contiki/platform/srf06-cc26xx. It might have problem that a SensorTag use channel 25 to join later.)

2. Do "make TARGET=srf06-cc26xx BOARD=srf06/cc13xx" in terminal and you will get border-router.bin. Download border-router.bin to your SmratRF06EB+CC1350EM with Flash Programmer 2.

3. Connect USB cable and turn on SmratRF06EB+CC1350EM.

4. Run the following commands in Linux terminal of Contiki VMPlayer to enum ttyUSB0 and ttyUSB1 under /dev
    sudo modprobe ftdi_sio vendor=0x403 product=0xa6d1
    sudo chmod 777 /sys/bus/usb-serial/drivers/ftdi_sio/new_id
    sudo echo 0403 a6d1 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

5. Go to "/contiki/tools" directory and do " make tunslip6"

6. Run "sudo ./tunslip6 aaaa::1/64 -s /dev/ttyUSB1" and you will see tunslip6 running.





7. Press "EM RESET" button on SmratRF06EB to make rpl-border-router reset to dump
 Server IPv6 addresses which is aaaa:212:4b00:7c6:2b02 in my test.




8. Open FireFox in VMPlayer and go [aaaa:212:4b00:7c6:2b02]. You will see the web page of rpl-border-router.



9. Start a CC1350 SensorTag and you will see it joins rpl-border-router. The IPv6 address of my CC1350 SensorTag is aaaa::212:4b00:7c7:bf02 in my test.



10. Use coap://[aaaa::212:4b00:7c7:bf02] to access coap server on CC1350 SensorTag.