turn camera on/off via telnet

Forum for questions and support relating to the 1.27.x releases only.
Locked
d.kilshtein
Posts: 10
Joined: Tue Apr 15, 2014 12:09 pm

turn camera on/off via telnet

Post by d.kilshtein »

I'm looking for a solution to turn camera(s) on and off from a command line.
I found this solution that actually works for me:

Start: { echo "3|on|255|textstring1|textstring2|textstring3"; sleep 1; } | telnet 192.168.0.10 6802
Stop: { echo "3|off|"; sleep 1; } | telnet 192.168.0.10 6802

The only problem is that the camera should be in a "Nodect" function. It really makes me uncomfortable (I feel like living in the big brother's house) and I would prefer to set all cameras to "none/disabled". Then, when I decide to turn them on, switch to "Nodect" and then issue the command I written above (or any other command) to turn all cameras on and start recording.
Then issue another command to return to the "none/disable" state
What I'm looking for is something like coming/going scenarios.
d.kilshtein
Posts: 10
Joined: Tue Apr 15, 2014 12:09 pm

Re: turn camera on/off via telnet

Post by d.kilshtein »

Maybe the easiest way would be a small script to start/stop the service and left all cameras on record function?
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: turn camera on/off via telnet

Post by bbunge »

User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: turn camera on/off via telnet

Post by asker »

You have the following options:

1. Use zmpkg - but that restarts all of ZM, so its slow
2. Use zmu (as sudo) (do a zmu --help and explore) to change function from Enabled to Disabled or vice versa. That will enable/disable a specific monitor. You can't however change its Mode (From say Modect to None)
3. Use the new ZoneMinder APIs - they allow you to both change function and mode. But for this you need development snapshots (1.28.107+)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
d.kilshtein
Posts: 10
Joined: Tue Apr 15, 2014 12:09 pm

Re: turn camera on/off via telnet

Post by d.kilshtein »

Thank you all,

since i don't care about scheduling the on and of i do not need the Cron solution.
all i want is a button to start and stop all cameras when i leave home (no matter what time it is).
the solution i found is using this command:

"echo <my password> | sudo -S service zoneminder start" - to start the service
"echo <my password> | sudo -S service zoneminder stop" - to stop the service

i can run from any of my computers (on windows i use the mobaterm shortcut to start ssh and issue a command) and even from my Android phone (from anywhere). i think stopping a service is even more secure then just stopping the camera...
Locked