This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Configure 6lowpan router using Ubuntu 16.04 laptop with nRF52840 dongle.

Having trouble using a Raspberry Pi 3 as BLE/6LowPAN router in the IoT MQTT example project from nrf5_sdk_15.2.0 

I was recommended to use Ubuntu box instead of Raspian(it has not been updated for a long time!??)

Linux kernel version on Ubuntu box is 4.4.0 so it has build-in support for 6lowpan. 

root@toby:/home/plp# modprobe bluetooth_6lowpan

root@toby:/home/plp# service radvd restart

??? These echo works fine..

root@toby:/home/plp# echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
root@toby:/home/plp# echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

?? Somehow this echo command is not supported as root. What is the difference!

root@toby:/home/plp# echo "connect 00:3e:e4:87:d3:fb 1" > /sys/kernel/debug/bluetooth/6lowpan_control
bash: echo: write error: Operation not supported
root@toby:/home/plp# sudo echo "connect 00:3e:e4:87:d3:fb 1" > /sys/kernel/debug/bluetooth/6lowpan_control
echo: write error: Operation not supported

In normal mode permission is denied! That was expected

plp@toby:~$ sudo echo 'connect 00:3e:e4:87:d3:fb 1' > /sys/kernel/debug/bluetooth/6lowpan_control
bash: /sys/kernel/debug/bluetooth/6lowpan_control: Permission denied


How can I get command to work: echo "connect 00:3e:e4:87:d3:fb 1" > /sys/kernel/debug/bluetooth/6lowpan_control   ???

What are the HW and SW components that Nordic used to verify this example project?

Have someone tried Ubuntu Core or Ubuntu Mate on Rpi3 to use if as 6lowpan router?

