Skip to content

AWS_ERROR_MQTT_NOT_CONNECTED #272

@1960pghpirates

Description

@1960pghpirates

Confirm by changing [ ] to [x] below:

Platform/OS/Device
Raspberry Pi Zero WH

Describe the question

I recently upgraded from v1 to v2 of the AWS IoT Python SDK. The client ran without error for a couple of weeks, but now a new error has stopped it:

Failed to publish update request.
Exiting sample due to exception.
Traceback (most recent call last):

File "sgp40_simpletest-new.py", line 227, in on_publish_update_shadow
future.result()
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/pi/.local/lib/python3.7/site-packages/awscrt/mqtt.py", line 680, in publish
packet_id = _awscrt.mqtt_client_connection_publish(self._binding, topic, payload, qos.value, retain, puback)
RuntimeError: 5131 (AWS_ERROR_MQTT_NOT_CONNECTED): The requested operation is invalid as the connection is not open.

The only thing I can think of that might cause this is WiFi connection drops, but from what I read online, the client is supposed to be able to recover from periodic connection issues. Is that true? I never had this problem with v1 of the Python SDK.

Metadata

Metadata

Assignees

Labels

closed-for-stalenessguidanceQuestion that needs advice or information.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 2 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions