We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1fec18 commit f96c1daCopy full SHA for f96c1da
1 file changed
12.network/server_mqtt.py
@@ -1,7 +1,7 @@
1
import wifi
2
wifi.start()
3
4
-server_ip = "192.168.30.105"
+server_ip = "192.168.123.97"
5
client_id = "umqtt_client"
6
7
import time
@@ -20,13 +20,16 @@ def sub_cb(topic, msg):
20
c.set_callback(sub_cb)
21
22
if not c.connect(clean_session = False):
23
- c.subscribe(b"foo_topic")
+ c.subscribe(b"foo_topic")
24
+
25
+ c.publish(b"foo_topic", b"hello")
26
27
while 1:
28
time.sleep(1)
29
if c.check_msg() is not None:
30
c.wait_msg()
31
else:
32
print('other operator')
33
34
finally:
35
c.disconnect()
0 commit comments