Digest authentication? (script for Trendnet TV-IP672PI)

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Digest authentication? (script for Trendnet TV-IP672PI)

Post by TheKorn »

So after successfully creating a control script for my TV-IP651, figured I'd take a crack at making one for my TV-IP672. Natch, they're completely different. Time to break out wireshark.

Long story short, I have it boiled down so that if you execute the following curl command, the camera will move to the left:

Code: Select all

curl --digest -u "username:password" "http://ip.address/cgi/ptdc.cgi?command=set_relative_pos&posX=-10&posY=0"
But I'm having a problem trying to figure out how to hack that into a zoneminder control script. Specifically, I can't quite figure out if zoneminder supports digest authentication, which this camera requires for movement commands. You can get video with regular (in the clear) authentication, but for some reason pointing the camera a different direction requires digest authentication. (Go figure!) If you drop the --digest option, the curl request will fail with a 401 unauthorized message every time.

SO... anybody have any snappy ideas on how to do this, or an example I could look at?

Thanks much!
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Digest authentication? (script for Trendnet TV-IP672PI)

Post by knight-of-ni »

zoneminder does not currently support digest authentication.

It has been previsouly added to the issues list on github:
https://github.com/ZoneMinder/ZoneMinder/issues/30
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: Digest authentication? (script for Trendnet TV-IP672PI)

Post by TheKorn »

knnniggett wrote:zoneminder does not currently support digest authentication.

It has been previsouly added to the issues list on github:
https://github.com/ZoneMinder/ZoneMinder/issues/30
Well, I guess that kills this control script dead! Thanks for the info. If zoneminder adds support for it in the future, maybe someone can pick up the ball where I left it. Had to chuckle to myself at the suggestion of using libcurl! :D
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Digest authentication? (script for Trendnet TV-IP672PI)

Post by knight-of-ni »

Oh you know what, I apologize. I should have read your post more closely. One cannot retrieve a video stream via digest authentication. However, ptz control is done via a Perl module which means one can do just about anything. For starters, take a look at how christophe_y2k's perl script handles authentication for the FI8620. It uses LWP::UserAgent, which does support digest authentication.

You will have to scroll down a ways to get to the script:
http://www.zoneminder.com/forums/viewto ... =9&t=21218
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: Digest authentication? (script for Trendnet TV-IP672PI)

Post by TheKorn »

knnniggett wrote:Oh you know what, I apologize. I should have read your post more closely. One cannot retrieve a video stream via digest authentication. However, ptz control is done via a Perl module which means one can do just about anything. For starters, take a look at how christophe_y2k's perl script handles authentication for the FI8620. It uses LWP::UserAgent, which does support digest authentication.

You will have to scroll down a ways to get to the script:
http://www.zoneminder.com/forums/viewto ... =9&t=21218
Hey that's OK, everybody makes mistakes. Thanks for the point in the right direction! I'll take a look and hopefully be able to hack something together at some point.
Post Reply