Foscam PTZ working on OpenLuup?

I’ve got a few Foscam cameras on Openluup. The video feed comes in fine but I can’t get PTZ or presets working with any of the plugins (FoscamHD, FoscamPTZ and the older plugin that has a different name). These plugins are used by creating a regular camera device but using a specific implementation file. When I try Pan/Tilt actions after specifying the other implementation file, I get an OK response instead of Invalid Service, but tbe camera doesn’t move.

Had anyone managed to get their foscam working in openluup?

I haven’t got a camera, so have been unable to test anything except through the gracious help of a couple of people who have got one. It’s possible that a relevant action parameter is not implemented. I’m assuming that there’s no log file diagnostic?

Would be happy to try a fix anything, but need to know what! Can I get a copy of a relevant implementation file?

Perhaps it’s time I got a camera. I gather that Foscam are pretty good. Any recommendations?

Hello, what model is it?

[quote=“akbooer, post:2, topic:194950”]I haven’t got a camera, so have been unable to test anything except through the gracious help of a couple of people who have got one. It’s possible that a relevant action parameter is not implemented. I’m assuming that there’s no log file diagnostic?

Would be happy to try a fix anything, but need to know what! Can I get a copy of a relevant implementation file?

Perhaps it’s time I got a camera. I gather that Foscam are pretty good. Any recommendations?[/quote]

Akbooer - I have a surplus to requirements Foscam FI9831P which I will send you free of charge to assist with Openluup development. PM me if you’re interested.

I have a Foscam 9821V2 that is partially functional in openLuup/AltUI. The video feed is the “snapPicture2” taken every 1.5 seconds by AltUI. The AltUI screen shows the preset buttons for me numbered 1 to 8 at the bottom of the screen. I used the I_Foscam98HD.xml file in the forums. This file uses “Preset1” to “Preset8” for the presets. I didn’t realize that the camera can have arbitrary string names for the presets, so you have to use the web interface of the camera to set these names and positions for them. Or you can painfully issue the CGI commands to also name them.

Note that the password handling is goofy right now. Since openLuup doesn’t implement password handling for the image call, you have to embed the user name and password in the URL variable. But the above pan/tilt/preset commands don’t use the URL, they build their own http call, so they need to get the password some other way. And the above I_Foscam98HD.xml tries 2 ways to get them, but that didn’t work for me.

lug_username = luup.devices[lul_device].user or luup.variable_get(CAM_SID, "Username", lul_device) or ""

I’m not 100% sure what you get when you “OR” strings in lua. Need to look that up…

I changed that to (same change for Password)

lug_username = luup.variable_get(CAM_SID, "Username", lul_device) or ""

and added the Username and Password variables manually. At that point the presets started working. But what I don’t see on the screen are the up/down/left/right arrows to do pan and tilt. But if I go into actions and click on moveLeft or moveRight, I get the “OK” message that you mentioned, and the camera moves a short distance appropriately.

Note that what it is really doing is sending a pan command to the camera, waiting 1 second, and calling for a stop. I didn’t realize that the cameras (at least mine) has no step, it only moves continuously and then must be told to stop. And that means that you might want to fiddle with the pan rate. If it is too slow, you won’t get much movement in 1 second; if it is too fast, you’ll get too much movement. And it all depends on how well the start pan and stop commands are timed.

Also, I get no thumbnail picture on the device page. Need to sort that out too. Do you see the thumbnail? How about the pan/tilt control?

This is a very generous offer (although I note that we are on opposite sides of the world!)

In the event, it seems like @amg0 has rapidly addressed most of the AltUI interface issues for cameras?

Forgive my translation from Italian, i hope to help
I for Foscam FI9831, use command URL with Luup code

Immage
http://IPCamera/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=USER&pwd=PASSWORD
Video
http://IPCamera/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=USER&pwd=PASSWORD
you may need to set substream in MJPEG format with this command:
http://IPCamera/cgi-bin/CGIProxy.fcgi?usr=USER&pwd=PASSWORD&cmd=setSubStreamFormat&format=1
Ie to move the camera in position 2:
http://IPCamera/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=2&usr=USER&pwd=PASSWORD

then put URL in quotes:
local status, result = luup.inet.wget(“URL”, 0)

This is a very generous offer (although I note that we are on opposite sides of the world!)

In the event, it seems like @amg0 has rapidly addressed most of the AltUI interface issues for cameras?[/quote]

I’m in Western Australia, technically half of Australia is on the other side of the world from where I am. :slight_smile:

So was that a no?

[quote=“Spanners, post:8, topic:194950”]I’m in Western Australia, technically half of Australia is on the other side of the world from where I am. :slight_smile:

So was that a no?[/quote]

Fair point. I was just concerned at the possible P&P implications. I’ll PM you.

Thanks!

If at first you don’t succeed, reboot! I was having trouble getting the MJPEG stream from my Foscam even though I had followed all of the instructions. But they left out that you need (at least my camera did) a reboot of the camera afterwards. So now I have the direct video working as well as the pan/tilt and the presets.

See this thread for more information: [url=http://forum.micasaverde.com/index.php/topic,44596.0.html]http://forum.micasaverde.com/index.php/topic,44596.0.html[/url]