This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple MQTT Clients using nrf9160

Has anyone done multiple mqtt client connections from an nrf9160?  Is it simply a matter of using the mqtt api and defining multiple client structures with unique rx/tx buffers assigned to them?  Or are there any limitations imposed by the modem software?

Parents
  • Hello, 

     

    Is it simply a matter of using the mqtt api and defining multiple client structures with unique rx/tx buffers assigned to them?

     Yes, there should be no issues. You need to have two separate mqtt_client structure instances and handle them separately (i. e. separate init, connect etc.). There's no fixed configuration like client port in the MQTT library, all the data is kept within the mqtt_client context so you can maintain as many MQTT connections as you want (in the boundaries of the available memory of course)

    Kind regards,
    Øyvind

Reply
  • Hello, 

     

    Is it simply a matter of using the mqtt api and defining multiple client structures with unique rx/tx buffers assigned to them?

     Yes, there should be no issues. You need to have two separate mqtt_client structure instances and handle them separately (i. e. separate init, connect etc.). There's no fixed configuration like client port in the MQTT library, all the data is kept within the mqtt_client context so you can maintain as many MQTT connections as you want (in the boundaries of the available memory of course)

    Kind regards,
    Øyvind

Children
No Data
Related