提交 763bf2e5 authored 作者: blu's avatar blu

object detection: revise

上级 e2ce4673
...@@ -167,6 +167,7 @@ class VAMMQTTClient: ...@@ -167,6 +167,7 @@ class VAMMQTTClient:
rabChanAiTask = None rabChanAiTask = None
th1 =None th1 =None
th2 = None th2 = None
client = None
# The callback for when the client receives a CONNACK response from the server. # The callback for when the client receives a CONNACK response from the server.
@staticmethod @staticmethod
def on_connect(client, userdata, flags, rc): def on_connect(client, userdata, flags, rc):
...@@ -204,6 +205,7 @@ class VAMMQTTClient: ...@@ -204,6 +205,7 @@ class VAMMQTTClient:
''' '''
Parameters Parameters
''' '''
if MQTT_HOST:
self.client = mqtt.Client( self.client = mqtt.Client(
MQTT_CID if MQTT_CID else "vamqtt", userdata=callback) # , protocol=mqtt.MQTTv5) MQTT_CID if MQTT_CID else "vamqtt", userdata=callback) # , protocol=mqtt.MQTTv5)
if MQTT_USER and MQTT_PASSWORD: if MQTT_USER and MQTT_PASSWORD:
...@@ -352,6 +354,7 @@ def video_analysis(data): ...@@ -352,6 +354,7 @@ def video_analysis(data):
if ret['data']['humanDetect']['found'] != 0: if ret['data']['humanDetect']['found'] != 0:
uploadFile(ipcSN, dirName, imageName, downloadDir) uploadFile(ipcSN, dirName, imageName, downloadDir)
# pub msg # pub msg
if MQTT_HOST:
mc = mqtt.Client((MQTT_CID + '-pub') if MQTT_CID else "vamqtt-pub") mc = mqtt.Client((MQTT_CID + '-pub') if MQTT_CID else "vamqtt-pub")
if MQTT_USER and MQTT_PASSWORD: if MQTT_USER and MQTT_PASSWORD:
mc.username_pw_set(username=MQTT_USER,password=MQTT_PASSWORD) mc.username_pw_set(username=MQTT_USER,password=MQTT_PASSWORD)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论