Thursday, April 19, 2018

Build and run 6lbr/Contiki-NG cc26xx-web-demo on Rasperry Pi with LAUNCHXL-CC1310/LAUNCHXL-CC2650

The following steps show how to build and run 6lbr/Contiki-NG cc26xx-web-demo on Rasperry Pi with LAUNCHXL-CC1310/LAUNCHXL-CC2650:

1. Build Contiki-NG slip radio for LAUNCHXL-CC1310 on InstantContiki 3.0 or Cygwin (you can refer here to setup Cygwin build environment)
  • 1.1 Do "git clone --recursive https://github.com/contiki-ng/contiki-ng"
  • 1.2 Switch to directory contiki-ng/
  • 1.3 Do "git submodule sync" and "git submodule update --init"
  • 1.4 Switch to directory contiki-ng/examples/slip-radio
  • 1.5 Since 6lbr/Contiki-NG only supports RPL-CLASSIC now, we use "make TARGET=cc26x0-cc13x0 srf06-cc26xx BOARD=launchpad/cc1310 MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC  slip-radio.bin" to build slip radio for LAUNCHXL-CC1310.
  • 1.6 Download slip-radio.bin to one LAUNCHXL-CC1310 to act as slip radio for Raspberry Pi later.

2. Build Contiki-NG cc26x0-web-demo for LAUNCHXL-CC1310 on InstantContiki 3.0 or Cygwin
  • 2.1 Apply Fixing cc26xx 6lbr client example patch first.
  • 2.2 Switch to directory contiki-ng/examples/platform-specific/cc26xx/cc26x0-web-demo
  • 2.3 Since 6lbr/Contiki-NG only supports RPL-CLASSIC now, we use "make TARGET=srf06-cc26xx BOARD=launchpad/cc1310 MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC  cc26xx-web-demo.bin" to build cc26xx-web-demo for LAUNCHXL-CC1310.
  • 2.4 Download cc26xx-web-demo.bin to another LAUNCHXL-CC1310 to join Raspberry Pi 6lbr later.

3. Build 6lbr/Contiki-NG on Rasperry Pi
  • 3.1 SSH login to Raspberry Pi.
  • 3.2 Change directory to home folder and git clone --recursive https://github.com/cetic/6lbr.git
  • 3.3 Change directory to 6lbr folder and do "git submodule update --init" git checkout contiki-ng
  • 3.4 Change directory to home folder and git clone --recursive https://github.com/cetic/contiki-ng.git
  • 3.5 Change directory to contiki-ng folder and do "git submodule update --init" git checkout sixlbr
  • 3.6 Change directory to 6lbr/examples/6lbr folder and run the following build command
    "make WITH_CONTIKI=0 CONTIKI=~/contiki-ng WERROR=0 all"
  • 3.7  After build successfully, do "sudo make install". You will see "install: cannot stat ‘tools/nvm_tool’: No such file or directory" issue since nvm_tool doens't make properly for current version. It might be fixed later but you can use nvm_tool built by previous 6lbr to do the following steps.
  • 3.8 Run "sudo /usr/lib/6lbr/bin/nvm_tool --update --channel 25 /etc/6lbr/nvm.dat" to change 6lbr/Contiki-NG to use channel 25.
  • 3.9 Run "/usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat" to make sure it switches to channel 25.
  • 3.10 Connect LAUNCHXL-CC1310 running slip radio to Raspberry Pi.
  • 3.11 Run "sudo service 6lbr start" to start 6lbr/Contiki-NG and you can use Firefox to access to [bbbb::100]


 4. Power on LAUNCHXL-CC1310 running cc26xx-web-demo and you will see it pops on sensors tab of 6lbr web page. You can test http or coap function on cc26xx-web-demo now.






