Author Topic: Foscam FI9821W - Support & How-To  (Read 54178 times)

Offline Aaron

  • Hero Member
  • *****
  • Posts: 1984
  • Karma: +61/-193
Foscam FI9821W - Support & How-To
« on: January 12, 2014, 02:19:31 pm »
Foscam FI9821W Vera Support & How-To thread

I will keep this post current. Please let me know if there is anything in error, missing, or better ways.

WORKING...
- Camera Device: gets created, shows video, Pan&Tilt

NOT WORKING...
- Camera Device: frame rate is very slow
- Camera Motion Sensor: not working/supported


HOW-TO INSTALL...

1) Download proper files (attached in ZIP)

2) Upload these files to Vera unit (Apps \ Develop Apps \ Luup Files), check the box for 'Reload Luup after uploading'

3)Create Camera:   * this methods produced the quickest results for me, there are other ways that also work.
- under Devices \ Add Device \ I want to add an IP Camera \ Add Manually
- in bottom box enter: http://<camera IP>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password>
- enter <user> & <password> in corresponding boxes
- you should see your camera image after choosing 'Continue' button

4) Wait a minute or so the Camera device to appear (it may show as "undefined")

5) Change settings on Advanced tab page:
name - <whatever name you want>
ip - <camera IP address>:<port>   *port needed only if not using port 80
mac - <camera MAC address>
manufacturer - Foscam
model - FW9821W
device_file - D_DigitalSecurityCamera2.xml
device_type - urn:schemas-upnp-org:device:DigitalSecurityCamera:2
impl_file - I_Foscam98HD.xml
URL - /cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<username>&pwd=<password>
DirectStreamingURL - /cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=<username>&pwd=<password>

At this point you should see the camera image and all currently working items

IF you have problems and need to delete the device, first try the normal 'trashcan' button under device properties. If that is not working for you, use this URL...
http://<vera_ip_address>:3480/data_request?id=device&action=delete&device=<device # you want deleted>
« Last Edit: February 16, 2014, 11:38:16 am by Aaron »

Offline Pseudomizer

  • Sr. Member
  • ****
  • Posts: 376
  • Karma: +8/-1
    • Home Automation Expert
Re: Foscam FI8921W - Support & How-To
« Reply #1 on: January 16, 2014, 08:37:18 pm »
Thanks a lot. Got the cams now up and running.

With Vera Mobile I get the standard error message that it is going into emulation mode and no pan/tilt options.
With AuthomationHD I get and pan/tilt options and they actually work.

My next task will be to look into blue iris and motion sensoring.
Vera 3, RFWC5AW, 2 x LFM-20, FS20Z, 3 x YRD220ZW619KWKD, 2 x FI9826W, FI9828P, 2 x NEST Gen2, EVL-3CG, 11 x BR30, 3 x A19 Hue, Media Srv, 18 x ZW4004, 8 x ZW3003, 12 x ZW2002, IP2IR Cache, 2 x DSC24, ZWN-SC7, 4 x PIR-ZWAVE2, DSB05-ZWUS, RS100-HC, ECO-TILT-US, Ribu1C, 3 x GE12721, 2 x Echo, ZW078-A

Offline Pseudomizer

  • Sr. Member
  • ****
  • Posts: 376
  • Karma: +8/-1
    • Home Automation Expert
Re: Foscam FI8921W - Support & How-To
« Reply #2 on: January 17, 2014, 02:50:13 am »
Ok. Let's tackle the fun part now. After a lot of research and going through all the various APIs and versions of those here is what I came up with.

A) Nobody knows how to read the current status of the IR of the Cam. They all come back with the command 94 and 95 to enable or disable IR and some of the guys came back with you can actually read if it is set on ON/OFF/AUTO.
B) None of the above helps because what I am after is to be able to read in real time if the IR is activated or not activated and I don't care what the setting is in terms of on, off or auto as the default is auto and this is how it should be. I want to use the camera as a day light detector and if under setting auto the IR kicks in, I want to trigger certain actions via Vera.

Now the good news. Here is what I found out:
You CAN read the status of the IR LEDs of every Foscam who supports IR-CUT off with the following command and you can use your browser to test it.

http://IP ADDRESS:PORT/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXXX&pwd=XXXXXX

The output will look like this:

<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>http%3A%2F%2URLXXXXXXX</url>
    <upnpState>1</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>YOUR WIFI NETWORK</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>

The last line of the parameters above the key. 0 = IR is offline and 1 = online

This is where I need your help guys now. How can I read this specific line as I don't care about the other lines and trigger certain commands?

My ultimate goal is the following and I will try to explain this a logical form:

