update
This commit is contained in:
parent
f0c8bc256b
commit
e2239580fb
1
MQTT.py
1
MQTT.py
|
@ -30,7 +30,6 @@ class MQTTClient:
|
||||||
|
|
||||||
def on_connect(self, client, userdata, flags, rc):
|
def on_connect(self, client, userdata, flags, rc):
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
print("连接成功")
|
|
||||||
self.client.subscribe(self.topic)
|
self.client.subscribe(self.topic)
|
||||||
client.publish(info_topic, payload=publish_payload(code=200, msg='成功订阅' + self.topic),
|
client.publish(info_topic, payload=publish_payload(code=200, msg='成功订阅' + self.topic),
|
||||||
qos=0)
|
qos=0)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# 编号
|
# 编号
|
||||||
[xumu_d001]
|
[xumu_user1]
|
||||||
# 订阅的控制主题,必须和系统设置的相同
|
# 订阅的控制主题,必须和系统设置的相同
|
||||||
subscribe_topic=xumu_d001
|
subscribe_topic=xumu_user1
|
||||||
info_topic=info_xumu_d001
|
info_topic=info_xumu_user1
|
||||||
username=lihai_lot_land_1
|
username=lihai_lot_land_1
|
||||||
password=lihai_lot_land_1
|
password=lihai_lot_land_1
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
# shellcheck disable=SC2164
|
||||||
|
cd /home/pi
|
||||||
|
device=xumu_user1
|
||||||
|
echo $device | tee device_name
|
|
@ -1 +0,0 @@
|
||||||
xumu_d001
|
|
Loading…
Reference in New Issue