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

nRF51: IoT-MQTT example and Raspberry Pi 3

Hello,

I need a little help regarding IoT-SDK 0.8.0 on nRF51.

What I want to achive: Get the IoT-SDK 0.8.0 MQTT-Example running on nRF51 and publishing sensor data to a Raspberry Pi 3 using IPv6 and MQTT. Later, more sensor nodes should publish their data "simultaneously".

What my current situation is: I flashed the IoT-Softdevice along with the recompiled example code into the nRF51. On the Pi, I started with a freshly installed Debian Jessie lite. First, I installed the mosquitto broker and radvd (there was no bt0-device present at this point):

sudo su
apt-get install mosquitto
apt-get install radvd

After that, I created the config file for radvd:

nano /etc/radvd.conf

with the following content:

interface bt0
{
    AdvSendAdvert on;
    prefix 2001:db8::/64
    {
        AdvOnLink off;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

First question here: How do I know "my" prefix? Or is it always the same as in the example? Then I started radvd:

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
service radvd restart

After that, I found the nRF51-device using "hcitool lescan":

00:AB:C8:3A:XX:YY MQTTPublisher

Then I started the 6lowpan stack:

modprobe bluetooth_6lowpan
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

But there was still no bt0-device visible in the output of "ifconfig".

After that, I tried to establish the connection with

echo "connect 00:AB:C8:3A:XX:YY 2" > /sys/kernel/debug/bluetooth/6lowpan_control

but the board is not leaving the advertising mode nor is bt0 visible on the Pi.

Thats the point I am stuck at the moment. Can you tell me what I miss?

Thank you very much in advance!

Best Regards

Note: I already found this, unfortunately it did not solve my problem: devzone.nordicsemi.com/.../

Parents
  • Have you done this? From the nRF51 IoT SDK 0.8.0 documentation:

    debugfs file system

    In most Linux distributions, the debugfs file system is mounted to /sys/kernel/debug. However, Raspbian OS does not automatically mount the debugfs file system. Therefore, you must mount it manually before 6LoWPAN can use it:

    # Mount debugfs file system.
    mount -t debugfs none /sys/kernel/debug
    # Check the contents of the folder.
    ls /sys/kernel/debug
    

    To initialize the 6LoWPAN module, you must first load it:

    modprobe bluetooth_6lowpan
    

    Next, set the Protocol Service Multiplexer number (PSM) in the module. It must be set to the PSM of the Internet Protocol Support Profile (IPSP), which is 0x23 in hex or 35 decimal.

    To set the correct PSM number:

    echo 35 > /sys/kernel/debug/bluetooth/6lowpan_psm
    

    I would also try to use 1 instead of 2 in the connect command.

Reply
  • Have you done this? From the nRF51 IoT SDK 0.8.0 documentation:

    debugfs file system

    In most Linux distributions, the debugfs file system is mounted to /sys/kernel/debug. However, Raspbian OS does not automatically mount the debugfs file system. Therefore, you must mount it manually before 6LoWPAN can use it:

    # Mount debugfs file system.
    mount -t debugfs none /sys/kernel/debug
    # Check the contents of the folder.
    ls /sys/kernel/debug
    

    To initialize the 6LoWPAN module, you must first load it:

    modprobe bluetooth_6lowpan
    

    Next, set the Protocol Service Multiplexer number (PSM) in the module. It must be set to the PSM of the Internet Protocol Support Profile (IPSP), which is 0x23 in hex or 35 decimal.

    To set the correct PSM number:

    echo 35 > /sys/kernel/debug/bluetooth/6lowpan_psm
    

    I would also try to use 1 instead of 2 in the connect command.

Children
No Data
Related