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

MQTT Publisher problem : Socket error on client nrfPublisher, disconnecting. Platform used : nrf52DK & Raspberry Pi 3B.

Hello,

I have a problem with MQTT Publisher example on my nrf52832 DK.

1. I am using ubuntu & nordic's SDK15.2.0 for this mqtt example. On raspberry pi 3b I have installed Raspbian stretch lite.

2. I am able to connect device using: 

echo "connect XX:XX:XX:XX:XX:XX 1" > /sys/kernel/debug/bluetooth/6lowpan_contol

Basically I want to connect the nrf52 chip to IPv6 network via 6LoWPAN.

I am following procedure from this link :

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fiot_sdk_user_guides_mosquitto.html

I am able to execute commands until step 8; after that I wanted to ping nrf52dk using from raspberry.

I have scanned and connected ble device using following command successfully :

$hcitool lescan

$echo "connect <mac address from hcitool output> 1" > /sys/kernel/debug/bluetooth/6lowpan_control

root@raspberrypi:/home/pi# ifconfig bt0
bt0: flags=4161<UP,RUNNING,MULTICAST>  mtu 1280
        inet6 fe80::b827:ebff:fe38:5ac0  prefixlen 64  scopeid 0x20<link>
        unspec B8-27-EB-38-5A-C0-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 1  bytes 28 (28.0 B)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 24  bytes 2123 (2.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

then i derived link-local IPv6 address of the nRF52 device from its MAC address:

ping6 fe80::AA:BBff:feXX:YYZZ -I bt0

I can ping the device successfully.

but when I press button 1 on nrf52-dk, mosquitto shows following logs : 

New connection from 2001:db8::XX:XXff:feXX:XXXX on port 8883.
New client connected from 2001:db8::XX:XXff:feXX:XXXX as nrfPublisher (c1, k60).
Sending CONNACK to nrfPublisher (0, 0)
Client nrfPublisher has exceeded timeout, disconnecting.
Socket error on client nrfPublisher, disconnecting.

and on /dev/ttyACM0 it shows following logs :

[15:53:04:334] <info> app: Physical layer in connectable mode.

[15:53:04:338] <info> app: Application started.

[15:53:32:323] <info> app: Physical layer: connected.

[15:53:32:602] <info> app: IPv6 Interface Up.

[15:56:52:128] <info> app: >> MQTT_EVT_CONNACK, result 00000000

[15:56:52:178] <info> app: >> MQTT_EVT_DISCONNECT

what could be the reason ??

Regards,

Nilesh

 

Related