During day which equals infraLedState = 0 --> disable light switch for main front door and then start listening to the camera motion sensor and use the following logic:

If motion sensor is triggered then record 2 min of video via Blue Iris

During night which equals infraLedState = 1 --> enable light switch for main front door and then start listening to the camera motion sensor and use the following logic:

If motion sensor is triggered, then turns front door lights on and record 2 min of video via Blue Iris

I have 2 challenges here. One technical challenge which is the how do I read from all those parameters above the last line and only the last line to trigger my actions above.

The second challenge is a logical challenge because as soon as the front door lights go on based on the motion sensor, the logic from the top kicks in which says to disable the front door lights and record video.

If I can figure that out I could replace my motion sensor in front of the house and integrate everything into the Foscam and control everything via the Foscam which includes lights, motion detector and video recording and I could go as far as controlling the Yale door lock as well.

Let's see if any technical help and/or logic help can be provided for this ambitious project.

Thanks in advance guys for any help.
Vera 3, RFWC5AW, 2 x LFM-20, FS20Z, 3 x YRD220ZW619KWKD, 2 x FI9826W, FI9828P, 2 x NEST Gen2, EVL-3CG, 11 x BR30, 3 x A19 Hue, Media Srv, 18 x ZW4004, 8 x ZW3003, 12 x ZW2002, IP2IR Cache, 2 x DSC24, ZWN-SC7, 4 x PIR-ZWAVE2, DSB05-ZWUS, RS100-HC, ECO-TILT-US, Ribu1C, 3 x GE12721, 2 x Echo, ZW078-A

Offline nutt318

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Foscam FI8921W - Support & How-To
« Reply #3 on: January 17, 2014, 09:10:41 am »
Thanks for the great info, I'm about to purchase the same camera along with BlurIris.

Offline Lonestar10

  • Full Member
  • ***
  • Posts: 214
  • Karma: +4/-1
Re: Foscam FI8921W - Support & How-To
« Reply #4 on: January 25, 2014, 03:43:03 pm »
I have a new Foscam FI9821W V2 camera that Vera refuses to recognize. 

I downloaded and installed the files and restarted the luup, but I cannot finish the "create device" steps.

When the proper IP. port, user and pwd are entered into this string,  http://<camera IP>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password>,  it always returns an image in a browser, but Vera never sees it when installing. "Unable to get image from camera."

Am I missing a step somewhere?

IU5 Vera 3 - VeraLite - Trane Thermostats x3 - Kwikset - Schlage - Nest - GE & Leviton Switches

Offline Pseudomizer

  • Sr. Member
  • ****
  • Posts: 376
  • Karma: +8/-1
    • Home Automation Expert
Re: Foscam FI8921W - Support & How-To
« Reply #5 on: January 25, 2014, 04:19:21 pm »
I have a new Foscam FI9821W V2 camera that Vera refuses to recognize. 

I downloaded and installed the files and restarted the luup, but I cannot finish the "create device" steps.

When the proper IP. port, user and pwd are entered into this string,  http://<camera IP>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password>,  it always returns an image in a browser, but Vera never sees it when installing. "Unable to get image from camera."

Am I missing a step somewhere?

If it works in the browser then you are doing the "Add device" steps not properly or you are facing what I faced too. When I clicked on the last page where I should see a screenshot it didn't show up but then I clicked on cancel and immediately again on next and the picture showed up.

Don't ask me why but I had this twice as I was playing around with all the integration options. Maybe that helps.
Vera 3, RFWC5AW, 2 x LFM-20, FS20Z, 3 x YRD220ZW619KWKD, 2 x FI9826W, FI9828P, 2 x NEST Gen2, EVL-3CG, 11 x BR30, 3 x A19 Hue, Media Srv, 18 x ZW4004, 8 x ZW3003, 12 x ZW2002, IP2IR Cache, 2 x DSC24, ZWN-SC7, 4 x PIR-ZWAVE2, DSB05-ZWUS, RS100-HC, ECO-TILT-US, Ribu1C, 3 x GE12721, 2 x Echo, ZW078-A

Offline Lonestar10

  • Full Member
  • ***
  • Posts: 214
  • Karma: +4/-1
Re: Foscam FI8921W - Support & How-To
« Reply #6 on: January 26, 2014, 12:02:20 am »
That trick didn't work for me, so I tried rebooting both Vera and the camera and tried again.  This time, it worked.  Vera installed the camera.

However, it's showing only two-thirds the image.  The bottom third of the image is missing; blanked out.  In fact, when I enter http://<camera IP>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password, the bottom third of the image in the browser is blanked out.

