Dafang-Hacks / Main

141 stars 62 forks source link

Fix 69 remove system() calls on motion detection/tracking #73

Closed claud9999 closed 3 years ago

claud9999 commented 3 years ago

closes #69

The detectionOn/Off/Tracking scripts should be re-written to be started as a daemon and watching the MQTT messages. Note that the mosquitto daemon should also be running on the camera for this to work. (v4lrtspserver should still function without the MQTT server, just no motion detection/tracking script execution.)

claud9999 commented 3 years ago

sorry probably should have made the other PR a branch as well...merge #72 before merging this'n.

claud9999 commented 3 years ago

also I don't know how to release updated detectionOn/Off/Track scripts to use mqtt and scripts/configs to start/stop the MQTT server...

jmtatsch commented 3 years ago

So basically now we would need a mqtt listener that watches for motion events and then executes detectionOn/Off.sh?

claud9999 commented 3 years ago

Yeah I have such a script, am debugging it but having trouble restarting the RTSP server. Hope to have a solution early next week or possibly later today. I'm thinking, now that I see that the server uses shared memory for its configuration, I might switch to communicating via shared memory instead of MQTT and adding a command to support triggering shell scripts.

claud9999 commented 3 years ago

So I have a new PR here with some fixes and it works great with MQTT (once I fixed my bug.) Where should I put the script? (I basically made detectionOn.sh and detectionOff.sh functions inside mqtt-detection.sh.) I also need to add control scripts for the mosquitto broker and UI controls as well.

claud9999 commented 3 years ago

The scripts and changes are committed to a branch in my fork: https://github.com/claud9999/Xiaomi-Dafang-Hacks/tree/mqtt_detection

I will submit a ticket to Dafang-Hacks and a PR soon after.