We have moved at community.getvera.com

Author Topic: Trying to get pan/tilt to work  (Read 33473 times)

Offline justauser

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Trying to get pan/tilt to work
« on: October 03, 2013, 04:47:06 pm »
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?

Offline justauser

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Re: Trying to get pan/tilt to work
« Reply #1 on: October 03, 2013, 05:09:17 pm »
Nevermind, got it figured out with "/pt/ptctrl.cgi?mv=L,11&onestep=" .. lug_stepSize, 5, lug_username, lug_password)"

Offline Dude22573

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-1
Re: Trying to get pan/tilt to work
« Reply #2 on: October 04, 2013, 04:29:04 pm »
justauser,
Do you know if it is possible to control the pan and tilt of a camera via an iphone app?

Offline justauser

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Re: Trying to get pan/tilt to work
« Reply #3 on: October 04, 2013, 05:46:44 pm »
justauser,
Do you know if it is possible to control the pan and tilt of a camera via an iphone app?

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. 

Offline Dude22573

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-1
Re: Trying to get pan/tilt to work
« Reply #4 on: October 07, 2013, 10:42:42 pm »
Thanks for the info.

Offline Da_JoJo

  • Hero Member
  • *****
  • Posts: 1380
  • Karma: +16/-78
  • If something aint work, we can allways try n make
Re: Trying to get pan/tilt to work
« Reply #5 on: October 07, 2013, 10:51:51 pm »
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.
Vera lite (1.5.622), 2x an-158/2, dead usb pl2302 rs-232, 2x greenwave 6 port, 4x Fibaro FGD211 v1.6, FGBS001, few FGS - 221, etc. AuthomationHD 3 for android :-)
Dutch & German translator http://wiki.micasaverde.com/index.php/Special:AllPages http://support.micasaverde.com http://domotica-shop.nl

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Trying to get pan/tilt to work
« Reply #6 on: October 16, 2013, 09:46:00 am »
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.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline cfnardone

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +2/-0
Re: Trying to get pan/tilt to work
« Reply #7 on: October 16, 2013, 01:15:06 pm »
Quote
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

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Trying to get pan/tilt to work
« Reply #8 on: October 16, 2013, 01:35:03 pm »
@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.
« Last Edit: October 16, 2013, 01:36:52 pm by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline cfnardone

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +2/-0
Re: Trying to get pan/tilt to work
« Reply #9 on: October 16, 2013, 01:56:57 pm »
@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!!!

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Trying to get pan/tilt to work
« Reply #10 on: October 17, 2013, 01:26:09 am »
@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 (http://en.wikipedia.org/wiki/Lua_(programming_language)).

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://forums.dlink.com/index.php?topic=54511.0
http://forums.dlink.com/index.php?topic=48338.0
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.  ;)
« Last Edit: October 17, 2013, 01:44:26 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline cfnardone

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +2/-0
Re: Trying to get pan/tilt to work
« Reply #11 on: October 17, 2013, 04:56:44 pm »
@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
« Last Edit: October 17, 2013, 05:08:30 pm by cfnardone »

Offline cfnardone

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +2/-0
Re: Trying to get pan/tilt to work
« Reply #12 on: October 17, 2013, 05:39:59 pm »
@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?

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Trying to get pan/tilt to work
« Reply #13 on: October 18, 2013, 01:16:18 am »
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
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline rbakley

  • Full Member
  • ***
  • Posts: 102
  • Karma: +5/-2
Re: Trying to get pan/tilt to work
« Reply #14 on: October 26, 2013, 08:02:30 pm »
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