26 comments:

  1. Hi,
    I cannot get to build the 6lbr using
    make WITH_CONTIKI=0 CONTIKI=../../../contiki-ng all

    it returns these errors

    ../../../contiki-ng/os/services/ip64/ip64-arp.c:97:23: error: ‘broadcast_ipaddr’ defined but not used [-Werror=unused-const-variable=]
    static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff};
    ^~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    ../../../contiki-ng/Makefile.include:271: recipe for target 'obj_native/ip64-arp.o' failed
    make[2]: *** [obj_native/ip64-arp.o] Error 1
    make[2]: Leaving directory '/home/pi/6lbr/examples/6lbr'
    platform/native/Makefile.native:58: recipe for target 'bin/cetic_6lbr_smart_bridge' failed
    make[1]: *** [bin/cetic_6lbr_smart_bridge] Error 2
    make[1]: Leaving directory '/home/pi/6lbr/examples/6lbr'
    platform/native/Makefile.native:93: recipe for target 'all' failed
    make: *** [all] Error 2

    please help

    ReplyDelete
    Replies
    1. Where do you build this? Raspberry Pi?

      Delete
    2. You can comment out the line "static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff};" in contiki-ng/os/services/ip64/ip64-arp.c to fix the issue.

      Delete
  2. Hi! I followed the same instructions ,but the web page is not showing up.

    ReplyDelete
    Replies
    1. Before you do step 3.10, you should refer to https://sunmaysky.blogspot.tw/2015/08/setup-6lbr-to-run-6lowpan-with-cc2531.html to do steps 10 to 12.

      Delete
    2. Even after following all the steps,it does not make anthing, the web page is also not showing up.

      pi@raspberrypi:~ $ sudo service 6lbr start
      pi@raspberrypi:~ $

      I used R-pi 3B+
      And I have these questions as well.
      1.In 6lbr.conf file is it to replace the whole file with what is given or only to edit it?
      2.In slip radio,"Apply Fixing cc26xx 6lbr client example patch" there's nothing to fix in the recent contiki-ng version

      Delete
    3. Try to check what is in your /var/log/6lbr.log

      Delete
    4. It says it has started the 6lbr :6LBR: Starting 6LBR version 1.5.x
      But has the following errors.
      ERROR: SLIP: Unknown command
      ERROR: BR-RDC: Set channel failed
      ERROR: BR-RDC: Set PAN-ID failed

      Delete
    5. This means there’s something wrong in your slip radio.

      Delete
    6. Yeah. There's an issue with the pan ID of the contiki and the 6lbr.In examples/6lbr/project-conf.h I cannot find where the PANID is defined.
      It should ideally show this.ie:
      #undef IEEE802154_CONF_PANID
      #define IEEE802154_CONF_PANID 0xABCD But when I checked the conf file I cannot find it.

      Delete
    7. I don’t think this matters. Do you build slip radio successfully and download to your LAUNCHXL-CC1310 to connect to Raspberry Pi.

      Delete
    8. Now the 6lbr web page is running but the node is not getting connected as a sensor. Do I need to follow https://sunmaysky.blogspot.com/2017/10/how-to-configure-6lbr-to-make-it-can-do.html ? When I followed it the Pi 3B+ gets stucked.

      Delete
    9. What example do you run on your sensor node?

      Delete
    10. Make sure you use the same channel on both 6lbr and cc26xx-web-demo. By the way, this blog isn’t intend for discussions. Please post your questions or problems to https://e2e.ti.com/support/wireless_connectivity/zigbee_6lowpan_802-15-4_mac/f/158

      Delete
  3. So to build for launchpad cc2650 I change "laucnhpac/cc1310" to "launchpad/cc2650" in the make command?

    ReplyDelete
    Replies
    1. Would it hypothetically work on cc2640R2 aswell with this?

      Delete
  4. what is the reason of using channel 25 ?

    ReplyDelete
  5. hi am using cc2650 launchxl board. I replaced cc1310 by cc2650 because i am using cc2650
    make TARGET=srf06-cc26xx BOARD=launchpad/cc2650 MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC slip-radio.bin
    it is giving an error
    user@instant-contiki:~/contiki-ng/examples/slip-radio$ make TARGET=srf06-cc26xx BOARD=launchpad/cc2650 MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC slip-radio
    CC ../../arch/cpu/cc26xx-cc13xx/lib/cc26xxware/startup_files/ccfg.c
    CC ../../arch/cpu/cc26xx-cc13xx/./ieee-addr.c
    CC ../../arch/cpu/cc26xx-cc13xx/./fault-handlers.c
    CC ../../arch/cpu/cc26xx-cc13xx/lib/cc26xxware/startup_files/startup_gcc.c
    CC slip-radio.c
    LD slip-radio.elf
    obj_srf06-cc26xx/platform.o: In function `platform_init_stage_three':
    platform.c:(.text.platform_init_stage_three+0xb0): undefined reference to `prop_mode_driver'
    obj_srf06-cc26xx/rf-core.o: In function `process_thread_rf_core_process':
    rf-core.c:(.text.process_thread_rf_core_process+0x50): undefined reference to `prop_mode_driver'
    obj_srf06-cc26xx/netstack.o: In function `netstack_init':
    netstack.c:(.text.netstack_init+0x18): undefined reference to `prop_mode_driver'
    obj_srf06-cc26xx/csma.o: In function `on':
    csma.c:(.text.on+0x8): undefined reference to `prop_mode_driver'
    obj_srf06-cc26xx/csma.o: In function `off':
    csma.c:(.text.off+0x8): undefined reference to `prop_mode_driver'
    obj_srf06-cc26xx/csma.o:csma.c:(.text.input_packet+0xc0): more undefined references to `prop_mode_driver' follow
    collect2: error: ld returned 1 exit status
    make: *** [slip-radio.elf] Error 1
    rm slip-radio.o obj_srf06-cc26xx/fault-handlers.o obj_srf06-cc26xx/startup_gcc.o

    Can anyone help?

    ReplyDelete
  6. step 1
    $ make TARGET=srf06-cc26xx BOARD=launchpad/cc1310 MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC
    ../../Makefile.include:92: *** The target platform "srf06-cc26xx" does not exist (maybe it was misspelled?). Stop.

    ReplyDelete
  7. All the example processes are working (MQTT, NET UART, ... etc.) except the CoAP
    I run the network, and then in Chrome (on the RaspberryPi) I try: coap://[fd00::212:4b00:1375:c101]/5683 it doesn't connect to the node, meanwhile I ping the node from the terminal and it responds, also I can send Mqtt msgs and the node responds.

    Do I need to install anything else beside 6lbr on the Pi?

    ReplyDelete
  8. I was trying to build 6lbr on my ras pi 3b+ but I am getting this error,
    looks like the one repository is missing when i am trying to do this, "git clone --recursive https://github.com/cetic/6lbr.git".

    and I could not find this repository "https://github.com/STclab/stm32nucleo-spirit1-lib"

    I am getting this error, can anybody help me?
    also it is asking for authentication.

    Cloning into '/home/praty404/Desktop/6lbr/platform/stm32nucleo-spirit1/stm32cube-lib'...
    Username for 'https://github.com':...
    Password for 'https://...@github.com':
    remote: Support for password authentication was removed on August 13, 2021.
    remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
    fatal: Authentication failed for 'https://github.com/STclab/stm32nucleo-spirit1-lib/'
    fatal: clone of 'https://github.com/STclab/stm32nucleo-spirit1-lib' into submodule path '/home/praty404/Desktop/6lbr/platform/stm32nucleo-spirit1/stm32cube-lib' failed
    Failed to clone 'platform/stm32nucleo-spirit1/stm32cube-lib' a second time, aborting
    praty404@raspberrypi:~/Desktop $

    ReplyDelete
    Replies
    1. praty404@raspberrypi:~/Desktop/6lbr/examples/6lbr $ make WITH_CONTIKI=0 WERROR=0 all
      make TARGET=native CETIC_6LBR_CUSTOM=1 clean
      make[1]: Entering directory '/home/praty404/Desktop/6lbr/examples/6lbr'
      Makefile:201: CoAP Server is not supported with Contiki-NG
      Makefile:516: ../../../contiki-ng/Makefile.include: No such file or directory
      make[1]: *** No rule to make target '../../../contiki-ng/Makefile.include'. Stop.
      make[1]: Leaving directory '/home/praty404/Desktop/6lbr/examples/6lbr'
      make: *** [Makefile:471: clean] Error 2

      This is the error I am getting when trying to make the example
      Command: "make WITH_CONTIKI=0 WERROR=0 all"

      Delete