Skip to content

Commit

Permalink
mqtt: add support for a user configured client id
Browse files Browse the repository at this point in the history
Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Jul 22, 2024
1 parent 5c62149 commit b8ba6c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions moonraker/components/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,13 @@ def __init__(self, config: ConfigHelper) -> None:
"between 0 and 2")
self.publish_split_status = \
config.getboolean("publish_split_status", False)
client_id: Optional[str] = config.get("client_id", None)
if PAHO_MQTT_VERSION < (2, 0):
self.client = ExtPahoClient(protocol=self.protocol)
self.client = ExtPahoClient(client_id, protocol=self.protocol)
else:
self.client = ExtPahoClient(
paho_mqtt.CallbackAPIVersion.VERSION1, protocol=self.protocol
paho_mqtt.CallbackAPIVersion.VERSION1, client_id,
protocol=self.protocol
)
self.client.on_connect = self._on_connect
self.client.on_message = self._on_message
Expand Down

2 comments on commit b8ba6c0

@xMajorSavage
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this Commit Broke OrcaSlicer Being able to send a Print to Printer all i receive is Error Uploading To Print Host Curl: Failure when receiving data from the peer: Recv Failure: Connection Was reset [Error 56]

@Arksine
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit does not touch gcode uploads. It sounds like you are experiencing a local network error.

Please sign in to comment.