[OBSOLETE] Foscam Camera Device Handler Universal DTH with Motion Detection - SD (FI89xx), HD Ambarella FI98xx, FI99xx, Cx, Gx, Rx, Ex, Zx, Fosbaby

@OMFGitsJUSTIN… I’m curious if you ever got this working? I just spent a couple days getting my FI8910W to work. I am a complete amateur so reading through MANY posts, I finally found this one and at the begining of the post there is a gray section called, “Instructions for installing Device Type:” I followed those and re-did everything. It still didn’t work at first and after reading more, I realized that I was expecting too much. Just a note, ST with or without these apps does not yet support streaming via Foscam. Having found that out, I finally tried taking a picture. Still no love. I reset the app and the camera and finally I can take a snapshot and make the camera “cruise” (or “patrol” as Foscam calls it). You won’t see active streaming video, but everything else seem to work. I do notice however that when viewing the camera controls (and any pic I have taken) the screen is refreshing every few seconds (~10). For reference I am using an iPhone 6S with OS version 10.2.1. , ST iPhone app Version 2.3.0. I have 21 Z-wave devices and 1 Foscam 8910W.
Here are a couple of screenshots from my phone when the Foscam is selected:


Had to take 2 shots to get it all.

Thanks @RBoy for the work on the apps and instructions. I am constantly adding things to my home automation so I paid for the lifetime access… I am sure I will be using more of your apps as I expand my hubs abilities.

Regards

1 Like

So streaming does work but it needs patience because of the moving parts. There are many posts above on it.

  1. Configuration first - try MJPEG if not without MJPEG and if you camera supports RTSP then enter that. Also use the default RTSP port since Foscam has trouble using other ports. Finally make sure your camera can reach the phone and nothing in the network is blocking it since it’s a direct connection
  2. The video tile is very phone dependent as it uses the phones codecs
  3. The ST video tile is very sensitive to errors and delays. So your network needs to be very responsive and try rebooting the camera and hub as it often fixes almost all timing issues

Top 3 tips if you’re having streaming trouble :slight_smile:

Thanks! I’ll give that a shot!

1 Like

I have an FI9821W V2 and a R2 camera that I just switched over to using the HTTPS ports instead of the http ones. Changed my port forwarding to forward these instead of the HTTP ones, and updated the devices in the app to these new ports. Viewing the stream in the app works fine, but issuing commands to change the motion detection status on/off no longer seems to work. Any ideas why that is/what I may have screwed up?

ST hub doesn’t support HTTPS communication for local devices (hubAction), this is a feature requested we have requested ST staff. @slagle any word on this?

If you want to use HTTPS you will need to use an external IP address with port forwarding enabled, that goes through the ST cloud and not through hubAction.

I’m a bit new around here and with Smartthings - what does that mean exactly? Is there an example of something that can do that? Would that be like… issuing the https call through a device handler or something?

Sounds like I’ll be switching back to http :slight_smile:

Hmmm, any reason that the standard: http://xxx.xxx.x.xx:xx/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=USERNAME&pwd=PASSWORD would not be working in ActionTiles? Everything is working fine on the end of the smartthings app. Any tips gladly appreciated. Thanks!

Put it into the browser first directly and see if it works. If it isn’t working then either configuration is wrong (did you enable MJPEG in your ST camera settings and then press Refresh?) or your browser doesn’t support MJPEG.
If it’s working in the bowser then try it in ActionTiles. If it doesn’t work in action Tiles but works in the browser you should contact action Tiles support.

###Foscam Camera Universal Device Handler - version 03.04.04

  • Updated UI colors to match ST recommendation
  • Added ability to retrieve image from ST (for future compatibility)

###Foscam Motion Alarm Monitor SmartApp - version 02.07.01

  • < no change >
1 Like

I’m accessing my remote cameras in a vacation home with your app. Thanks. I’m doing this because my Public IP changed up there and I don’t know what it changed too, so I’m using the local IP and taking snapshots.
Of course I would love to stream… is there a command or script to get the public IP that the Hub is now using so I can stream? Obviously you can ping the devices via smartThings so it knows the public IP.
Thanks for any help.

No ST only allows access to the local IP and not the public IP through it’s API’s. Since the code runs in the ST cloud there’s no way to get the public IP of the hub AFAIK.

Thanks for the quick response.
I ended up having my real estate agent go to the house and stand on the porch to connect to my wireless. After a quick “what is my IP” I’m all set.
Thanks

1 Like

Ok… I have tried everythiI can to get a Foscam FI9821W V2 to work. I can get the snapshot to work but the live stream doesn’t. Sometimes it says “Camera cannot be found” and other times it says “An error occurred while trying to retrieve the stream” or something along those lines. I’ve tried this internally on my LAN both with a DDNS and with the external and internal IP addresses and externally with the DDNS and also the external IP address.

I can access this camera internally and externally using the Foscam app and the IPCam web client without issues (using DDNS, internal and external IP addresses). That tells me port forwarding and NAT loopback are fine. I have another Foscam (a different version) that’s working great. It only seems to be an issue with this camera. I know the FI9821W V2 are a little different than some of the others, but I’m not finding any settings that will help.

