Resolving FOSCAM connection dropouts

I bought a FOSCAM FI8908W wireless IP webcam off eBay recently. It has lots of features for the price.

However, I've had problems with being unable to connect to the camera after a period of time (an hour or so). Power cycling the camera would fix the problem.

I've tried upgrading to the latest firmware (version 11.14.2.17 is supposed to fix WiFi disconnection problems), but it did not fix my problem.

Problem analysis

The problem is not related to my browser or the wireless network. I've tried disabling DHCP (router based static IP). It turns out the problem is that the webcam simply ceases to respond to ARP (Address Resolution Protocol) requests (once in this broken state).

ARP is a mechanism to translate between IP addresses and device MAC addresses. It underpins all IP communications over both Ethernet and WiFi, since at the lowest level it relies on exchange of packets between device MAC addresses. The ARP protocol allows a network device to discover the MAC addresses of the peer device with the designated IP address, therefore allowing communication.

When the IP webcam stops responding to ARP requests, you're in a situation where your client (PC/NAS etc) says "who has this IP?" and simply gets no response.

A static ARP entry is a fixed mapping between an IP address and the device MAC address.  In this case you never need to ask "who has this IP?", because it is known in advance.  Instead, the IP to MAC translation is successfully performed and the request packet sent to the destination.

TIP: A static ARP entry must not be confused with a static DHCP lease.  A static DHCP lease means the device is granted a fixed/static IP by your modem/router (based on its MAC address).  However clients will still lose communication with the device once it ceases to respond to ARP requests.  The modem/router cannot respond to ARP requests sent to the IP webcam, the IP webcam must respond to these.

Where to fix

Fixing the problem needs to be done on all devices that will communicate with the IP webcam.  If you simply do so from the family PC, or laptop then you need to apply the fix there.

If you have a NAS (Network Attached Storage) device that records from the IP webcam then you need to apply the fix on the NAS itself.

If you make the IP webcam directly accessible via the Internet, then the change would need to be applied to your modem/router.

Prerequisites

Assign static IP address

Since we'll use a fixed mapping from IP address to MAC address, you will need to use a fixed IP address for your IP webcam.  This is referred to as a static IP address.  The IP address is normally configured in the IP webcam settings, though you can get fancy and get your router (DHCP server) to always assign the same IP address.  Make sure the IP address is not in the range that might be assigned to other devices.

To identify the configured IP address range used by DHCP, you will need to refer to your modem/router.  For example this device is using the range 192.168.1.1 to 192.168.1.100 to dynamically assign to devices.  Therefore you could allocate a static IP of 192.168.1.200.

Example showing modem/router DHCP configuration screen

Determine MAC address

You need to know the MAC address of your IP webcam.  This is normally printed on the device itself, and will be in the form AA:BB:CC:DD:EE:FF, or AA-BB-CC-DD-EE-FF.  Note that each network interface has a different MAC address - so there will be one for the WiFi network, and one for the Ethernet network.  Make sure you choose the correct one.

If you cannot access the IP webcam easily, then instead you can determine the MAC address from your PC.  Reboot your IP webcam so that it will be accessible.  Then open a terminal or Command Prompt window, and run these commands.  Note these commands should be the same/similar across Windows, MAC or Linux.

Verify you have connectivity to the IP address of your IP webcam:
c:\> ping 192.168.1.20

Pinging 192.168.1.20 with 32 bytes of data:

Reply from 192.168.1.20: bytes=32 time=7ms TTL=64
Reply from 192.168.1.20: bytes=32 time=3ms TTL=64
Reply from 192.168.1.20: bytes=32 time=3ms TTL=64
Reply from 192.168.1.20: bytes=32 time=3ms TTL=64

Ping statistics for 192.168.1.20:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 7ms, Average = 4ms
Then display the known IP addresses and MAC addresses.  Take note of the MAC address corresponding to the IP address of your IP webcam.
c:\> arp -a
...
Internet Address   Physical Address    Type
192.168.1.20       01-12-23-34-45-56   dynamic

Solution

Solution for Windows XP

These are the commands for Windows prior to Windows 7.

Add:
c:\> arp -s 192.168.1.20 01-12-23-34-45-56
View:
c:\> arp -a
...
Internet Address   Physical Address    Type
192.168.1.20       01-12-23-34-45-56   dynamic
Delete (if you need to revert the change):
c:\> arp -d 192.168.1.20

To make this change persist after rebooting, simply add the "arp -s" command to a batch file that you run from your Windows startup folder.

Solution for Windows 7 and Windows 10

Note that adding & removing static ARP entries must be done using an Administrator Command Prompt.

