Digest authentication to control PTZ camera

266 views
Skip to first unread message

KamPik

unread,
Feb 13, 2019, 11:48:25 AM2/13/19
to Loxone English
Hi, 

I have a PTZ camera that I would like to integrate with Loxone. 
My use case is: Once someone will press doorbell button the camera will automatically preposition to the gate (with the predefined preset).
The camera has HTTP API and with the web browser it is possible to execute the command but the problem is when I want to execute the command from Loxone. Loxone is only supporting basic auth and the camera is only supporting digest auth. 
Do you have any recommendation for workaround?

Kind regards
Kamil 

Tico

unread,
Feb 13, 2019, 8:14:14 PM2/13/19
to Loxone English
You won't be able to directly integrate to Loxone with Digest auth. A possible workaround is a Loxberry (Raspberry Pi) running CamStream4Lox.

From the CamStream4Lox wiki -

"If an authentication on the camera is necessary, then please provide the access data in the following form of the URL:

rtsp://username:passwort@ipadresse_camera/streamingurl/stream/1"

KamPik

unread,
Feb 14, 2019, 4:47:20 PM2/14/19
to loxone-...@googlegroups.com

This plugin will not solve the problem. It will work to get the stream, but I need to send the command which has nothing to the stream. 

 

The command format is: 

http://CAMERAIP/cgi-bin/ptz.cgi?action=start&channel=1&code=Gotopreset&arg1=0&arg2=2&arg3=0 

 

Any other suggestions?


Kind regards

Kamil 

Tico

unread,
Feb 14, 2019, 9:36:49 PM2/14/19
to loxone-...@googlegroups.com
Another suggestion is to have a Loxone virtual output that triggers a script on the Loxberry or a Raspberry Pi (or any other full-featured device). I have a script that sends a simple command to a solar inverter that requires Digest authentication.

The sum total of the script output is -

{"suspension_time_seconds":0}

I would use Loxone only, but it's impossible with Digest authentication.

Use a script editor like Notepad++ to open the attached PHP file.

You can see in the script on line 11, "/servicecgi-bin/suspend_battery_calibration/"; is where you can replace your command "/cgi-bin/ptz.cgi?action=start&channel=1&code=Gotopreset&arg1=0&arg2=2&arg3=0";

You will need to put your IP, Username and Password at line 4, 6 and 7 respectively.

The payload {"suspension_time_seconds":0}, will need to be removed. 

I've got a cursory knowledge in PHP, but my best guess on how to do this is as follows - hopefully someone with PHP knowledge can jump in here....

Delete line 14 and 15.

Line 13 to read instead -

$post_data = array;


The remainder of the guidance can come if you're happy to proceed.


Resume Calibration.png

Resume_Calibration.php
Reply all
Reply to author
Forward
0 new messages