How to control with Raspberry? REST? Jason? POST/GET?

cybermaus

Young grasshopper
May 26, 2016
57
13
Hello

I would like to send some control parms to the Dahua SD59225UN-HNI and SD5A225XA-HNI

Specifically, I would like to disable auto-tracking at 08h00 and re-enable at 18h00, or when user presses a button if they leave everything unattended for the day.
And maybe also have some hardware buttons for preset 1, 2, 3

So it is not uncommon for this kind of thing to be able to do this with CURL commands, but I am open with any other suggestions.
 
Hi!

I don't really see your question as you have mentioned solutions already:)

I would set up different presents, with Autotrack enabled and disabled as per your request.

You can set different schedules for the presents so between 8-18 you have a preset with Autotrack disabled.
In the menu: PTZ -> Function then time task.

time-ptz.JPG
Set schedule for preset with autotrack on/off.

To control presets by a button you can use RPi or an ESP or whatever that can send CURL commands.

Here is a sample curl command.
curl --digest -u "username:password" -g " 1&arg3=0"

Note the 1 in bold above, this is the preset your sending the PTZ to.

Lol, username<cololon symbol>password :)
 
Last edited:
  • Like
Reactions: cybermaus
Well, you may not understood the why of the question, but you surely gave the answer with that example curl command.
Whether from a very formal manual, or a practical example how-to, one needs to know the syntax. Much appreciated.

So, is there a proper formal manual for this sort of stuff?

Anyway, I'll play with it tomorrow.
 
  • Like
Reactions: genelit
Works, thanks.

I did make some additions: silent and max 1 second:
Code:
url="http://${ip}/cgi-bin/ptz.cgi?action=start&channel=0&code=GotoPreset&arg1=0&arg2=${preset}&arg3=0"
curl --digest -u "${user}:${pass}" -s -g -m 1 -- "${url}"
 
  • Like
Reactions: genelit