Wait, is this peak ?
This commit is contained in:
@@ -4,7 +4,7 @@ Edit BROKER_HOST so it points to the broker machine IP address.
|
||||
Do not use localhost from the ESP32.
|
||||
"""
|
||||
|
||||
from shared.mqtt import BrokerClient
|
||||
import shared
|
||||
|
||||
|
||||
BROKER_HOST = "192.168.50.1"
|
||||
@@ -17,7 +17,7 @@ def on_message(message):
|
||||
|
||||
|
||||
def main():
|
||||
client = BrokerClient(
|
||||
client = shared.get_mqtt_client(
|
||||
host=BROKER_HOST,
|
||||
client_id="smartwave-esp32-demo",
|
||||
use_tls=True,
|
||||
@@ -28,7 +28,7 @@ def main():
|
||||
client.set_callback(on_message)
|
||||
client.connect()
|
||||
client.subscribe(TOPIC, qos=2)
|
||||
client.publish(TOPIC, b"hello from MicroPython", qos=2, retain=False)
|
||||
client.publish(TOPIC, b"hello from MicroPython", qos=1, retain=False)
|
||||
|
||||
for _ in range(30):
|
||||
client.poll()
|
||||
|
||||
Reference in New Issue
Block a user