Any ideas?

Basic checklist for getting video streaming to work:

  1. Reboot hub + camera
  2. Make sure your phone can contact the camera directly (most common issue, i.e. needs a way to reach, check subnets, network configuration, wifi setup, if you’re using an external IP then port forwarding, firewall etc).
  3. Check device handler settings.
  4. For the 9821 V2 there is no need for RTSP, it should work fine using the standard port, you can try toggling the MJPEG option on/off to see best compatibility with your phone
  5. As mentioned above the ST video tile is very sensitive to errors and any network issues, delays etc can cause it to not stream properly. Also the phones codecs appear to have a role in the compatibility of streaming. So sometimes it not work on cellular network 3g/4g but may work with LTE is you’re using an external IP. Similarly WiFi network latency issues can cause issues.

I did all these things but still the 9821 V2 isn’t working. It works via every other tool except this one. Port forwarding is working, as I can use my ddns from a web browser both inside and outside my LAN. I don’t have an RTSP port in the settings, but when I look at the device settings in the api, it shows this (the *** are valid user, password, and server names):

{
    "OutHomeURL": "rtsp://***:***@***.synology.me:7070/videoMain",
    "InHomeURL": "rtsp://***:***@***.synology.me:7070/videoMain",
    "ThumbnailURL": "http://cdn.device-icons.smartthings.com/camera/dlink-hdpan@2x.png",
    "cookie": {
        "key": "key",
        "value": "value"
    }
}

I verified SmartTiles also still works, and it does. The URL I use in SmartTiles is:

http://***.synology.me:7070/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=***&pwd=***

In the live logger, I see this when trying to view the live stream:

1f1ae883-8040-4ebe-a4e4-2368966028d1  11:30:57 PM: trace Video settings: [OutHomeURL:rtsp://***:***@***.synology.me:7070/videoMain, InHomeURL:rtsp://***:***@***.synology.me:7070/videoMain, ThumbnailURL:http://cdn.device-icons.smartthings.com/camera/dlink-hdpan@2x.png, cookie:[key:key, value:value]]
1f1ae883-8040-4ebe-a4e4-2368966028d1  11:30:57 PM: trace Fetching video from: rtsp://***:***@***.synology.me:7070/videoMain
1f1ae883-8040-4ebe-a4e4-2368966028d1  11:30:57 PM: debug Starting video streaming with High profile stream

This results in “There was a problem retrieving the livestream”…

Does this tell you anything meaningful? The ONLY thing I have left to test is to wire the camera to the LAN, but I have extremely strong WIFI and gigabit internet. My wifi speedtest results are 5ms Ping, 160Mbps Down, 100 Mbps up, and that’s a slow one.

Having the exact same issue kr0490 had. Were you guys ever able to sort him out? Have tried all the troubleshooting in the various posts (rebooted camera/hub, reinstalled following the installation instructions, etc.) with no luck. Live Logging seems to indicate that the camera can talk to the hub and vice versa (not seeing any errors). Thanks!

No errors doesn’t mean the camera is talking to the hub, you need to see an actual response (Blue INFO lines) from the camera, what you’re likely seeing is the hub sending commands to the camera but you won’t actually see a response from the camera meaning the hub can’t each the camera.
If it can reach the camera will see the words “Response:” in a Blue INFO line OR you’ll see a Red error message with what the error is (login/password, permissions etc). Likely your camera and hub are on different networks. Check your subnets and IP network configuration.

Updated the guide to Video Streaming Configuration and troubleshooting:

Got it mostly working after hours of playing around. Within SmartThings, it still doesn’t take the picture when motion is detected (manually I can take a picture and it shows the image in the tile). This may because I am using the in-built functionality of the Foscam C1 to email pictures & record video when motion is detected and it is just too much going on. I may try disabling the email bit as I’d rather see the images in SmartThings than go fishing in my email for it.

Thanks RBoy for the great device handler. It’s awesome having the camera enabled/disabled with my SHM.

Here’s how I got my setup functioning - may be of help to others.
(1) After hours of frustration, I eventually put my ISPs necessary router in bridge mode. Even with port forwarding, it was unreliable and also did not allow the external IP address to be used from within the LAN by design. With my router running DD-WRT, this is not a problem now that the ISP provided one is in bridge mode.
(2) Assigned the Foscam a static LAN IP, forwarded the port to it.
(3) Enabled FTP server on my router running DD-WRT so that recorded videos when motion is detected are saved to an old external USB drive attached to it.
(4) Using the device handler and app.

Note - firewalls are everywhere. :slight_smile: I found a lot of computers I have access to couldn’t access the camera itself, this is mostly due to ports being blocked I believe.

The last thing I’d like to do is synch the saved video files with some free cloud storage. I know Google Drive and DropBox only sync a specific system folder the setup so still looking for a better solution that would allow my always-on PC to sync a network drive (its attached to my router) to cloud storage.

1 Like

I can’t seem to get it to take pictures also when the alarm triggers. I finally got the issue of the motion sensor showing error. Didn’t realize that you had to use an admin account in order to let it have the proper abilities.

1 Like