nRF9160 SLM MQTT Connection

Hi all,

I am using and nrf9160, in particular a thingy91. It is running 1.3.7 firmware.  I have the SLM sample loaded and can sent AT commands to the device using the nRF Serial Terminal and Cellular Monitor applications. 

I have been successful connecting to test.mosquitto.org through AT commands using port 8883 and a certificate loaded using the Cellular Monitor certificate manager.

I am now trying to connect to a hiveMQ cloud server. I followed the same steps but have not been able to connect. The AT#XMQTTCON just returns ERROR

I have seen a few articles that show this exact connection setup but I have not had any luck. Any help would be great.

Thanks!

Parents
  • Hi Kevin,
    Have you tried connecting to HiveMQ using one of the simpler MQTT samples?


  • Hi Benjamin,

    I tried the connection with the MQTT sample from ncs 2.8.0. Looks like the connection is refused. 

    I had to modify the example to use the username and password. I edited the transport.c file and added to the conn_params variable:

    struct mqtt_helper_conn_params conn_params = {
            .hostname.ptr = "myServerAddress",
            .hostname.size = strlen("myServerAddress"),
            .device_id.ptr = client_id,
            .device_id.size = strlen(client_id),
            .user_name.ptr = "Username",
            .user_name.size = strlen("Username"),
            .password.ptr = "Password",
            .password.size = strlen("Password"),
        };
    Is it possible that this is an issue with the certificate? I have used it with other devices and had no issue (ESP32 over wifi and Quectel BG95 LTE).
    I have had problems in the past with Server Name Indication (SNI)  when connecting to these hiveMQ servers. Any way to tell why the connection is refused?
    Thanks for the help,
    Kevin
  • I was able to get the connection to work, both with the MQTT sample and the SLM. Looks like it was the certificate was incorrect.

    Thanks for the help anyways.

Reply Children
No Data
Related