Parents
  • plp@toby:~$ sudo su
    [sudo] password for plp:
    root@toby:/home/plp# mount -t debugfs none /sys/kernel/debug
    mount: none is already mounted or /sys/kernel/debug busy
    root@toby:/home/plp# ls /sys/kernel/debug
    acpi dynamic_debug iwlwifi pm_qos suspend_stats
    aufs extfrag kprobes pstate_snb tracing
    bdi fault_around_bytes kvm pwm usb
    bluetooth frontswap kvm-guest ras virtio-ports
    cleancache gpio mce regmap wakeup_sources
    clk ieee80211 mei0 regulator x86
    dma_buf intel_powerclamp pinctrl sched_features zswap
    dri iosf_sb pkg_temp_thermal sleep_time
    root@toby:/home/plp# modprobe bluetooth_6lowpan
    root@toby:/home/plp# echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
    root@toby:/home/plp# hciconfig
    hci0: Type: BR/EDR Bus: USB
    BD Address: BC:77:37:31:6A:0E ACL MTU: 310:10 SCO MTU: 64:8
    UP RUNNING PSCAN ISCAN
    RX bytes:1142 acl:0 sco:0 events:66 errors:0
    TX bytes:3657 acl:0 sco:0 commands:65 errors:0

    root@toby:/home/plp# hciconfig hci0 reset
    root@toby:/home/plp# hcitool lescan
    Set scan parameters failed: Connection timed out
    root@toby:/home/plp#

    I have the nrf52840 dongle pluged in while running the commands.

    root@toby:/home/plp# lsmod
    Module Size Used by
    bluetooth_6lowpan 20480 0
    6lowpan 20480 8 nhc_fragment,nhc_hop,nhc_udp,bluetooth_6lowpan,nhc_dest,nhc_ipv6,nhc_mobility,nhc_routing


    plp@toby:~$ lsusb
    Bus 002 Device 003: ID 8086:0189 Intel Corp.
    Bus 002 Device 009: ID 1915:521f Nordic Semiconductor ASA
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 003: ID 04f2:b213 Chicony Electronics Co., Ltd Fujitsu Integrated Camera
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    plp@toby:~$

    Any suggestion to solve "Set scan parameters failed: Connection timed out" ?

    Thanks

  • I'm not sure I understand exactly what you are trying to do. You mention laptop in the subject, but Raspberry Pi in the text. Are you using a laptop, and does it have an integrated bluetooth card that support Bluetooth Low Energy, or are you trying to use the nRF52840 dongle to connect to the MQTT example? Or are you using a Raspberry Pi 3?

    Note that the dongle does not come with any HCI firmware, and this is only available from Nordic through Zephyr OS. If the dongle "breathe" red, this normally means that it is in bootloader mode and that no firmware have been programmed.

    I have only tried 6lowpan together with Raspberry Pi 3 running Raspbian, and this have worked well.

  • Sorry I will provide more details. 

    I would like to verify the IoT MQTT example from SDK 15.2.0 and first I tried with Raspberry Pi 3 running Raspbian 4.14.79 (newest noobs 3.0.0) as the 6lowpan router with a nrf52840DK as Publisher endnode and a Ubuntu Linux PC as MQTT broker.

    It worked as far as establish BLE connection and IPv6 link was up between endnode and router, but could not get MQTT connection to work (LED2 on LED1 off)

    see https://devzone.nordicsemi.com/f/nordic-q-a/43393/setting-up-a-raspberry-pi-3-as-iot-ble-6lowpan-border-router-using-an-nrf52840-dongle-pca10059-where-is-the-router-program-that-should-run-on-the-rpi3

    I asked about the raspberry pi 3 6lowpan router , and his answer assumed my question was about the Broker on a raspberry pi or something.

    Anyway I could not get the Raspberry pi partly to work as a 6lowpan router, so I am trying alternative way like using a Ubuntu Laptop with the nrf52840 dongle plugged in.

    So you have used a "Raspberry Pi 3 and this have worked well" ! Have you tested it with the IoT MQTT publisher example? Or could you , please?

    For more background info

    devzone.nordicsemi.com/.../222408

  • Did you have IPv6 connectivity between the Raspberry Pi and the Ubuntu Linux PC? Are you running the MQTT example on the nRF52840 dongle?

  • No right now i can't ping6 my linux pc from Raspberry pi, ping6 ::ffff:c0a8:0073 => "Ping: sendmsg: Network is unreachable"

    and yes I am running MQTT example on the nRF52840 dongle attached to Raspberry pi as 6lowpan router. Using nrf52840DK as Publisher endnode, and Ubuntu Laptop as Mosquitto MQTT Broker.

    Thanks for the clue

  • I have IPv6 connection to nrf52840DK publisher over bt0

    root@raspberrypi:~# ping6 -I bt0 fe80::3e:e4ff:fe87:d3fb -c 2
    PING fe80::3e:e4ff:fe87:d3fb(fe80::3e:e4ff:fe87:d3fb) from fe80::b827:ebff:fefb:61f0%bt0 bt0: 56 data bytes
    64 bytes from fe80::3e:e4ff:fe87:d3fb%bt0: icmp_seq=1 ttl=255 time=88.7 ms
    64 bytes from fe80::3e:e4ff:fe87:d3fb%bt0: icmp_seq=2 ttl=255 time=62.6 ms

    root@raspberrypi:~# ifconfig bt0 add 2001:db8::1/64
    root@raspberrypi:~# ifconfig
    bt0: flags=4161<UP,RUNNING,MULTICAST> mtu 1280
    inet6 2001:db8::1 prefixlen 64 scopeid 0x0<global>
    inet6 fe80::b827:ebff:fefb:61f0 prefixlen 64 scopeid 0x20<link>
    unspec B8-27-EB-FB-61-F0-28-FD-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
    RX packets 5 bytes 157 (157.0 B)
    RX errors 0 dropped 2 overruns 0 frame 0
    TX packets 32 bytes 3184 (3.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

  • Is it a firm requirement to have IPv6 connectivity between Raspberry Pi BLE 6LoWPAN router and the MQTT Broker to get this MQTT example project to work? Is there any nRF52 MQTT soution available for IPv4?

Reply Children
Related