我從線程「Python MQTT連接只有有限的時間」下面的python腳本。 #!/usr/bin/python
import sys
import paho.mqtt.client as mqtt
import time
def on_message(client, userdata, msg):
if msg.topic == "foo/bar":
pri
在MQTT第一次接收消息後,我想設置超時大約1分鐘。如果1分鐘內沒有更多消息,我想通知一些事情。有什麼辦法可以做到嗎? client.on('message', function (topic, message) {
// if in one minute timeout, there is no more message
// console.log("warning")