msg MQTT message

main
zart 5 months ago
parent bb60e09ff9
commit d148072bdd

@ -27,7 +27,7 @@ def on_message(client, userdata, msg):
# print("收到消息: " + msg.topic + " " + str(msg.payload)) # print("收到消息: " + msg.topic + " " + str(msg.payload))
if msg.topic == "response/{}".format(user_id): if msg.topic == "response/{}".format(user_id):
print("收到响应: " + str(msg.payload)) print("收到响应: "+str(msg.topic) + str(msg.payload))
if msg.topic == "image/{}".format(user_id): if msg.topic == "image/{}".format(user_id):
with open("image.jpg", "wb") as f: with open("image.jpg", "wb") as f:

Loading…
Cancel
Save