Is there a setting on the Foscam I have to adjust?

Thanks
IU5 Vera 3 - VeraLite - Trane Thermostats x3 - Kwikset - Schlage - Nest - GE & Leviton Switches

Offline Pseudomizer

  • Sr. Member
  • ****
  • Posts: 376
  • Karma: +8/-1
    • Home Automation Expert
Re: Foscam FI8921W - Support & How-To
« Reply #7 on: January 26, 2014, 02:05:01 am »
Sounds like your camera is defect... :-(
Vera 3, RFWC5AW, 2 x LFM-20, FS20Z, 3 x YRD220ZW619KWKD, 2 x FI9826W, FI9828P, 2 x NEST Gen2, EVL-3CG, 11 x BR30, 3 x A19 Hue, Media Srv, 18 x ZW4004, 8 x ZW3003, 12 x ZW2002, IP2IR Cache, 2 x DSC24, ZWN-SC7, 4 x PIR-ZWAVE2, DSB05-ZWUS, RS100-HC, ECO-TILT-US, Ribu1C, 3 x GE12721, 2 x Echo, ZW078-A

Offline Ramiii

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
Re: Foscam FI8921W - Support &amp; How-To
« Reply #8 on: January 26, 2014, 04:36:16 am »
Try to adjust the camera resolution in the settings and see

Offline Lonestar10

  • Full Member
  • ***
  • Posts: 214
  • Karma: +4/-1
Re: Foscam FI8921W - Support & How-To
« Reply #9 on: January 26, 2014, 11:33:16 am »
Changing the resolution in the Foscam software corrected the problem in Vera.  I now see the full image.

Thank you!
IU5 Vera 3 - VeraLite - Trane Thermostats x3 - Kwikset - Schlage - Nest - GE & Leviton Switches

Offline Hottoy

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Re: Foscam FI8921W - Support & How-To
« Reply #10 on: January 27, 2014, 11:05:29 am »
Help please -  I'm having trouble getting Vera to add my new F19821W V2 Camera.  running latest firmware 
Vera Lite UI5 running firmware 1.5.622
Foscam setup has a Static IP  with port changed to 4 digit
Foscam System Firmware 1.4.1.8 /  application firmware 1.11.1.18  / plug in 2.0.1.5

I can see the camera image in my chrome or firefox browsers as well as in myfoscam iphone app

I followed the instructions at the beginning of this thread but every time I try to add I get
"Here is an image from the camera. If this is correct, click 'Add' to add the camera to Vera. " 

but no image just a small box.  Same effect with Chrome or Firefox

I have tried the cancel next approach described above several times.  I have also rebooted vera and camera no effect.   

« Last Edit: January 28, 2014, 11:22:34 am by Hottoy »

Offline flam5

  • Newbie
  • *
  • Posts: 1
  • Karma: +2/-0
Re: Foscam FI8921W - Support & How-To
« Reply #11 on: February 01, 2014, 01:04:37 pm »
Newbie to the Vera here, but like many people who get into the smart home stuff, I am a tech professional career wise so gadget tinkering is in my wheelhouse.  I'm posting for the first time here just to log some of my observations/findings here so others may benefit and possibly avoid a DenverCoder9 situation.

Instructions/Things I've noted while adding the Foscam F19821W V2, System Firmware Version 1.4.1.8, Application Firmware Version 1.11.1.18, Plug-In Version 2.0.1.6 to my VeraLite (UI5):

1.) To start process of detecting the camera:
  • Click Devices
  • Click Add Devices
  • Click Add next to I want to add an IP Camera
  • Click Manually add
  • Use the URL provided in the opening post: http://<camera IP>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password>
    • You will need to replace the variables in the url: <camera IP>, <port>, <user>, and <password> with the corresponding values for the camera you are setting up
    • Also note that if you have your camera operating on port 80, you can completely omit the colon and port number as port 80 is the default HTTP port so it is unnecessary
    • In case it is not clear, remove all angle brackets (the greater than and less than characters) in the URL. The example of the URL http://192.168.1.125:1117/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&user=camadmin&pwd=myc@m3r@ would be the correct URL to use for a camera that has an IP of 192.168.1.125, runs on port 1117,  and is accessed using the credentials with a username of camadmin and password of myc@m3r@
  • This is where my mileage has varied from the previously mentioned steps. Do not select a camera type.  Do not enter in your  username and password.  Click Next to continue. 
  • Give the Vera a second to load the high resolution image. Click Add, then go have a drink because if your situation is anything like mine, this is the most progress you've had in months.
