update
This commit is contained in:
parent
e1b856c3a7
commit
44eb888d51
5
MQTT.py
5
MQTT.py
|
@ -30,7 +30,7 @@ def on_message(client, userdata, msg):
|
|||
# print("验证通过")
|
||||
import os
|
||||
# device_name = os.environ['device_name']
|
||||
# client.publish('error', payload=device_name, qos=0)
|
||||
client.publish('error', payload=device_name, qos=0)
|
||||
# client.publish('success', payload='验证通过', qos=0)
|
||||
try:
|
||||
origin_data = json.loads(msg.payload.decode('utf-8'))
|
||||
|
@ -69,8 +69,9 @@ times = 120
|
|||
def exec_shutdown():
|
||||
pass
|
||||
|
||||
|
||||
import os
|
||||
if __name__ == '__main__':
|
||||
device_name = os.environ.get('device_name')
|
||||
while True:
|
||||
try:
|
||||
client = mqtt.Client(client_id='s')
|
||||
|
|
Loading…
Reference in New Issue