aiomqtt
aiomqtt copied to clipboard
Mqtt errors
Hi, sometime I get this exceptions: What can be the reason of them?
- MqttError('Operation timed out')
- MqttCodeError('Could not publish message')
"Operation timed out" can occur for different reasons:
- Your computer failed to send the message in time
- The server did not respond in time "Could not publish message" can occur due to the timeout.
It's difficult to pinpoint the culprit from the raw exceptions alone. It can be anything from a temporary network failure to a faulty network driver. Maybe you can try with a localhost server and see if that helps. :+1:
You can also try to increase the timeout
parameter and see if that changes things. The default timeout is 10 seconds.
- The broker and device not at the same region so maybe there are issue with timeout so I will try this:
You can also try to increase the
timeout
parameter and see if that changes things. The default timeout is 10 seconds.
-
Maybe timeout should be different for etch QOS?
-
Did this two error messages can be for same operation? of publish?
- for example i try to publish "a" to topic "1" with qos1
- Then for some reason timeout occur and both messages will received at Exception catch?
try:
await self.clients.get(broker).publish(topic, msg, qos=1)
except MqttError as identifier:
_logging.error("Mqtt publishing Failed", extra={
"data": {"exception": identifier, "message": msg, "topic": topic}})
"Operation timed out" can occur for different reasons:
- Your computer failed to send the message in time
- The server did not respond in time "Could not publish message" can occur due to the timeout.
It's difficult to pinpoint the culprit from the raw exceptions alone. It can be anything from a temporary network failure to a faulty network driver. Maybe you can try with a localhost server and see if that helps. 👍
Thanks
Maybe timeout should be different for etch QOS?
That would make sense. Good thing is that timeout
is already a parameter so you can do this as a user already. :+1:
As long as you have problems with timeouts in the system, you might also see other strange errors. :) Fix the timeouts first and foremost. Then, if you still get other errors, we can have a look at those. :+1:
Hey there, I'm guessing that we can close this as there has been no more discussion. If there's anything left unclear, please reopen!