MQTT connection fails over NB-IoT using nRF9151 DK and Serial Modem

Hello Nordic Support Team,

I am experiencing an issue when using MQTT over an NB-IoT connection with the nRF9151 DK, and I would like to ask for clarification and guidance.

Setup:

- Hardware: nRF9151 DK
- Zephyr version 3.2.1
- Firmware: Nordic Serial Modem (used to control the device via AT commands)
- Protocol: MQTT
- Broker: test.mosquitto.org (public test broker)
- SIM: 1NCE - confirmed to support NB-IoT in my region

Description of the issue:
I am using the MQTT API through AT commands (docs.nordicsemi.com/.../at_mqtt.html) to connect to an MQTT broker.
When the modem is configured to use LTE, the MQTT connection works correctly and I am able to connect, publish, and subscribe without issues.

However, when the modem is configured to use NB-IoT, the MQTT connection fails and the connection to the broker cannot be established. The same configuration, commands, and broker are used, with the only difference being the access technology (NB-IoT instead of LTE).

What I have verified:

- The SIM card supports NB-IoT in my geographic area
- Network registration to NB-IoT is successful: i verify this by looking for valid PSM timer values ​​in AT+CEREG unsolicited notifications

Are there known limitations or specific requirements when using MQTT over NB-IoT with the Serial Modem on nRF9151?
Is MQTT over TCP fully supported over NB-IoT in this setup, or are there known constraints depending on the network or broker?

Any guidance, documentation references, or recommended configuration for using MQTT over NB-IoT would be greatly appreciated.

Thank you for your support.

Best regards,
Federica

  • Hi Federica,

     

    Could you share a log of what occurs (and possibly a modem trace)?

    If the RSRP (signal strength) is low, it can be problematic as you will get a heavily reduced overall throughput if retransmissions occur on-air (CE level increases).

    Are there known limitations or specific requirements when using MQTT over NB-IoT with the Serial Modem on nRF9151?

    TCP based communication tend to suffer in terms of timeout, due to the lower overall throughput on NB-IoT as compared to LTE M1.

    Other than that, there is no technical reason why it should not work; but you will see a difference in terms of robustness, especially when coverage is bad.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thank you for your support.
    I was able to solve the problem by reviewing other tickets on this portal: I found that the device needed to be configured to use PCO instead of EPCO (which is the default option in the Serial Modem firmware). After setting the command AT%XEPCO=0, the MQTT connection was successfully established.

    At the moment, I have not experienced any timeout-related issues. However, since the system will need to be replicated on a larger scale, it would be better to prevent future issues.

    For this reason, I would appreciate receiving documentation or reference material regarding CoAP management via AT commands. Unlike MQTT, I didn't find a dedicated section for CoAP in the Serial Modem AT command documentation.

    Any guidance or documentation you can share would be greatly appreciated.

    Best regards,
    Federica

  • Hi Federica,

     

    feda said:
    Thank you for your support.
    I was able to solve the problem by reviewing other tickets on this portal: I found that the device needed to be configured to use PCO instead of EPCO (which is the default option in the Serial Modem firmware). After setting the command AT%XEPCO=0, the MQTT connection was successfully established.

    Glad to hear that you found the root cause of the issue.

    feda said:
    For this reason, I would appreciate receiving documentation or reference material regarding CoAP management via AT commands. Unlike MQTT, I didn't find a dedicated section for CoAP in the Serial Modem AT command documentation.

    Any guidance or documentation you can share would be greatly appreciated.

    Serial Modem does not expose a CoAP AT command set, unfortunately. Here is the overall socket commands that are covered:

    https://docs.nordicsemi.com/bundle/addon-serial_modem-latest/page/index.html

    Specific protocols, like lwm2m carrier library, are possible to enable, but these are higher level application specific functions.

    However, you can setup a generic udp (datagram) socket. 

     

    An alternative is to use the coap client:

    https://docs.nordicsemi.com/bundle/ncs-3.2.2/page/nrf/samples/net/coap_client/README.html

     

    Kind regards,

    Håkon

Related