Nordic 91X - Incorporating NRF CLOUD and custom MQTT Broker

Hi all,

Our company is currently prototyping with the Nordic 91X DK and looking to use both nrf cloud services specifically for using location services whilst also connecting to a third-party mqtt broker for telemetry streaming, our hope is to be able to get the device to push data in the order of seconds to our custom client. We have looking to adapt the nrf cloud multi service sample. We are using the mqtt specific api and have followed the setup for onboarding setup as described by the nrfcloud-utils documentation for the following repo: https://github.com/nRFCloud/utils.

We have been having some issues with configuring the device for both custom mqtt endpoints and nrf cloud due to ssl certificate conflicts. We were wondering how others have configured their devices for similar use cases? I.e. which api are you using, how best to manage the certificates etc. Alternatively, is there a currently working sample application better suited for the 91X DK? 


Parents Reply Children
  • Have you had a look at the mqtt_helper library?

    It supports using two sec tags when establishing connection: https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/mqtt_helper/mqtt_helper.c#L498

    You would want credentials stored in two sec tags, eg tag 1001 contain nrfcloud creds, while tag 1002 contains custom_mqtt_creds. Setting Kconfigs

    CONFIG_MQTT_HELPER_SEC_TAG=1001

    CONFIG_MQTT_HELPER_SECONDARY_SEC_TAG=1002

    allows connecting to both. Though I see you want two concurrent mqtt connections, and I don't think we have any good samples for this scenario unfortunately.

    Regards,

    Elfving

  • Thats all good Elfving. Thats very helpful, thankyou.

    I have a follow up question regarding setting up nrf cloud alongside a third party mqtt broker. We have been able to get it to connect to nrf cloud alongside a third party broker (without TLS certificates) but have some issues maintaining a reliable network connection to both when incorporating gnss location services. We want to be able to use the modem gnss mode and get hot and cold fixes for gnss whilst periodically sending these updates back to our broker.

    We have been having some trouble with the modem struggling to handle sudden changes for gnss acquisition and network connectivity for shorter streaming intervals (10's of seconds). In our case, we want to be able to have short periods of constant, high rate streaming alongside gnss location updates. Should we need to consider changing the power-saving mode for the device and ensure some polling mechanism as to not cause too much interference with the modem? Currently looking to get some indication of what maximum streaming rate we should reasonably expect with this architecture for the base 91X Development Kit.

    Thanks again

    Andre

  • Hello Andre, and sorry about the wait. I've been OOO for a while. 

    I would need to ask someone about this, who I see is also currently OOO, and will be back mid next week. Would it be okay if I try to get an answer for you sometime after then? If not, let me know, and I'll try to find someone else.

    Regards,

    Elfving

  • Got a response here:

    For this use-case, I think it would be beneficial for them to use only one MQTT connection. I would suggest that they send everything over that one connection, and then rather have cloud-to-cloud communication to get data from one service to the other. TLS connections are generally expensive both in terms of resources on the device and network data cost, so customers typically want to reduce it as much as possible.

    When it comes to "streaming intervals" in their application, it mostly depends on the GNSS time to fix. If the device has clear view to satellites, decent antenna performance and has up-to-date A-GNSS data, and has a rough idea of its location, it should in most cases be able to get a fix within seconds.

    If the GNSS search is interrupted by network traffic, it will take longer and may not complete at all. Depending on the customer's requirements to latency, it is usually best to let the GNSS search run to completion or some set timeout and block all network traffic in the meantime.

    Regards,

    Elfving

  • Hi Elfving, apologies for the late response.

    That aligns with our experiences using the nordic 91x and we will be looking to use the devices wifi location services / cellular location services for more "continuous" streaming and only use the gnss location for one-off location fixes in more remote conditions. 

    We will look into how we can reduce the network overhead as much as possible r.e. the use of multiple network connections in the meantime

    Kind Regards,

    Andre

Related