Add some debug logging
This commit is contained in:
@@ -67,6 +67,7 @@ class MQTTService:
|
|||||||
|
|
||||||
def publish(self, topic: str, data: str, qos: int = 0):
|
def publish(self, topic: str, data: str, qos: int = 0):
|
||||||
try:
|
try:
|
||||||
|
print("Trying to publish...")
|
||||||
self.connect()
|
self.connect()
|
||||||
payload = {
|
payload = {
|
||||||
"timestamp": int(time.time()),
|
"timestamp": int(time.time()),
|
||||||
@@ -90,6 +91,7 @@ class MQTTService:
|
|||||||
|
|
||||||
self.client.on_message = on_message
|
self.client.on_message = on_message
|
||||||
self.client.subscribe(topic, qos=qos)
|
self.client.subscribe(topic, qos=qos)
|
||||||
|
print("Subscribed to " + topic)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"An error occurred while trying to subscribe to {topic} on {self.address} : {e}")
|
print(f"An error occurred while trying to subscribe to {topic} on {self.address} : {e}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user