Add:
C:\WINDOWS\system32> netsh interface ipv4 add neighbors "Local Area Connection" store-persistent 192.168.1.20 01-12-23-34-45-56
View:
C:\WINDOWS\system32> arp -a
...
Internet Address   Physical Address    Type
192.168.1.20       01-12-23-34-45-56   dynamic
Delete (if you need to revert the change):
C:\WINDOWS\system32> netsh interface ipv4 delete neighbors name="Local Area Connection" 192.168.1.20

Unix (NAS, and possibly MAC)

These commands have been tested on a Synology NAS.

Add:
# arp -s 192.168.1.20 01:12:23:34:45:56
View:
arp -a
...
? (192.168.1.20) at 01:12:23:34:45:56 [ether] PERM on eth0
Delete (if you need to revert the change):
arp -d 192.168.1.20
You need to run the arp command when your NAS boots.  On a Synology NAS you would use the Task Scheduler.  Otherwise for other brands you may need to create an init script, or cron job instead.

Modem/Router

I strongly recommend against letting your IP webcam be accessed directly from the Internet.  Specifically you should not be relying on the security of your IP webcam.  There could be a security flaw which mean that the IP webcam is (a) allowing strangers to access the video feed, or (b) providing a back-door into your home network.

A much better way is to get a quality router or NAS with VPN server functionality.  From the Internet you can then establish a secure VPN between your laptop/smartphone and your home network. Once the VPN is connected, then you can access the IP webcam just like when you're at home.

However, if you wish to proceed...

The commands are likely to be different for every brand of modem/router.  It may be impossible to configure on many brands or models.

These commands work on an older Billion modem (7404VGO-M).

Add:
C:> telnet router_ip
admin> ip interface iplan add staticarpentry 192.168.1.20 01:12:23:34:45:56
View
C:> telnet router_ip
admin> ip interface iplan list staticarpentries

Static ARP entries for interface: iplan

ID   | IP Address      | MAC Address
-----|-----------------|-------------------
1    | 192.168.1.20    | 01:12:23:34:45:56
-------------------------------------------

Smartphone

It is only likely to be possible if you have a rooted mobile.
I suggest you get a NAS with built-in capability of recording and storing video from your IP webcam.  Then, use the apps provided by your NAS manufacturer to access access live view and recordings.

Comments

Arthur's Blog said…
Hi Mark,
Great blog, fascinated by the auto chicken door.
Re the Foscam
I have this dropout problem too, even with wired connections.
I have tried your suggestion. First I right click the command prompt to get administrator mode, then I try the arp - s ip mac
and it says:
The ARP entry addition failed, access is denied.

Is there a way around this?

Regards,
Anonymous said…
@Arthur's Blog: From what I can tell you're using Windows 7 which has a different security model.

It appears that even if you attempt to run commands as the Administrator user, the commands will still run without full privileges.

A web search turns up lots of people with the same problem - such as this page:
http://allfaq.org/forums/t/146100.aspx

Under Windows 7, you also need to use a different command instead of arp, specifically something like this:
C:\> netsh interface ipv4 add neighbors "Local Area Connection" store=persistent 192.168.1.20 01-12-23-34-45-56

It appears to support persistent definitions, so you only need to run the command once (logged in as the Administrator).

That said I've got Windows XP, so I might be wrong on the syntax.

Tell us how you go.
Arthur's Blog said…
Hi Mark,

So far I haven’t managed to get the windows7 command to work, but I have to read up more to be certain I know what I am doing having only just got win7.

But I also wanted to run the Foscam remotely while I was away without leaving a computer switched on, just the router. I have set up the dynamic domain name server to allow incoming access of the camera via the router. The arp fix, as I understand it, wouldn’t help with remote access via a standalone router.

I have a few other observations that may lead to some understanding if not a fix.

My original configuration to avoid trouble with wireless through walls was to use the IP camera’s via a Homeplug, network:
http://en.wikipedia.org/wiki/HomePlug_Powerline_Alliance
The Homeplug is, as I understand it, a switch (Foscam recommend a switch over a hub) operating via the mains electricity in the house. But I got disconnects and so I tried wireless. This seemed to work better for a while, but perhaps it was just wishful thinking as the wireless now regularly drops out. I presume the static arp (xp) (netsh win 7) would potentially cure the Homeplug disconnects too.

Meanwhile I have run one camera directly wired to the router and so far, a few days and counting, it hasn’t dropped out.

So I have three potential solutions but only one is mildly elegant:

1 Wire all (3) cameras to the router.

