turn camera on/off via telnet

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

turn camera on/off via telnet

Post by d.kilshtein » Mon Sep 07, 2015 10:30 am

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 » Mon Sep 07, 2015 2:18 pm

Maybe the easiest way would be a small script to start/stop the service and left all cameras on record function?

bbunge
Posts: 2403
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: turn camera on/off via telnet

Post by bbunge » Thu Sep 10, 2015 1:24 am


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

Re: turn camera on/off via telnet

Post by asker » Tue Oct 13, 2015 8:43 pm

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+)
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

d.kilshtein
Posts: 10
Joined: Tue Apr 15, 2014 12:09 pm

Re: turn camera on/off via telnet

Post by d.kilshtein » Fri Oct 16, 2015 5:06 pm

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests