Trying to get pan/tilt to work

I have an RC8061 (http://www.sercomm.com/SWI/downloads/product/data_sheet/RC8061_EN.pdf) and I’m trying to get pan/tilt to work from Vera. I’ve grabbed a Foscam config file (I_FoscamPTZ.xml) and tried to modify it to work with the commands the RC8061 needs but I’m not having any luck. Here are the commands that move the RC8061 -

Up = /pt/ptctrl.cgi?mv=U,10
down = /pt/ptctrl.cgi?mv=D,10
left = /pt/ptctrl.cgi?mv=L,11
right = /pt/ptctrl.cgi?mv=R,11

I’ve opened up the file and replaced “/decoder_control.cgi?command=6&onestep=” … lug_stepSize, 5, lug_username, lug_password)"
with “/pt/ptctrl.cgi?mv=L,11&onestep=” … lug_stepSize, 5, lug_username, lug_password)"
“/pt/ptctrl.cgi?mv=L,11” … lug_stepSize, 5, lug_username, lug_password)" and
“/pt/ptctrl.cgi?mv=L,11” … lug_username, lug_password)"

Then I rename the file something like “I_8061PTZ.xml” but none of these work. I’m really not sure what “&onestep=” … lug_stepSize, 5," does in the original file so I’m not sure if I need that, need to change it, or need to delete it.

Any ideas/help? Is what I’m trying to do even possible?

Nevermind, got it figured out with “/pt/ptctrl.cgi?mv=L,11&onestep=” … lug_stepSize, 5, lug_username, lug_password)"

justauser,
Do you know if it is possible to control the pan and tilt of a camera via an iphone app?

[quote=“Dude22573, post:3, topic:177197”]justauser,
Do you know if it is possible to control the pan and tilt of a camera via an iphone app?[/quote]

All the automation ios apps I’ve seen will control pan/tilt from the app. HomeWave and Vera Mobile definitely both do. There are also free cam apps that will do this if you’re not wanting to control through your Vera. IP Cam Viewer being one.

Thanks for the info.

the stepsize is the amount of steps used when pressing right,left,up or down. probably you wont need them as this is a foscam thing
lug username and password are taken from settings page and used for cam login.

I have many different cams, therfore I created a little implementation file which creates variables for left, right, up, down, zoomin and zoomout. This allows you to set the URL for your commands in the advanced tab for each camera specifically without having to edit lua files and uploading them to vera.

An example:

URL used to turn cam left from browser: http://ipaddresscamera/camera-cgi/com/ptz.cgi?move=left&ptspeed=5
Variable “ptz_left_url” has to be set to: camera-cgi/com/ptz.cgi?move=left&ptspeed=5

I just thought this might be usefull for others, feel free to edit, share and improve. File is attached to this post.

I have many different cams, therfore I created a little implementation file which creates variables for left, right, up, down, zoomin and zoomout. This allows you to set the URL for your commands in the advanced tab for each camera specifically without having to edit lua files and uploading them to vera.

An example:

URL used to turn cam left from browser: http://ipaddresscamera/camera-cgi/com/ptz.cgi?move=left&ptspeed=5
Variable “ptz_left_url” has to be set to: camera-cgi/com/ptz.cgi?move=left&ptspeed=5

I just thought this might be usefull for others, feel free to edit, share and improve. File is attached to this post.

Please help me to understand this more clearly as I am very new at this.

I uploaded your .xml file to luua files. Now what should do on the individual camera url’s…
I hope this makes sense…
Thanks in advance

@cfnardone:

I don’t know where exactly your are, so just a short guide:

  1. Add the camera to your vera.
  2. Then go to the “Advance-Tab” from the camera.
  3. Enter “I_CustomPTZ.xml” in the field “impl_file”.
  4. Close, Save, Reload. Also reload the user interface in your browser.
  5. Go to the “Advance-Tab” again. Now you should see more variables (see attached screenshot).
  6. Enter the URL’s, save and reload.

You first need to figure out what the URL’s to move your camera are, use google.

I am not so much a camera guy, but there are a lot of topics how to add these. Let me know what else you need to know.

@chixxi

Thank you so much…that helps tons.

So, your xml file added the “ptz_left_url”, etc… to the settings tab??

Also, I have tried searching my pan/tilt commands to no avail. I have a dlink 5020L cam

Again, I am VERY new to this stuff and certainly have very limited knowlege of this code stuff. Is this linux programming codes?

Thanks so much again. It is greatly appreciated!!!

@cfnardone:

Yes, normaly the URL’s (read “Link”) are written in the implementation file, my file ceates variables and then read the URL’s from there.

So if I understand this correctly you are around step 5. from my previous description. Cam is added, you see an image and you see the new variables.

This doesn’t have anything to do with linux. The implementation file is written in lua code (Lua (programming language) - Wikipedia).

Now we basically only need to figure out the pan/tilt commands. When I have time I can do some research…

EDIT:

Some interessting links (I guess you just have to try, or use wireshark):

http://www.zoneminder.com/wiki/index.php/D-Link_DCS-5020L_Control_Script

Basically one should be able to figure out the URL’s from the last link, but I have to do some real work first. :wink:

@chixxi

You are correct. I have everything set except entering the “move” commands in the advanced tab fields you created.
I will try to “decode” the commands you posted in those links and enter them to see if they work.

Again, I have no idea or no experience with lua so it all looks gibberish to me.

Thanks again for your help and if I have any luck I will surely post to help others.

EDIT:

YOUR A GENIUS!!!

this command (from 1 of your researched links) moves the camera right…at least I got movement :o

cgi/ptdc.cgi?command=set_relative_pos&posX=-10&posY=0

@chixxi

Got it…Thank you so much… here are the pan/tilt commands for a DLink 5020

MOVE LEFT cgi/ptdc.cgi?command=set_relative_pos&posX=+10&posY=0
MOVE RIGHT cgi/ptdc.cgi?command=set_relative_pos&posX=-10&posY=0
MOVE UP cgi/ptdc.cgi?command=set_relative_pos&posY=-10&posY=0
MOVE DOWN cgi/ptdc.cgi?command=set_relative_pos&posY=+10&posY=0

PS.
Are you for hire?

glad you got it working! depending on the money I am for hire, but I am a quit busy swiss engineer and therefore not cheap ;D

Hi chixxi,

I am trying to get an Axis 215 PTZ camera working with Vera. I followed your instructions, but the only web buttons that work are the Zoom In and Zoom Out. The Pan and Tilt commands do not seem to work. If I put one of the pan commands in the Zoom In field, the camera does pan. So I must have the correct command, but I can not get the correct buttons to work.

Any ideas, what I might be doing wrong? TIA

-bob

Could you maybe post the url’s which need to be used? Then I could have a look into it.

The best was is to have a look into your log while you hit the buttons on the vera UI, then you should see which URL actually gets called.

EDIT:
I just had a look into the file I uploaded previously, seems like I forgot to remove some leftovers from the foscam concerning the step size. Try with the file I uploaded to this post.

WOW!!! ;D ;D ;D ;D Totally awesome! That did the trick. Thanks again for your contribution to the community.

-bob

In order to help someone else trying to get an Axis 215 camera working with Vera, here are my settings.

device_file:

D_DigitalSecurityCamera1.xml

Direct Streaming URL:

/axis-cgi/mjpg/video.cgi?resolution=320x240

URL:

/axis-cgi/mjpg/video.cgi?resolution=320x240

Pan, Tilt & Zoom commands ( I adjusted the Zoom numbers to suit my preferences. The default number in the Axis web page is 2500 for both zoom in and zoom out.)

/axis-cgi/com/ptz.cgi?camera=1&move=left
/axis-cgi/com/ptz.cgi?camera=1&move=right
/axis-cgi/com/ptz.cgi?camera=1&move=up
/axis-cgi/com/ptz.cgi?camera=1&move=down
/axis-cgi/com/ptz.cgi?camera=1&rzoom=1500
/axis-cgi/com/ptz.cgi?camera=1&rzoom=-2500

And last but not least, chixxi’s latest I_CustomPTZ.xml file for the impl_file

-bob

Glad that worked for you! Maybe it would make sense to publish a generic camera plugin like this on apps.mios.com, but as for the moment I don’t have enough time and other plugins which I should continue to develop.

Thanks a lot allready people,
does someone has a full list of commands of this DSC-5020L ?
so for video streaming, goto preset position x, turn IR on/off , …

would be really great.

Thank you all