Shortcuts to some IP Camera functions

Jan 27, 2010

The following is a selection of CGI functions that can be used with Foscam ip cameras. They are issued through the URL line of a browser and can be used as convenient shortcuts to features that are not ideally accessible in the original UI, like the network activity led, which is located on a page that requires a reboot while the function itself could be activated instantly.

this will turn off the green activity led instantly.
The valid values are as follow:
led_mode=0 - the green led blinks only once connected.
led_mode=1 - the green led blinks while searching for a connection and when connected.
led_mode=2 - the green led is always off.

See here for the meaning of the different blinking rates.

the camera won't auto-rotate any more when restarting, so you won't need to re-position it any longer upon rebooting.
This function is currently not implemented in the user interface and  instructs the camera  to start a patrol at a defined interval, here 30 seconds.
The patrol type is defined by this other command: 
Possible values: 0: None; 1: horizontal; 2: vertical; 3: Horizontal + Vertical

http://[ipcam]/set_misc.cgi?ptz_patrol_rate= 20
The value provided will defined how fast the camera will rotate on patrol, here 20 is the default.
Fastest speed = 0. Slowest speed = 100.

Returns all the current values  for the functions above.

Displays the visits log

Returns the complete configuration of the camera.

All the commands can be chained in the same url by using & as separator.

