Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnects after *not* sending? #6

Open
onionhammer opened this issue Feb 14, 2018 · 3 comments
Open

Disconnects after *not* sending? #6

onionhammer opened this issue Feb 14, 2018 · 3 comments

Comments

@onionhammer
Copy link
Contributor

I have a very simple device that if there is no temperature sensor is connected it just sends an event saying "no temperature sensor available", and then sits there connected to the IoT hub.

For some reason after an indeterminate amount of time, however, the device appears as 'disconnected' from the IoT hub, but doesnt log anything over serial debugging and doesn't reboot. It's just disconnected with no clues as to why.

Right now I'm really just looking for guidance as to how I can track this issue down. There doesn't seem to be much of a pattern to it, sometimes it takes an hour to disconnect, sometimes it takes 2 days.

@andriyadi
Copy link
Owner

It’s not scientific response. As you know that the underlying MQTT functionality is provided by PubSubClient library. There could be an issue in it. As soon as MQTT is not connected, you can make sure that it should try to reconnect.

@onionhammer
Copy link
Contributor Author

@andriyadi okay, but currently there's no event indicating that it's disconnected. Do you know if PubSubClient exposes this event and AzureIoTHubMQTTClient just isn't relaying it through its event mechanism?

@onionhammer
Copy link
Contributor Author

onionhammer commented Feb 14, 2018

@andriyadi It looks like connected() is returning false from PubSub, but AzureIoTHubMQTTClient::run() (which calls loop()) is not re-connecting, and is swalling the output from PubSub's loop() which returns false if not connected. I set up some debug statements and basically it went:

Connected
Connected
Connected
Connected
Connected
Disconnected
Disconnected
Disconnected

Eventually it transitioned to disconnected without any other logging or events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants