Closed robotastic closed 4 years ago
Hello @robotastic,
A couple of options for you here to try - set a relatively short keep-alive in the sample or your code. You can find this line here the timeout is expressed in seconds, we recommend trying 20 if your MQTT provider is disconnecting you often.
Another option for testing is you can set up a Mosquitto MQTT Broker instance either locally or in the cloud. We have a tutorial posted here or another cloud provider.
Let us know how it goes!
Thanks! switching the Keep-Alive worked. 20 seems to work, when I used 30 or 60 seconds, the connection would eventually drop.
Those direction look got for standing up my own broker. Once I get serious I will switch over to that. Thanks for the help!
I am using the AlfaKit and the sample code in the example. I have the Temp & Humidity sensor enabled and everything turned off. I have it publishing to the HiveMQ Public Broker. It connects and publish 4-5 values and then the connection fails. It seems like there could be a timer that is not being reset. Any pointers on things I should try? Happy to switch brokers or setup my own if that would help.