Trendnet TV-IP400W pan tilt zoom control ???

Hello,

I just installed my Vera Lite the other day. I’ve got all my Z-wave devices working properly (including the HSM100 which kind of works thanks to a quirky work around I discovered) and was able to install my Trendnet TV-IP400W PTZ camera as a generic camera. However, I have no idea how to get PTZ working. I’ve been trying to read up on a Foscam XML file and have been trying to edit and hack it to work, but after a full day of messing around with no progress, I’m hoping someone on the forum can help.

IMG URL: (works)
http://ip/IMAGE.JPG

I found online that the PTZ control is:
http://ip/PANTILTCONTROL.CGI
UP:
PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=1
DOWN:
PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=7
LEFT:
PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=3
RIGHT:
PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=5

Now, entering this into a browser’s URL doesn’t do anything. But if I use curl to send commands, it works:
curl -d ‘PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=1’ http://username_here:passoword_here@ip_here/PANTILTCONTROL.CGI
This moves my camera to the right.

One blogger on the net had a fairly detailed bit of info regarding this camera and said that method must be POST for this to work and that GET wouldn’t do the trick.

The Foscam XML file seems to use the GET method, and I did find this page that mentions POST method for Lua, but I couldn’t get it to work
http://wiki.micasaverde.com/index.php/Luup_Scenes_Events#Invoke_HTTP_URL_with_POST_request_.28Method_3.29

And suggestions to lead me in the right direction?

Thanks!

I think I’m getting close!

I’ve only been able to make my camera move so far using curl, and as luck would have it, curl is implemented in Vera via os.execute(‘curl’)

If I go to the developer section and test Luup code:
os.execute(“curl -d ‘PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=1’ http://myusername:mypassword@192.168.1.20/PANTILTCONTROL.CGI”)
The camera moves!

However, when I add this code to the foscam xml file, which I’ve renamed:
I_TrendnetIP400PTZ.xml

This bit of code doesn’t execute, and all directions/zoome give a “Device not ready” error message?

Any help would be appreciated. I think I’m on the home stretch and probably goofing up something simple.

Thanks.

-Kent

I’m really feeling like a n00b here. Not quite sure what I am doing, so it’s pretty easy to not know what I’m doing wrong, haha.

I’ve modified D_DigitalSecurityCamera1.xml to add the following:


I_TrendnetIP400PTZ.xml

And within I_TrendnetIP400PTZ.xml I’m trying to call this bit of code:


urn:micasaverde-com:serviceId:PanTiltZoom1
MoveLeft

os.execute(“curl -d ‘PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=3’ http://” … lug_username … “:” … lug_password … “@” … lug_ip … “/PANTILTCONTROL.CGI”)


The LuaUPNP.log shows this error:
JobHandler_LuaUPnP::RunAction device 6 action urn:micasaverde-com:serviceId:PanTiltZoom1/MoveLeft failed with -911/Device not ready <0x2c981680>

Any ideas?

With the help of mcflorin, I’ve got a working plugin for a Trendnet TV-IP400 / TV-IP400W PTZ camera. Some of the code is modified from the Foscam plugin also, to give credit where due.

My Camera is now able to PTZ by 4 directionals (I’d like to get diagonals working eventually) and has 6 presets (including Home.)

The only thing I can’t test right now is the Camera Archives, but otherwise seems to be working.

Note: This camera does NOT support zoom functionality as far as I can determine, and only works within the GUI using ActiveX/Java. If you can figure out a way, please help update the code :slight_smile:

For future reference, here is all the data I’ve gathered on this Camera:

– PANTILTCONTROL.CGI
– Movement Table
– 0 = UP/LEFT
– 1 = UP
– 2 = UP/RIGHT
– 3 = LEFT
– 4 = HOME (RESET)
– 5 = RIGHT
– 6 = DOWN/LEFT
– 7 = DOWN
– 8 = DOWN/RIGHT
– MUST USE HTTP POST REQ, NOT GET
– Ex. os.execute(“curl -d ‘PanSingleMoveDegree=1&TiltSingleMoveDegree=1&PanTiltSingleMove=1’ http://myusername:mypassword@ipaddress/PANTILTCONTROL.CGI”)
– PanSingleMoveDegree=x This is for the pan function, where x is the step size
– TiltSingleMoveDegree=x This is for the tilt function, where x is the step size
– PanTiltSingleMove=x This is for the movement variable, where x is the direction from above table
– If moving in any single direction pan or tilt, the other command is not required.

PRESETS
Move/call preset
PanTiltPresetPositionMove=x where x is 0-24 (25 positions available)
ex: os.execute(“curl -d ‘PanTiltPresetPositionMove=0’ http://username:password@ip/PANTILTCONTROL.CGI”)

Set a preset position
PanTiltHorizontal=a&PanTiltVertical=b&SetName=myPosition&SetPosition=X (a and b are absolute values for horizontal positions. X is position number, unclear where to get values. Apparently IMAGE.CGI send a header with the coordinates which the ActiveX/Java decodes in the device GUI)

The example I found shows this as an example header:
–video boundary–Content-length: 10089
Date: 2007-08-16 14:56:19 IO_00000000_PT_136_046 ← Coordinates
Content-type: image/jpeg

Clear Preset
ClearPosition=X (where X is the preset number 0-24)

Check out this site if you need even more info:
[url=http://www.sfpeter.com/2007/08/tv-ip400-protocol/]http://www.sfpeter.com/2007/08/tv-ip400-protocol/[/url]

I really hopes this helps others out. Florin may post this as a plugin shortly, but I figure if anyone is adventurous, have at it.

-Kent

Nice work.
I got your plugin working (although, it seems your D_DigitalSecurityCamera3.xml was missing the tag)!

But after that, it stopped showing up in home buddy (my Android App of choice for the Vera3). So in the end, I just added the tag (and it’s contents) to my D_DigitalSecurtyCamera3.xml, and I appear to have the best of both worlds:

Home Buddy still thinks it’s a camera. I can use the PTZ controls from the web page & from the mobile web app!

Thanks for making this nifty (if a bit old) cheapo PTZ camera useful again!

Glad it worked for someone else :slight_smile:

And thanks for the catch. I zipped up the wrong version of the file. I’ve re-uploaded the ZIP file above with the correction. I hope it works out as well for any others with this camera.

It’s a decent PTZ but getting a little bit older, indeed. I bought about 5 of these once upon a time on sale, I gave a couple away, sold a couple, and still have one left so wanted to put it to use. For the price of the Foscam PTZ, I’d probably just have gone that route if I didn’t already own the Trendnet. I figure there must be a bunch of these out there in the world still, even if just one other :wink:

If anyone else finds any omissions or bugs, please let me know. If you make any changes, please upload and share the new code.

Great work Kll!

Do you plan to upload your code to the marketplace? It can help newbs like me :slight_smile: