Hey @Walter_Peresson,
Welcome to the Losant Forums, we’re happy to have you!
Addressing your questions individually:
What is your suggestion or recommended procedure to connect with the broker in case of posting every 10 minutes or more?
Opening/closing the connection on a schedule depends on how the device is powered. If power consumption is a concern in your use case, then I would recommend that you open & close the connection and then sleep the device and/or modem as the majority of the power will be consumed by keeping the radio powered on. If power consumption is not a concern, then opening an MQTT connection and leaving that connection open is just fine.
Do I have to open and close the broker connection on each post? Or should I keep the connection opened? How?
With MQTT you do not have to open and close the connection on each post. First, the connection to the broker is established, and then on a frequency that you define, data is published to a topic. Leaving the connection open depends on how your device is powered, as mentioned. In a battery-powered use case, where power consumption is a major concern, closing the MQTT connection and sleeping the modem (either wifi or cellular) will preserve the battery.
What is the role of the keepalive timeout in the case of publishing interval greater than 90 seconds if the losant server closes the connection?
The Keepalive timeout is simply a ping and response to ensure that the connection from the MQTT client to the broker is still working. This does not depend on how often a client is publishing data, but rather that the client is still maintaining a connection to the broker.
Does the connection request to the broker have limitations?
Could you give some examples of limitations you’re are referencing here? As we outline in our documentation, the connection request to the Losant Broker must include a Client ID, Username, and Password. Are there any other limitations that you are referencing that you’d like for me to address?
Please let me know if I can explain anything further or better.
Thank you,
Heath