2 Another solution mentioned on another thread would be a timer to recycle the power every few hours. I have some 48 position (15 minute period) mechanical timers which would do this.

3 I could leave my old xp machine running, having set static with arp, the trouble here being I have experienced a computer left running start to burn although thankfully it didn’t cause a fire. But I would hate to have a remote picture of the house burning while I was away.

Regards,
Anonymous said…
@Arthur's Blog: When/if you've got multiple problems it can be difficult to resolve each individual issue.

This arp/netsh issue will affect wired & wireless communication. So if you have wireless/homeplug issues then just use a direct wired connection to your router and confirm that is stable/reliable.

I identified the source of my problem when I couldn't connect from one computer, yet another computer still had the video window open (and could still ping).

To check if the wireless connection is active, you may be able to check for an active association in the wireless access point/router. For example check the log files or status page. A wireless session can exist even if IP communications cannot be established.

Even if the wireless/homeplug network is unreliable and intermittently drops out, then communications should be reestablished again. Try power cycling the IPCam (or other devices) to see which device is the source of the problem.

Finally to allow remote access via a public IP, then it is your modem which initiates the local area connection to the IPCam (on behalf of the Internet client). You will need to add a static arp entry to the modem. Each modem will be configured differently. My Billion modem/router can only configure static arp via a command line interface.
C:> telnet router_ip
admin> ip interface iplan add staticarpentry 192.168.1.20 01:12:23:34:45:56
admin> ip interface iplan list staticarpentries

Static ARP entries for interface: iplan

ID | IP Address | MAC Address
-----|-----------------|-------------------
1 | 192.168.1.20 | 01:12:23:34:45:56
-------------------------------------------
Arthur's Blog said…
Progress with the drop out problem.

I am using a edimax router:
http://www.edimax.co.uk/en/produce_detail.php?pd_id=314&pl1_id=3&pl2_id=19

The equivalent of static mac to IP for this router seems to be DHCP reservation. See:

http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

This feature (which is not supported by all devices) is variously called Static DHCP Assignment (by DD-WRT), fixed-address (by the dhcpd documentation), DHCP reservation or Static DHCP (by Cisco/Linksys), and IP reservation or MAC/IP binding (by various other router manufacturers).

I am currently working in Oxfordshire with 3 cameras 170 miles away in Lancashire and a fourth camera (borrowed) here. So I have two of the Edimax routers and I have set DHCP reservation to cover the cameras with three fixed ip-mac in Lancashire, one here.

I have about 1.6 mbits down stream (about 0.4) upstream in Oxford, 5.2 and 0.4 in Lancashire and this may be a bit slow.

I had lots of troubles with Microsoft Explorer in terms of dropping the cameras but as I like the explorer display I struggled on but the huge down loads of information for the Explorer display and numerous errors sent me to Firefox, which worked, but it then started crashing. So I went with just the four cameras to Google’s Chrome browser, no other tabs.

This now seems to work. I have lost a camera but it then recovered. The display compared to Explorer is crude, but working is what matters and probably this interface will be enhanced in the by and by.

So for now communication between Oxfordshire and Australia (around 10,500 miles) between two individuals who know almost nothing of each other, has fixed communication between Oxfordshire and Lancashire (170 miles apart).

What amazing times we live in.

Many thanks for your help.

Regards,
Anonymous said…
@Arthur's Blog: With my (Billion) modem/router, a fixed DHCP reservation is not the same as a static ARP entry. Other brands may be different.

Anyway, I'm glad it's working out for you.
REGINALDO said…
Hello,
I am not able to configure the router (TPLINK). How do I setup? Thanks!
REGINALDO said…
I want to configure IP CAMERA WIRELESS to have wireless access through the router. Tell me step by step. Help me please. Thanks!
Anonymous said…
@REGINALDO: I think you'll have to read the TPLINK manual or at least be more specific on what your problem is.

The problem described here is not a wireless problem. You'll need to get the wireless connection working before you figure out if this problem is affecting you.
Unknown said…
hi Mark, i am having problems with foscams frame rate being very slow, when viewed externally. On local LAN it works fine. I have ADSL 2 connection. But every time I login to view the camera, its nver 25-30 frames per sec, but rather 5 frames.

The camera is connected straight to the router. I was reading that there is an option to set frame rates, but i could not find it. The camera was bought on ebay.

Thanks

Igor
Anonymous said…
@Bender: Gadget Victims describes how you can specify the resolution and frame rate on the URL.