(complete documentation can be found on this page)


  1. Looking for a way to bypass the user login and change view to multicam 4 sources.

  2. @Ron
    most commands can be followed by &user=username&pwd=password
    Other way is to use http://username:password@ipcamurl/

    There's no documented way to display several camera source from a simple CGI command. That would require to build your own html page with the help of the CGI SDK documents (that can be found here).

  3. I have two Foscam's that are working fine from my local network.
    Both are working wireless, are sending email and text messages to the designated addresses.
    One issue that I am trying to resolve is recording to my new laptop PC.
    I have the ipCamera Tool setup on a desktop and laptop.
    It will record to my Windows XP desktop, but it will not use a designated folder I direct it to. Not a big deal, at least it records.
    For my windows 7 laptop, it opens the Public Documents folder which is the designated folder for recording when an alarm goes off, but it does not show a listing for any video. I do not believe it's recording at all. Any idea on a fix or is this a common issue?

    I am also trying to figure out the accessing the cameras from outside my home network. I have attempted a few things with no success. I just did some changes to the windows firewall to allow public access for the cameras. I will be testing that later to see if it works.

    I want to also thank you for the info presented here. It has helped. A lot of the topics here are new to me. I thought I had a grasp on basic PC items, but this is a whole new world. Everything has an abbreviation. I try to do this on my own with the help of your forum, but I think I have met my match. I will continue to reference this site for updates. Thanks

  4. @K W Lang
    I think you'll enjoy playing with these cameras, they're not bug free but they're really good value and the customer support is surprisingly good.
    You can control where you want the recording to land by going in the camera setup, at the bottom of the page where you define the users. The ActiveX control is quite problematic especially on IE8, it requires some attention from Foscam as it's been obviously build with an old compiler. There's a post on 3rd party software that you could use instead of the native interface for recording.

    For accessing from the outside, you'd need to create free account with a dynamic dns provider like, depending what is supported by your router. You could setup the dynamic dns (ddns) within the camera itself but that's not the best way, use your router instead and setup some port forwarding. You'll find more info in the FAQ for IP cameras post and the foscam manual that you can also download from the firmware history page.

    Have fun!

  5. I have 4 of the FI8908W cameras. All have very low chroma. The lower the light level, the lower the chroma level, and I would expect that with infared lighting at night, but not in normal daylight conditions. I don't use these cams outdoors ... indoor natural light. Is this a common problem? Is there a cgi command to adjust chroma level?

  6. @Ron
    It's unfortunately a common problem. The typical example is that plants would appear pink. I haven't seen much improvement by changing the lens but Foscam claims that newest productions (from September 2009 onwards) have a better filter. I can't tell since my most recent FI8908W is from July.

  7. thanks for the tips!!

    im trying to get a lens for it, the pink does my head in. btw will that block IR?

  8. SteveS,
    Regarding IR, the wide angle lens I fitted is comparable to the original one, and unfortunately did not improve the colors rendering.
    However it gives a sharper picture that I could not match with the original one, even with best focus.
    This article gives more details.

  9. I was wondering if someone could help me. I have a 4 camera systems, everything is running great. But I would like to be able to enable and disable the motion detection on all four cameras at once. I've tried to use the set_alarm.cgi command, but I keep getting a "invalid param" error. As anyone got this to work? Thanks!!!!

  10. @Paddock
    you're right, I do get "error: illegal params." with /set_alarm.cgi?motion_armed=1
    If you do a get_params.cgi, it actually reports the variable name alarm_motion_armed instead.
    However I tried set_alarm.cgi?alarm_motion_armed=1 and still get the error...

  11. @Paddock
    just found out that /set_misc.cgi?alarm_motion_armed=1 works!!

  12. Thanks Bubbah. You da man!!!

    Now can you help me string 4 commands together to disable/enable 4 cameras?

  13. @Paddock
    you could do that by launching the url chained in a command line, like:
    firefox.exe "url4cam1" "url4cam2" "url4cam3", and so on... it will launch Firefox with as many tabs as there are url's.
    Just put this in a batch file.
    Same works for Chrome.
    I'm sure something similar is possible with IE but I just don't really bother.

  14. I wonder can you string the commands together with the "&" separator? I building a HTML page to use with IE. I'm not near the cameras now so I won't be able to try it.

  15. @Paddock
    You need a script to do that, there are several places explaining how to do this in either vbscript or javascript, like here.

  16. Hi Bubbah,

    I finally had a chance to try the alarm_motion_armed command. I do get a OK returned, but the setting doesn't change. Did you check the actual setting on the camera when you tried?

    Also, just a FYI. I took apart one of the cameras and positioned the MIC outside the casing. There was a big improvement on the sound quality, especially when loud/deep sounds are recorded.

  17. Hey Bubbah,

    I had a chance to actually try the alarm_motion_armed command and I get a n OK returned. But when I check the settings nothing has changed. Did you actually check the camera when you tried?

    Also, I relocated the MIC outside the camera case and there is a big improvement especially when listening to loud or bassy sounds. Just a FYI.

  18. @Paddock
    I realize my answer by email didn't make sense, I was focusing on the FPS setting, which I think is not really implemented in the CGI set. The alarm_motion_armed is implemented but it's still true that set_misc.cgi replies ok to everyting. I'm on travel right now so I'll have to resume some testing in 2 weeks time.

  19. I found this in alarm.htm. Basically that's how the configure page sets the alarm parameters and I can't see what difference there is to the way you guys tried above. Maybe It requires all the parameters to be set at the same time? I haven't tried cos the schedule part is too long to edit. Anyone has better ideas?

    function set_alarm()
    if (motion_enable.checked||extern_enable.checked)

  20. This comment has been removed by the author.

  21. (hopefully, this will format correctly)
    I've begun talking to my camera with direct http using Winsock and not even any browser, totally bypassing the Web page interface(s).
    Following the CGI sdk documentation v2.1 (which I believe I obtained here!) I can fetch the current settings using all of those get_.cgi" calls.
    I can also SET many of them using the appropriate "set_.cgi" calls.
    Most were straight-forward. A couple need editing - and two are giving me a headache.

    For those who're interested, the necessary corrections are:
    for use with:
    set_mail.cgi docsays="user" correction="mail_user"
    set_mail.cgi docsays="pwd" correction="mail_pwd"
    set_ftp.cgi docsaid="user" correction="ftp_user"
    set_ftp.cgi docsaid="pwd" correction="ftp_pwd"

    I'm still having trouble with "set_alarm.cgi" and "set_wifi.cgi"
    Keep getting the "error: illegal params" response. That tells me that the varnames are probably different in them too. Just have to discover what exactly they are!

    And I'm confused about "set_forbidden.cgi" - it works... but it seems to reference a totally second set of variables... those returned by "get_forbidden.cgi".
    The "get_params.cgi" returns a different set of values. It may be that I still need to call
    the "reboot.cgi" to make those take effect (as necessary when changing params via set_setwork). I'll find out.

    This is being done using the older firmware and
    It may be that the later versions have corrected the varname problem.

    Has anyone else gotten "set_alarm.cgi" to work?


  22. It rings a bell, actually if you check in the previous comments on this page, you'll find some between a certain Paddock & I about this. The cgi documentation appears to be wrong on set_alarm.cgi

  23. @Bubbah,
    @Whoever's Interested,

    I've sent a request to Foscam for any recent version of the CGI sdk but may not need it now.
    I took a look again at the SDK documentation you've linked here and comparing both (the English and the Chinese) I noted that the Chinese version says the "Set_Alarm.cgi" includes the same parameters that are in the "set_forbidden.cgi" - that's all of those "schedule_ ..." parameters.
    I just gave it shot and whattayaknow - it works!
    Now if I could only learn Chinese! ;)


  24. Tech support at Foscam was quite helpful.
    When calling set_mail.cgi or set_ftp.cgi, you should use the parameters "cam_user=" and "cam_pwd=" as a substitute for the normal "user=" and "pwd=" since those keywords are intended for the mail or ftp user and password. It works fine!
    (note that this is contrary to my previous post where "mail_user" etc would work. All that did was retrun an "ok." but it hadn't changed anything. "cam_user" etc does work.)

    I'd also found that the "set_alarm.cgi" does indeed require all the "schedule_..." parameters, even if changing a single item.
    That's tedious - I want to make a quick button
    that will turn the alarm service either ON or off. The only way I see is to include the whole thing either way.

  25. W. David, have you been able to get anything to work to turn the alarm on/off remotely? I've been unable to get anything to work.

  26. Hi, love the blog. Bubbuh, you are the man!

    I just recently got my FOSCAM up and running. However, my place of business blocks video streams so I've created a webpage that captures screenshots via {IPCAM-IP}/snapshot.cgi.

    My webpage also throws CGI commands at the camera for PZT, but the FOSCAM webserver responds with "OK" forcing me to "backup" in my browser to get back to my webpage.

    I can't use the "next_URL=" CGI suffix because the next_URL must be relative. It can't be {IPCAM-IP}/index.html....that's not my webpage... bummer.

    Anyone have this problem? When throwing CGI commands at the camera from a webpage (As an example: I'm using onclick="window.location.href='xxxx[IPCAM-IP]/decoder_control.cgi?command=2'" value="Down" type="button") I can't seem to figure out how to deal with the FOSCAMS "Ok" response.

    Any help appreciated!

    (Just LOVE this FOSCAM and blog!!!!)

  27. @reverendmoon
    I think someone posted some code samples in the past in this blog but there are so many comments...
    I believe that you could take the code of the "push server" mode pages used by the camera as examples. Just right click on the left frame and get the page sources: even the .js files can be extracted that way.

  28. Excellent idea!. The code was right there in my browser all the time. Thanks Bubbah

  29. If you are looking for a

  30. Hi Bubbah, Thought you'd be interested (even though you use IE) that I made a Foscam PTZ firefox add-on using the URL commands in the SDK. In a nutshell, one click, there's the stream, no messing about having to login etc.

    Also found this awesome IR Led mod for the FI8908W, I shorted it and added a switch to the outer casing :) >

  31. @DRZ400S
    Great stuff, thanks!

    @Matt thanks too!

  32. Cheers Bubbaha .. added a snapshot button in the Firefox add-on as well. Cheers for a top Foscam blog!!


  33. @DRZ400S
    great! I'm using it now, very convenient way to quickly access the camera! thx

  34. I thought you'd like it. Glad you're keeping this blog updated, it's a wealth of Foscam knowledge.

    In the addon, I've noticed that if you include the username & password in the URL commands in the options, it doesn't ask you for a password when you first fire up the cam = EVEN QUICKER!

    Like so ...
    move commands ...

  35. @DRZ400S
    I've yet to write a little something about that plug-in in my blog, very soon...

  36. Awesome ... Cheers! :)

    I sodding love my Foscam. I'm currently waiting for a 2.1mm wide angle lens featured in the hardware section. I'd really like the FI8918W with the IR disable feature! I wonder if Foscam will send me one for writing the add-on! LOLz

    Tell you what, a guide on setting up a Foscam in Vista would be really helpful.

    Keep up the good work fella! It's appreciated.

  37. I have a Rovio from WowWee and a Foscam. I would like to see the video stream of my Rovio in the Foscam application (Device #2). No matter what kind of address or IP command I enter into the "Multi-Device Settings" there is either no connection or illegal parameters.

    Does anybody managed to realize this?

    I'm using Internet Explorer.

  38. @Matt
    Rovio has a completely different command set, (most starting with rev.cgi?Cmd= ) and the Foscam is can only be linked to cameras compatible with the CGI instructions documented here.

  39. @Bubbah
    I see. Thank you for your reply.

  40. Hi ya'll
    A frind of mine has this 27x PTZ cam:
    The vendor knows just that it is a IP-510 cam.

    Does anyone knows of ANY cgi commands for this cam?? We like to grab the pic (and if possibel move the cam arround) to use it with the iPhone.

    Thanks allot

  41. @Stefan
    the only IP-510 I found is a smaller specs camera, but maybe it's the same family? Have a look here:

  42. i try http://xx.xx.xx.xx/set_users.cgi?user1=admin&pwd1=123456

    and i get "error: illegal params". Can anyone help? Thanks.

  43. Looking for a way to send a pan/tilt command to the fosscam. Any thoughts?

  44. @P.
    You'd use //ipcamurl/decoder_control.cgi?command=x where x is a value from 1 to 7 as documented in the CGI SDK document (can be found on the firmware history page)

  45. @Bubbah

    Tnx for the info most of the commands work fine. (only "constant" movement to the left/right/above works, non-constant movement won't work but I'll check the CGI SDK doc).

  46. This comment has been removed by the author.

  47. Any solution for the "illegal params" on set_alarm.cgi?

    The correct format is: "http://[cam address]:[cam port]/set_alarm.cgi?motion_armed=1&mail=1"? Or do I need the COMPLETE string? :/ I don't know why but with other 2 ipcams "foscam-like" the above command is OK. I got this problem only with the ORIGINAL FIRMWARE... :(

  48. @Luigi
    did you try with set_misc instead?
    This possibly changed a bit in newer firmwares and the CGI doc is outdated to say the least.

  49. @Bubbah
    Try "set_misc"? What do you exactly mean?

  50. @Luigi
    at some stage, some functions documented for various set_xxx.cgi were actually only working with set_misc.cgi instead, but on second though, I think it's not the case of set_alarm but rather a bug in some fw version. The latest version is not exempt neither according to some forum.
    If you email Foscam directly with the version affected they should tell for sure.

  51. Based on some of the hints above and the sdk manual i was able to generate the following http request to set the alarm params

    You need to change the LAN IP address for your network and the PORT number.

    There were some typos in the SDK I used (eg web for wed and o for 0 etc etc).

    Also I found a free iphone app 'netcamviewer' which works great with this camera

  52. @oaklands Thanks mate! It works with that string! Thanks 1000! :D

  53. @Bubbah

    I have the same problem as p. has in this article:

    Can't get the cam to stop after sending the move command. I do saw the .cgi command to stop. But how do i send that command together with the move ?? Right now the cam starts moving but does not stop till the end.

    Thanks in advance

  54. @Bubbah

    Please help.
    Do you have any idea how to solve the problem ?
    Like to build my "webpage" to use the cam for friends.


  55. @Stef
    I'm currently on travel with limited access to the Internet. There was a bug in an old firmware where the camera was panning all the way even using the arrows from the UI.
    Otherwise, check the "source" (right-click on the page and select 'display source') from the camera interface (in server push mode). This way you can see what code is used by the camera for the "stop" button.

  56. Absolutely TOP Information, I got the blinking LED on my WANSCAM AJ-C2LA-C198 Models turned off right away!

    Thank you very much for this!


    1. Hi Ernie

      can you tell me the exact syntax you used - I have failed so far


  57. Thank you for sharing all of this valuable information :). The cgi suffixes solved my remote access problem quite nicely. I appreciate all of your efforts and will definitely bookmark this site.

  58. How do I set up the camera setting for my Foscam to send me a text message to notify me of movement?

  59. Can't do AFAIK, maybe with a Google calendar trick...

    Just wanted to say that the network light command works fine with the WANSCAM AJ-C2WA-B118 with IR Cut available at dx for the grand total of $57.50...has to be the cheapest IR cut cam around !

  60. Please see this as well: Click Here It has 9 Live Demos and one of them you can use your own cameras with. Allows you to access many hidden features in these cameras, many different brands, models and clones are supported.

  61. This forum is great! Does anyone know how to set the schedule for alarm? I try to make a command line for setting alarm "on" and "automatic (scheduled)" This sets only on, but not scheduled:

    Thanks for anyone replying.


  62. Found it with the great link from uber:


    This gives a scheduled alarm. Now searching for a way to set alarm on 4 camera's at the same time, with one click..

  63. Got it working with a .js script! Here it is: one click triggers all 4 alarms scheduled. Simular script can be used to disable and change them. Now I can set the alarm on all my cams when I leave the house :-)

    Copy and paste this in a text file, rename it to anything.js and put it on your desktop.

    Thanks everyone!

    var navOpenInBackgroundTab = 0x1000;
    var oIE = new ActiveXObject("InternetExplorer.Application" );
    oIE.Navigate2("" );
    oIE.Navigate2("", navOpenInBackgroundTab);
    oIE.Navigate2("", navOpenInBackgroundTab);
    oIE.Navigate2("", navOpenInBackgroundTab);
    oIE.Visible = true;

  64. 2 remarks: js script doesn't work on win7 64bit so I made a batch file. And does anyone know how the coding of the schedule work? There is not really logic in the numbers

  65. I use JavaScript all the time on 64 bit based systems. Including Win7. So not sure what you are doing.


  66. There are many schedules for these cameras, most are hidden.

    There is a forbidden schedule which disables video, snapshots and audio for set times.

    There is also a FTP now schedule, that allows you to upload FTP images at set times, not just on alarms.

    For details on the logic of the numbers being used in the schedule values. Please see this:

    Click Here


  67. Thank you for the information! I will try to change my schedules. The problem with java was unsolvable for me. The batch-files work oke.

  68. Hello ZOverlord,

    Can you give me an example for 64 bit java file, so I can test it?

  69. Hello Don,

    I tried to set the schedule and then extract the numbers with the other site ( I put that numbers in my batchfile but get very strange times, like alarm from 6-12 and 1 x 15 min at 22 o'clock. What is going wrong here?

    Best regards,


  70. These status commands seem to work on my Hootoo IP-210 cameras. I wanted to disable the IR lights because this camera is inside (but pointing outside through a window, causing nothing but reflected IR in the image.) I am currently using cardboard to block the lights. Are there any commands to turn off the IR lights? See my post for more info:

    1. I figured out how to disable the IR lights. For details visit my blog entry regarding Disabling IR on a HooToo Indoor (HP-IP210F) and Similar IP Cameras:

  71. I took a camera apart and I think the only way to turn the ir leds off is by disconnecting the wire of the print where the leds are on.

  72. Does anyone know the command to get multiple photo's in email @ alarm? I have 5 cams which sent 6 photo's @ alarm and 1 cam sents only 1 photo.

  73. Is there a commandline to disable sound for guest access?

  74. I've contacted Tenvis, he said "no"... to bad, I have a baby now and wanted my parents to be able to look in to the crib, but it's better for them not to hear us speak about them ;-)
    By the way: here are some interesting commands:

    1. But waht camera do you have really ? Maygion, Tenvis or Foscam? Depending the model, you could give your parent a url to video streaming that does not transmit the audio (e.g. video.cgi) or even to a snapshot view (snapshot.cgi), but that depends on the camera model.

  75. This comment has been removed by the author.

  76. i can change the value of led_mode to 2 in sricam ap001 but its not working
    just 0 and 1 working always on or flashing.
    this is the good link to do that