sahilchaddha / homebridge-dafang

Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
MIT License
204 stars 34 forks source link

[BUG] - MQTT client disconnects #21

Closed Finch106 closed 4 years ago

Finch106 commented 5 years ago

Describe the bug Looking at the scrolling log of Homebridge, I see a message about client disconnects $SYS/9F6k1ya/disconnect/clients

Expected behavior I'm not sure if this is normal behavior or not

Config

"platform": "Dafang", "mqtt":{ "hostBroker": true, "port": 1883, "host": "localhost", "debug": true, "mongoUrl": "mongodb://localhost:27017/mqtt" }, "cameras": [{ "cameraName": "Family", "cameraRTSPStreamUrl": "rtsp://192.168.1.239:8554/unicast", "mqqtTopic": "Inside/Family/#", "disableStream": false, "accessories": [ { "name": "Family Motion Sensor", "type": "richMotionSensor", "threshold": 300000 }, { "name": "Family Auto Motion Tracking Switch", "type": "autoMotionTrackingSwitch" }, { "name": "Horizontal Left", "type": "moveCamera", "axis": "horizontal", "direction": "left" }, { "name": "Horizontal Right", "type": "moveCamera", "axis": "horizontal", "direction": "right" }, { "name": "Vertical Up", "type": "moveCamera", "axis": "vertical", "direction": "up" }, { "name": "Vertical Down", "type": "moveCamera", "axis": "vertical", "direction": "down" }, { "name": "Motion Detection Switch", "type": "motionDetection" }, { "name": "Recalibrate Switch", "type": "recalibrateSwitch" }, { "name": "Restart Switch", "type": "restartSwitch" } ], "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://192.168.1.239:8554/unicast", "stillImageSource": "-rtsp_transport tcp -i rtsp://192.168.1.239:8554/unicast -vframes 1 -r 1", "maxStreams": 5, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 25, "vcodec": "h264", "debug": true, "audio": false } }, { "cameraName": "Garage Cam", "cameraRTSPStreamUrl": "rtsp://192.168.1.23:8554/unicast", "mqttTopic": "Outside/Garage/#", "disableStream": false, "accessories": [ { "name": "Garage Cam Motion Sensor", "type": "richMotionSensor", "threshold": 300000 }, { "name": "Garage Motion Detection", "type": "motionDetection" }, { "name": "Restart Camera", "type": "restartSwitch" } ], "videoconfig": { "source": "-rtsp_transport tcp -i rtsp://192.168.1.23:8554/unicode", "stillImageSource": "-rtsp_transport tcp -i rtsp://192.168.1.23:8554/unicast -vframes 1 -r 1", "maxStreams": 5, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 25, "vcodec": "h264", "debug": true, "audio": false

Logs

[2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24533-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24538-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage/motion/send_mail : [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24538-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24543-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage/motion/send_telegram : OFF [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24543-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24546-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage/motion/tracking : OFF [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24546-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24553-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage/motors/vertical : 0 [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24553-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24560-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage/motors/horizontal : 0 [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24560-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|24592-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|24592-Garage [2019-1-22 16:17:43] [Dafang] MQTT Server Publish : Outside/Garage : {"uptime":" 04:17:43 up 10:50, 0 users, load average: 2.16, 2.05, 2.05", "ssid":"Finchbyrd", "bitrate":"72.2 Mb/s", "signal_level":"94%", "link_quality":"89%", "noise_level":"0%" } [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|20973-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : Inside/Family/leds/blue : ON [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|20973-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|20977-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : Inside/Family/leds/yellow : OFF [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|20977-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|20981-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : Inside/Family/leds/ir : OFF [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|20981-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/new/clients : mosqpub|20984-Family [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : Inside/Family/ir_cut : ON [2019-1-22 16:17:48] [Dafang] MQTT Server Publish : $SYS/jKMkHtC/disconnect/clients : mosqpub|20984-Family

Family is the name of the camera

Desktop (please complete the following information):

Additional context When this occurs the video cannot be streamed until the client reconnects, which requires that you leave the camera, and return to it later

iwonder-1618 commented 5 years ago

Hi @Gamer106 , MQTT Disconnects have no link with camera streaming. Stream should work fine even if MQTT disconnects. Looking at your logs, it looks like that camera gets disconnected from network and MQTT Broker. Does your camera have stable power connection ?

sahilchaddha commented 4 years ago

These logs are from Camera stating MQTT Client disconnected. But since you are able to see those logs meaning homebridge-dafang client is still connected unless you see error from plugin itself. You can ignore them if plugin is working fine. MQTT has nothing to do with camera streaming. Camera streaming requires full compile install of ffmpeg