> Updated CGI documentation:
> /videostream.cgi[?user=&pwd=&resolution=&rate=]
> /videostream.asf[?user=&pwd=&resolution=&rate=]
>
> Parameters:
> resolution:(8:320*240,32:640*480)
> rate: 0-23
> 0:maximum
> 1:20 fps
> 3:15 fps
> 6:10 fps
> 11:5 fps
> 12:4 fps
> 13:3 fps
> 14:2 fps
> 15:1 fps
> 17:1 fp/2s
> 19:1 fp/3s
> 21:1 fp/4s
> 23:1 fp/5s

I believe this only works in the later firmware revisions.

That said, your problem must be due to the speed of the ADSL 2 connection, since problems are not observed on the local network.

Keep in mind that for ADSL connections the upload speed is much lower than the download speed. ADSL 2+ has a maximum upload speed of 1.4Mbps, however your speed may be much lower.

I suggest you run an Internet speed test to determine your upload speed.

Also the Motion JPEG video format is not very compressed. In fact it is less compressed than I thought it would be.

I've analysed some recordings of mine, and the bit rate varies substantially between them. The highest was 2.86Mbps (including audio), the lowest was 1.12Mbps (no audio).

Based on these bit rates, I suspect it is highly likely that it is exceeding the speed of your ADSL 2 connection.

I guess the options then are to get a H.264 webcam or use VLC to perform transcoding on the fly.

Actually eBay has some not-to-expensive H.264 webcams, including the DOZ27W and GD-2805.
Anonymous said…
I've confirmed the same problem affects the Foscam FI8905W (at firmware level 11.25.2.30).

Luckily adding a static ARP entry also fixes this camera.
allan said…
I think the problem has to do with certain types of routers or maybe the use of a subnet with NAT circumvents the issue. I have resolved the problem of Foscam dropping off my network by using an older belkin wireless G router and putting the cams in that subnet.

See my summary page for more details: http://allankosowan.com/FOSCAM.htm
Jeff said…
This still resolving your troubles? After a few months of untroubled use, two camera's have started this exact behaviour. I am going to try to figure out the ARP settings for my dd-wrt router.
Jim said…
Great catch on the foscam camera; I added an arp entry and for the first time in weeks its gone > 1 day without disconnecting. THANK YOU!
-jim
Radu said…
I have a IP camera FI8908W and a router D-Link DIR655. IP camera connects to router using wifi
I have configures router to have a daily schedule for Wifi: starts at 9 AM and stops at 11.30 PM every day.
The issue is that IP camera does not starts when wifi starts at 9 AM.

The only way to make camera starts is to unplug and re-plug the power cord.
I have tried to use this tutorial and I have assigned a static ARP entry. Still not fixed. camera refuses to connect to the network when Wifi starts.

Camera is using firmware 11.4.2.28 and web UI 2.4.8.15 (latest from foscam site: http://www.foscam.com/down3.aspx)
Mark Stead said…
@Radu: I think you only require a static arp entry on your router if you are trying to access from another network - for example if you are trying to access over the Internet (or you have multiple local subnets).

Otherwise for a local connection, you will require a static arp entry on the client (e.g. PC or NAS) from which you are attempting to access/view the video.

The first step to diagnose is to determine whether you can ping the camera.

BTW Why don't you disable the WiFi schedule to prove that is or isn't part of the problem.
Unknown said…
Hey Mark,

Sadly the solution didn't work for me. Nothing to do with an arp issue or so.

But i've found out that when i lower my speed in my switch from 100FD towards 10HD, i don't have any disconnections anymore...
Nasitopo said…
@Radu:
Did you solve your problem?
I have exactely the same problem.

(The issue is that IP camera does not starts when wifi starts at 9 AM. The only way to make camera starts is to unplug and re-plug the power cord)
Admin said…
There is a new firmware out that might just solve this problem, check it out here!
Nasitopo said…
@Now What If I Do
The new firmware is not for FI8908W..

Is it possible to use it in any case?

Thank you in advance
Anonymous said…
Camera Keeps Dropping off. I have the solution. Log into the camera and turn the brightness and contrast down from the default 6 on both settings to 3 on both settings. I have pulled my hair out and found that this corrects the issue with the camera dropping off. Its a light particle issue with the Foscam Cameras.Let me know how you go with this :):)

Regards
Matthew
IT Engineer
Nasitopo said…
@matthew lovelace

I tried but the solution you proposed doesn't solve my problem.

(The issue is that IP camera does not starts when wifi starts at 9 AM. The only way to make camera starts is to unplug and re-plug the power cord)
Fred said…
@matthew lovelace

This is a September's fool joke isn't it ??
Keanen said…
@matthew I cannot believe it but changing these values has my FI8904w up and running for a few minutes so far. Before changing these values, I could not get a stream to run for over a minute or two. Woot woot!