2.) Now that the camera is added, go change the settings that opening poster Aaron mentioned. 
  • If you are confused because you don't see the field "DirectStreamingURL" or other fields, make sure your impl_file and device_file fields are correct, save, give it a minute, then go back to the devices page to fill out the remaining necessary fields. After changing fields impl_file, and Device_file I found that I had to save the configuration, give the Vera a minute, and then go back to editing the device so I had all the necessary fields.
  • Don't neglect filling out information in the "Settings" tab of the camera as well.
    • The URL I have is cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<username>&pwd=<password>
    • Fill out the username and password fields that you did not provide when creating the camera.
    • The MAC address format should have colons separating the hexadecimal values, e.g. 28:B5:6E:49:50:D2 -- If you can't find your mac address, try going to your router's listing of connected devices and look for the MAC address that corresponds with your camera's IP address.

Results:

I'm able to see my thumbnail and view the camera in emulation mode through the Vera phone application.  AutHomation HD app does have pan-tilt-zoom (PTZ) capability, but the picture refresh is pretty slow, so there's a good 7 second lag to update the picture, even though I can hear and see the camera physically move instantly when I use the PTZ controls.

Some other lessons learned and thoughts:

Give your camera a meaningful name and make sure you're editing the correct camera!  At one point I had edited a bunch of fields on another IP camera that I have (a non-hd Foscame FI8910W).  I had to delete that camera and go back to re-add it. 

Double check all fields for spelling errors and making sure that you properly removed the username and password variables if you used copy-and-paste.  At one point, I had not realized that I had the <username> and <password> still in the streaming URL from copying and pasting it. A

Whenever you edit the name of any of the XML files, save the configuration, let the Vera work and reload, then go back to editing the device.  Those XML files determine what variables/fields are in the configuration options for the device.

I've also been playing around with adjusting the video settings for the camera to see if there's any optimum setting for the camera to be less choppy when viewing it.  If you change resolution bit rate, frame rate, etc., it will effect the video stream that the Vera is hard coded to view. I'll report back if I find something that works better.

I haven't tried any audio or recording features yet.  At this point, I'm pretty happy that I finally can see the picture on my phone while I'm at work.  I'll post an update if I can get any of those to work.



I purchased this Foscam FI9821W V2  off of groupon in late October and it has pretty much been sitting around ever since I couldn't figure it out.  A huge thanks to Aaron here who provided the luup files and the baseline instructions I used to get this thing working.  I hope this helps someone out!
« Last Edit: February 10, 2014, 12:50:50 am by flam5 »

Offline jmedemar

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
  • Vera 3
Re: Foscam FI8921W - Support & How-To
« Reply #12 on: February 16, 2014, 11:19:29 am »
Aaron, thank you for gathering all the clear instructions out of the FI8910W thread and into a dedicated place.

Could you please edit your post to correct a couple of grammatical errors? It would make this post easier to find using the forum search feature.

1) The camera model is listed incorrectly in the thread title and throughout the post as FI8921W. It should be changed to the correct model of FI9821W.

2) The zip file attached to the first post is also named incorrectly.

Offline epierre

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +1/-0
Re: Foscam FI9821W - Support & How-To
« Reply #13 on: March 01, 2014, 05:24:32 am »
Hello,

 I've just had a new 9821W and it appears that with the latest firmware (System Firmware Version    1.4.1.8 / Application Firmware Version    2.11.1.6), there is no more the alert url on motion detection.

  I've tried to figure how to do it...

    email: this would start an alarm mode but would never finish it
    logs: same problem
    download: would download end be enough ?



  Have anyone an opinion on it, or should this camera just be aa dumb recorder and I have to install a motion detector linked to the vera ?

Thanks,

  Emmanuel

P.S. the url triggering is such an easy feature, why have they removed it ?
868.42Mhz - Vera Lite - Aeon DSC26103, DSA22 - Fibaro SS-101, S-211, K-101 / Fortress SSA2
433Mhz - Domoticz + RFXtrx + DI-O + Oregon || Foscam 9821W

Offline JFalc

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +1/-0
Re: Foscam FI9821W - Support & How-To
« Reply #14 on: March 02, 2014, 06:01:08 am »

Thanks for your summary here.
  FYI, for me and my two FI9821W units, the AARON instructions worked with one exception.... I did the same thing FLAM5 did in that I did not select a camera type and I did not enter in username/password early on (although it appeared with the URL).

After device was recognized, I later added it to the settings tab

I also played with the FOSCAM settings  --- not the VERA settings here-- and I like the feature of emailing me snapshots upon detection of MOTION.  That is a cool feature.

I wish there was a way to detect motion triggers here in VERA though

-John