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

nRF51: IoT-MQTT Publisher Example problems

Hi, I just read IoT-MQTT example and have almost exactly the same problem but with the Publisher. I am running a PI with Raspberian 4.4.34-v7+. I have installed mosquitto on the PI and have radvd installed. I turned on the IPV6 forwarding (echo 1 > /proc/sys/net/ipv6/conf/all/forwarding), did the config file and restarted radvd. This worked ONCE. I did get this:

sudo echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
root@raspberrypi:/home/pi# sudo service radvd restart
root@raspberrypi:/home/pi# ifconfig bt0
bt0       Link encap:UNSPEC  HWaddr B8-27-EB-FF-FE-F1-72-D4-00-00-00-00-00-00-00-00  
inet6 addr: 2001:db8::ba27:ebff:fef1:72d4/64 Scope:Global
inet6 addr: fe80::ba27:ebff:fef1:72d4/64 Scope:Link
UP POINTOPOINT RUNNING MULTICAST  MTU:1280  Metric:1
RX packets:47 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1 
RX bytes:1906 (1.8 KiB)  TX bytes:2808 (2.7 KiB)

This is with the Publisher connected to bt0. The publisher has the 2001:... address compiled in. I then run mosquitto -v on the PI but when I press button 1 all 4 LED's light up and stay lit showing it failed. I get no messages on mosquitto.

But now if I disconnect and re-connect bt0 does NOT have the global address anymore. I even re-booted the PI and did the whole sequence all over again starting with loading 6lowPAN and still it does not get the global address. Do you have any suggestions of what to try next.

And one more question. The disconnect does not work. When I try to do:

echo "disconnect 00:EF:0B:A4:88:A6" > /sys/kernel/debug/bluetooth/6lowpan_control 

I get a write error of invalid argument. That is the correct MAC.

Thank you for the help. --jim schimpf

Parents
  • Thank you again, my script is ( I have two boards)

    
    
    
    modprobe bluetooth_6lowpan
    
    
    echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
    
    
    hciconfig
    
    hciconfig hci0 reset 
    
    echo "Connecting.."
    
    echo "connect 00:EF:0B:A4:88:A6 1" > /sys/kernel/debug/bluetooth/6lowpan_control
    
    sleep 5
    
    echo "connect 00:CB:11:CB:73:15 1" > /sys/kernel/debug/bluetooth/6lowpan_control
    
    echo "Forwarding.."
    
    echo 1 >  /proc/sys/net/ipv6/conf/all/forwarding
    
    sleep 1
    
    service radvd restart
    
    sleep 1
    
    ifconfig bt0 add 2001:db8::1/64
    
    
    Also have you tried connecting to the log output of the Nordic board ?  I can connect but get only garbage at 115200, but nothing prints at 38400. Have tried on OSX and Windows and it's the same in both.
    
Reply
  • Thank you again, my script is ( I have two boards)

    
    
    
    modprobe bluetooth_6lowpan
    
    
    echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
    
    
    hciconfig
    
    hciconfig hci0 reset 
    
    echo "Connecting.."
    
    echo "connect 00:EF:0B:A4:88:A6 1" > /sys/kernel/debug/bluetooth/6lowpan_control
    
    sleep 5
    
    echo "connect 00:CB:11:CB:73:15 1" > /sys/kernel/debug/bluetooth/6lowpan_control
    
    echo "Forwarding.."
    
    echo 1 >  /proc/sys/net/ipv6/conf/all/forwarding
    
    sleep 1
    
    service radvd restart
    
    sleep 1
    
    ifconfig bt0 add 2001:db8::1/64
    
    
    Also have you tried connecting to the log output of the Nordic board ?  I can connect but get only garbage at 115200, but nothing prints at 38400. Have tried on OSX and Windows and it's the same in both.
    
Children
No Data
Related