Thanks!
DonMcJr said…
Hello! Great Blog! I have 2 IP Cams running and have had them for 2 years no problems...had to buy a new router and the wired one works on host computer and remotely... the one that connects wirelessly works on host computer and will work on the Tinycam APP on my phone IF I an connected to the wireless network on my phone but it will not work on just 3g/4/g or remotely anywhere. Setting same for both cams different ports of course. WHat am I missing I know it's something infront of my face and I'm just missing it...
brewski said…
I have a foscam set up outside. It has driven me nuts. It is the second foscam camera(a replacement for the first). It seemed to work but the picture dropped ie a broken image symbol refreshing the camera shows an image for 1 second and then broken symbol again.
However changing the resolution to 320x240 the camera returns a stable picture.
Now on recommendations here I changed the brightness to 4 and the contrast to 2 and reset the resolution to 640x480 the picture seems stable.
Unknown said…
Hi mark great site I seek your help I have a FI9805w after setting all parameters & saving the cam denys me access after power down I get access deny @ log in I have set static ip as you suggested do you have any ideas Thanks Ron
Unknown said…
Hi There,

I am having a very simular issue. I have a client who has 5 cameras. 3 are a FI8905W, 2 out of those 3 always disconnect and never work unless they are hard wired.

Because of the size of his house, we have implemented a wireless repeater, we have gone through 4 different brands and the issue has occured. All the cameras are on the latest firmware, and I have adjusted FPS and resolution.

When the cameras "go out" they are not pingable, even from my laptop on site on the customers wireless network.

There are 3 cameras on this repeater, and only two of them constantly disconnect. One camera, which is a FI9805W, goes out periodically, but its oly for 60 seconds, then it will be find for several hours and fo out for a minute.. and so on, no pattern to it.

I am at my wits end here and the customer is frustrated, any suggestions? All this stuff about ARP, I am familiar with, should I try it?

Any suggestions would be welcomed.
Unknown said…
I also had issues connecting Foscam's wirelessly.

This is what helped for me: I figured that my Foscams ONLY SUPPORT 20MHZ-CHANNELS...

Now everything works fine...
Unknown said…
The ARP entry addition failed: Access is denied.
sanjit said…
Hi there,
I have recently bought a Vstarcam IP camera from ebay.It connects well over ethernet to my Technicolour router. But does not connect through wifi.
I found it has got the same MAC address for both ethernet and wifi.
Perhaps that is an issue?
If so, can you suggest a way to spoof wifi MAC of the camera? I can use either Vista or Windows 10 laptops from the same network.
Cheers,
Sanjit
HEC said…
Hello all...

I have two Anran AR-24NR-WIFI-IP2 cameras and I had similar problems.

I just want to add that I also couldn't connect them via WiFi until I found that WiFi passphrase (WPA2) must consist only from hexadecimal characters.

Also wired IP address must be different from WiFi IP address.

I think that Anrans are based on the similar hardware as Foscam, because for example once I loaded Edimax wifi cam software into Airlive wifi cam and it works, with even more options.

It's strange that when I enable 1080p resolution, after some time it looses IP address like it is described before. I'm not using DHCP. It is still associated to AP, but IP address resets always to 192.168.1.12. Since my cameras and AP uses another subnet in production, I just temporary change AP to be in 192.168.1 subnet and then I could find camera there on 192.168.1.12. Then I just change camera WiFi Ip addr to production IP address, and later I change AP back to production subnet.

When I installed better diy antenna on AP year ago, then it does not happen so often (maybe two, three times per year). So it has something to do with connection quality, or bug within camera firmware.
Fen Tyler said…
Switching the Foscam off then on again always seems to 'wake it up'. I now have it plugged into a simple timer switch on the power point. This is set to be on for all but a brief off period in the middle of the night. If you can live without having the cam live at all times of the day this should work for you too.
Unknown said…
Dear Brains Trust,

I too seem to have this problem. I am using a HTC One XL Android phone as I need to access the camera from my phone rather than a PC or laptop.

Camera seems to be dropping out every 10 mins or so.

That being said.....do I still need to do something at the PC end?

I just purchased 2 cameras in January 2017.........wouldn't you think they would have had a fix released for this by now?

Any suggestions would be greatly appreciated.
Unknown said…
Couldn't add the arp commands. Access denied, even as administrator.
But I've noticed my clock was out of sync.
Resynced it. And that seems to work.

Popular posts from this blog

Building an automatic chicken door opener

TVersity media serving to the Astone AP-300