Foscam controls no longer work with UI5

I have been looking at the control sequence on the 8910w using Firebug. Whenever a right command is given, four commands are executed:
http://192.168.1.106/decoder_control.cgi?command=4
https://d3lvr7yuk4uaui.cloudfront.net/items/loaders/loader_1036.js?aoi=1311798366&pid=1036&zoneid=12768
http://192.168.1.106/decoder_control.cgi?command=1
https://d3lvr7yuk4uaui.cloudfront.net/items/loaders/loader_1036.js?aoi=1311798366&pid=1036&zoneid=12768

A left command yields this command sequence:
http://192.168.1.106/decoder_control.cgi?command=6
https://d3lvr7yuk4uaui.cloudfront.net/items/loaders/loader_1036.js?aoi=1311798366&pid=1036&zoneid=12768
http://192.168.1.106/decoder_control.cgi?command=1
https://d3lvr7yuk4uaui.cloudfront.net/items/loaders/loader_1036.js?aoi=1311798366&pid=1036&zoneid=12768

If the Foscam 8910w requires two URLs for each movement request, it would explain why we are not having any luck with the existing I_FoscamPTZ.xml impl_file.

@silvereagle2208

According to the documentation I have command=1 means stop up. This is sent after every pan/tilt command, even on the FI8918. But this isn’t required when the onestep parameter is present.

I don’t know what to say about the cloudfront URL. IMO I don’t think that is the culprit. Have you tried the URL from my previous post?

@dinosinc
Do you also see the cloudfront URL when issuing a pan/tilt command?

@mcvflorin

I did not want to steal @dinsinc’s thunder since you asked him to test him to test the URL from a previous post. I did test the URL that you posted and it did not work in my case. On my FI8910W, I have never seen the onestep property being used as part of the command set. Perhaps @dinosinc will have different results. I can retest your URL this evening at home, if @dinosinc does not reply before then.

I tried various versions of the URL you provided with no luck. However, I did not conduct a thorough test because I thought @dinosinc would do that and I was seeing four commands being issued with each control request, so I did not expect your URL to succeed, regardless of what variation of you new URL that I tried.

I find this cloudfront URL interesting. It appears to be a redirect to the Amazon CloudFront which is a web service for content delivery. I get the feeling someone is capturing my command requests. That is not necessarily a good thing.

I was not able to make it work ?

I searched the web and https://d3lvr7yuk4uaui.cloudfront.net may be a TDSS rootkit infection. At best, something nasty is lurking in my Firefox browser.

The questions now before us are:
Where did it come from?
How dangerous is it?
How can it be removed?
Is it the reason why the Foscam camera is not working with Vera?

I was able to remove that https://d3lvr7yuk4uaui.cloudfront.net URL from the command set by removing all plug-ins and extensions and then adding them back one at a time.

That means that the command set used by the Foscam camera is much simpler than the command set used by Vera. In order to go right the Foscam camera simply issues a command similar to http://192.168.1.106/decoder_control.cgi?command=4. It will continue to cause a right step until a command similar to the follwing is issued: http://192.168.1.106/decoder_control.cgi?command=1,

The command set issued by Vera to move the Foscam camera right is much more complex. This is the command that Vera issues to try to move the camera right: http://192.168.1.111/port_3480/data_request?id=lu_action&output_format=json&DeviceNum=123&serviceId=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveRight&&rand=0.721000420706739

I obtained the Vera command set with the following URL line setup from MoveRight:

urn:micasaverde-com:serviceId:PanTiltZoom1
MoveRight

