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

Making MQTT Publisher example work on Raspberry Pi 4

Hi, like the title says I am having trouble implementing the MQTT Publisher example found in the nRF5 SDK for Thread and Zigbee v4.1.0 . I'm using a Raspberry Pi 4 with the latest Raspbian OS available (Kernel version 5.10). For the BLE device I'm using a BMD-340 Evaluation Board which has the nRF52840 chip.

I want to make the example work without TLS (It doesn´t work using TLS either but I figured trying to make the simplest version work first and then add TLS).

I followed this guide for the changes needed to make the example work without TLS, and this one for checking all the settings corresponding to the Raspberry Pi (except those corresponding to kernel building given that for newer versions it is not necessary because modules are already present), from that guide I also read that I had to set BLE_6LOWPAN_LEGACY_MODE in sdk_config.h to 0 because of kernel version being newer than 4.12.

The BLE connection sets up fine, I can see bt0 interface with the 2001:db8::1/64 IP and I can ping the device just fine. The problem seems to be related to the mqtt connection.

When trying to connect to the MQTT broker, it detects the connection:

[10:37:21]: New connection from 2001:db8::70:dfff:fe39:d5e8 on port 1883.
[10:37:21]: New client connected from 2001:db8::70:dfff:fe39:d5e8 as nrfPublisher (p1, c1, k60).                        
[10:37:21]: No will message specified.
[10:37:21]: Sending CONNACK to nrfPublisher (0, 0)                                                                      
[10:38:51]: Client nrfPublisher has exceeded timeout, disconnecting. 

but from the device I get an error:

I am using tshark to check Raspberry Pi's incoming and outcoming packets and a sniffer to check the connection on air and it seems like TCP packets from the Raspberry Pi are not getting to air.

I'll attach the full captures, but what the sniffer sees is this:

and packets from the Raspberry Pi are seen like this:

Because the guide may have not been updated recently I'm thinking maybe there is some configuration missing somewhere, I'd appreciate any help.

Thanks

NOTLS_Sniffer1.pcapngNOTLS_tshark1.pcapng

Parents Reply Children
No Data
Related