From 1f5ece332749e8fb8399c29e1b596e423152c58a Mon Sep 17 00:00:00 2001 From: bj00rn Date: Wed, 9 Jul 2025 13:35:54 +0000 Subject: [PATCH] MQTT over websocket is no longer supported gmqtt does not support websocket atm --- README.md | 2 +- src/configuration/__init__.py | 1 - src/configuration/parser.py | 2 -- src/publisher/mqtt_publisher.py | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 315d656..c1e1721 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ The following are the known available endpoints: | CMD param | ENV variable | Description | |-----------------------------------|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| -m or --mqtt-uri | MQTT_URI | URI to the MQTT Server. TCP: tcp://mqtt.eclipseprojects.io:1883, WebSocket: ws://mqtt.eclipseprojects.io:9001 or TLS: tls://mqtt.eclipseprojects.io:8883 - Leave it empty to disable MQTT connection | +| -m or --mqtt-uri | MQTT_URI | URI to the MQTT Server. TCP: tcp://mqtt.eclipseprojects.io:1883 or TLS: tls://mqtt.eclipseprojects.io:8883 - Leave it empty to disable MQTT connection | | --mqtt-server-cert | MQTT_SERVER_CERT | Path to the server certificate authority file in PEM format is required for TLS | | --mqtt-server-cert-check-hostname | MQTT_SERVER_CERT_CHECK_HOSTNAME | Enable or disable TLS certificate hostname checking when using a custom certificate. Enabled (True) by default. Set to False when using a self-signed certificate without a matching hostname. This option might be insecure. | | --mqtt-user | MQTT_USER | MQTT user name | diff --git a/src/configuration/__init__.py b/src/configuration/__init__.py index de30dad..c1d7112 100644 --- a/src/configuration/__init__.py +++ b/src/configuration/__init__.py @@ -13,7 +13,6 @@ def __init__(self, transport_mechanism: str, with_tls: bool) -> None: self.with_tls = with_tls TCP = "tcp", False - WS = "websockets", False TLS = "tcp", True diff --git a/src/configuration/parser.py b/src/configuration/parser.py index 6ceffba..3b4ff9d 100644 --- a/src/configuration/parser.py +++ b/src/configuration/parser.py @@ -92,8 +92,6 @@ def __parse_mqtt_transport(args: Namespace, config: Configuration) -> None: parse_result = urllib.parse.urlparse(args.mqtt_uri) if parse_result.scheme == "tcp": config.mqtt_transport_protocol = TransportProtocol.TCP - elif parse_result.scheme == "ws": - config.mqtt_transport_protocol = TransportProtocol.WS elif parse_result.scheme == "tls": config.mqtt_transport_protocol = TransportProtocol.TLS if args.tls_server_cert_path: diff --git a/src/publisher/mqtt_publisher.py b/src/publisher/mqtt_publisher.py index cb2809a..a4974ca 100644 --- a/src/publisher/mqtt_publisher.py +++ b/src/publisher/mqtt_publisher.py @@ -30,7 +30,6 @@ def __init__(self, configuration: Configuration) -> None: mqtt_client = gmqtt.Client( client_id=str(self.publisher_id), - transport=self.transport_protocol.transport_mechanism, will_message=gmqtt.Message( topic=self.get_topic(mqtt_topics.INTERNAL_LWT, False), payload="offline",