luup.inet.wget(“http://” … luup.devices[lul_device].ip … “/decoder_control.cgi?command=4&onestep=3”, 5, lug_username, lug_password)

I believe there was a mistake in the URL code that @mvcflorin provided. His URL code was:
http://<Camera_IP>/decoder_control.cgi?command=4&onestep=3

I believe the command should have been along the lines of:
http://<Camera_IP>/decoder_control.cgi?command=4&onestep=3

I tried the url
/decoder_control.cgi?command=0&onestep=3
/decoder_control.cgi?command=2&onestep=3
/decoder_control.cgi?command=4&onestep=3
/decoder_control.cgi?command=6&onestep=3

All of which worked (tried it with &) which worked as well but from the Vera UI it isn’t working

You’ll have to look in the logs to find what command is sent to the camera. For this you must SSH into Vera.
Once in, run the following commands:

VerboseLogging.sh enable
tail -f /tmp/log/cmh/LuaUPnP.log | grep 'decoder_control'

After you’ve run these commands press any of the pan/tilt buttons on the camera and look in the logs to see if anything is displayed on the screen. If nothing is displayed on the screen stop the previous command using Ctrl+C then run this command:

tail -f /tmp/log/cmh/LuaUPnP.log | grep 'FileUtils::ReadURL'

Again, press any of the pan/til buttons on the camera and look in the logs. After you’re done watching the logs, stop the tail command using Ctrl+C and disable verbose logging with:

VerboseLogging.sh disable

Please let me know what you find.

@mvcflorin

If no one else get this done today, I can run the commands this evening - Central Daylight Time. Just out of curiosity, where in the world are you. Either you are not in North or South America or you get up very early in the morning.

Thank you for all your efforts in resolving this matter. I am looking forward to having Pan/Tilt capability on my FW 8910W.

Sorry I missed that this was a UI5 specific thread, I’m using UI4
I did run through the commands anyways (on UI4), turned out that the I_FoscamPTZ.xml file available on the forum wasn’t working (I got nothing in the logs when panning and tilting). I then used the I_PanasonicPTZ.xml file modified as specified here http://forum.micasaverde.com/index.php/topic,3720.msg21954.html#msg21954 which worked for me

@mvcflorin

Here are the Vera2 UI5 responses to Pan/Tilt commands issued to a Foscam FI8910W camera.

The Right Command onestep variable was hard coded. The other Pan/Tilt command onestep variables were set by by the program.

Right Command
10 05/15/12 20:48:38.626 FileUtils::ReadURL starting http://192.168.1.106/decoder_control.cgi?command=4&onestep=3 <0x400>
01 05/15/12 20:48:41.636 FileUtils::ReadURL 0/resp:401 size 140 http://192.168.1.106/decoder_control.cgi?command=4&onestep=3 <0x400>

Left Command
10 05/15/12 20:54:38.127 FileUtils::ReadURL starting http://192.168.1.106/decoder_control.cgi?command=6&onestep=1 <0x400>
01 05/15/12 20:54:38.149 FileUtils::ReadURL 0/resp:401 size 140 http://192.168.1.106/decoder_control.cgi?command=6&onestep=1 <0x400>

Up Command
10 05/15/12 21:00:41.508 FileUtils::ReadURL starting http://192.168.1.106/decoder_control.cgi?command=0&onestep=1 <0x400>
01 05/15/12 21:00:41.528 FileUtils::ReadURL 0/resp:401 size 140 http://192.168.1.106/decoder_control.cgi?command=0&onestep=1 <0x400>

Down Command
10 05/15/12 21:01:37.771 FileUtils::ReadURL starting http://192.168.1.106/decoder_control.cgi?command=2&onestep=1 <0x400>
01 05/15/12 21:01:37.797 FileUtils::ReadURL 0/resp:401 size 140 http://192.168.1.106/decoder_control.cgi?command=2&onestep=1 <0x400>

@silvereagle2208
Did you edit out the user/pass parameter? The URL’s on UI4 that I saw were of the http://user:password@ipaddress/decoder_control.cgi?command=6&onestep=1 etc

I have found a work around for the problem with the Foscam FI8910W controls and UI5.

The workaround is to hard code the camera username and camera password into the MoveRight, MoveLeft, MoveUp, MoveDown command lines in the I_FoscamPTZ.xml file. After modifying the code, reload the I_FoscamPTZ.xml file into the Luup files section of the Develop Apps → Luup files → Upload files → Choose file section of the UI5 interface. Make sure that the “Restart Luup after upload” box is checked. Press the Go button. Wait for your Vera2 to restart. You should be good to go.

Here is a sample of how I modified the command line for the MoveRight command in the I_FoscamPTZ.xml.

urn:micasaverde-com:serviceId:PanTiltZoom1 MoveRight luup.inet.wget("http://" .. luup.devices[lul_device].ip .. "/decoder_control.cgi?command=4&onestep=" .. lug_stepSize, 5, "camerausername", "camerapassword")

Hopefully, someone can use this workaround to develop a permanent solution. It appears that the program as it stands is not able to extract the camera username and password. But until a permanent solution is found, the camera should work well with the work around.

I forgot about the username and password issue. :-[ On UI4 the Username and Password were state variables, in UI5 they are attributes. I didn’t consider this when updating this file for UI5. I updated the file to handle the “upgraded from UI4” situation, and also added two configurable parameters: ReverseControls, which if it’s 1 the up/down and left/right directions are reversed, and StepSize, which allows setting the step size without editing the file.

NOTE
I suggest installing the Foscam plugin from the Marketplace (Apps >> Install Apps). It has this new file and it will auto-update when there’s a new version with additional features.

@mvcflorin

I installed the new Foscam IP Cameras 1.1 plugin for UI5 last night. The installation went smoothly and the camera performs well. Thank you for your efforts in making this possible.

I only have a couple of fine points left to deal with:

[ul][li]The Advanced tab of all cameras that use the new plugin have three URL entries. Is it possible to reduce that to one? I can live with it, if it is a complex job to correct this.
[/li]
[li]My Luup files listing contains a listing for I_FoscamPTZ (No extension). Is there a documented process for removing unwanted Luup files?[/li][/ul]

At this point I have to say that I am very pleased with my Vera2 setup. Since I enabled USB logging and USB swap, the performance and stability have been excellent. My Foscam FI8910W camera and my Linksys WVC80N cameras work reasonably well with in UI5 when using the new Foscam plug-in.

In my environment, if I had a couple of improvements, I would have an simply outstanding home automation controller. The two changes I would need are:

[ul][li]The camera contol functions need to be more reliable. The image breaks too often when I switch to View mode and even more frequently when I switch from View mode to Zoom View mode. I submitted a bug report in December regarding these issues. However, after the release of the 1.5.346 firmware, you did a batch purge of this bug report stating the the new firmware solved the bugs previously reported for cameras. Guess what? You solved many of the camera bug issues with the new firmware, but several critical bugs still remain.
[/li]
[li]A more simple method has to be developed to deal with removing items from the items from the My Alerts Archive. Batch delete of items from the UI4 archive was cumbersome. Batch delete of items from a UI5 archive is next to impossible, especially if it is being done remotely.
[/li][/ul]

The efforts of the MiCasaVerde development team and the Vera user community are turning the Vera into a very powerful home automation controller. Vera now does an excellent job in dealing with the day-to-day tasks of controller switches, sensors, and scenes. One key to the future for Vera is now well it can handle cameras, imaging, and archives. That will take it from being a very good home control system to a home monitoring system as well. If you can fix the issues that exist regarding LUUP developers, you will open up the box to the “dreamers” who will take the Vera controller to places most of us cannot even imagine.

Are these URL, DirectStreamingURL and VideoURLs? Or you just have 3 URL variables?

You must SSH into Vera to delete that file. After you SSH into Vera run this command:

rm /etc/cmh-ludl/I_FoscamPTZ.lzo

Edit: corrected the file extension.

Are these URL, DirectStreamingURL and VideoURLs? Or you just have 3 URL variables?

You must SSH into Vera to delete that file. After you SSH into Vera run this command:

rm /etc/cmh-ludl/I_FoscamPTZ.xml

I tried a copy and paste of this command and got an error “No such file or directory”

@baxy_AU

Why do you want to delete that file? Do you also have duplicates?

@mcvflorin

Are these URL, DirectStreamingURL and VideoURLs? Or you just have 3 URL variables?

The URLs are just what they are URLs. They all have the same value: /snapshot.cgi on the Foscam and /img/snapshot.cgi?size=3&quality=1 on my Linksys cameras.

I started with only one URL. After doing testing to determine why the Foscam camera would not Pan or Tilt, I ended up with a second copy of the URL Variable. After I loaded the new version of the I_FoscamPTZ.xml that you provided to fix the Foscam P/T problem, I ended with a third URL line in the Advance tab of all my five cameras: 4 Linksys and 1 Foscam, that use the I_FoscamPTX.xml file. There is only one URL listing on the Settings tab. As I said, it does not appear to be a problem, merely an observation.

@mvcflorin

I recently asked the question
My Luup files listing contains a listing for I_FoscamPTZ (No extension). Is there a documented process for removing unwanted Luup files?

Your replied:

You must SSH into Vera to delete that file. After you SSH into Vera run this command: Code: [Select] rm /etc/cmh-ludl/I_FoscamPTZ.xml

Did your really mean that or should the command really have been:
rm /etc/cmh-ludl/I_FoscamPTZ.lzo
There was no I_FoscamPTZ.xml file in my Vera2’s /etc/cmh-ludl directory and all the files in that directory end with .lzo