Save a camera (its address and credentials) for this user interface. Data is saved to localStorage only on the browser you are using. Requests to cameras use unencrypted HTTP and the credentials are clear-text and show up in the browser page history. Use this web page only on your personal machine, and so that the cameras are accessed via LAN (or VPN or similar). On the other hand, if you can access your cameras over the internet without VPN or similar, you should reconfigure your firewalls.
After resetting (or when setupping a new) camera, the default user is 'admin', password empty. Use this to replace that user with the username/password given above. NOTE: This only reads the IP/username/password fields above, and does NOT use the selected camera.
Choose the camera to remove from the green 'Select the camera to control' dropdown list at the top of the page. Deleting a camera only affects this user interface (and not the camera hardware) and deletes the data you have saved with the 'Add new or edit' above.
Reset all data saved for this UI (in localStorage). (Does not affect camera hardware in any way.)
Export the data saved for this UI (in localStorage). When importing the exported file, all current settings will be lost. (Does not affect camera hardware in any way.) Warning: The exported file will contain all camera credentials as clear-text.
.This user interface for the Foscam API aims to be a portable, simple and easy-to-modify tool to install and manage Foscam API compatible cameras. Older SD/VGA cameras (IP Camera CGI V1.27) are not yet fully supported, and all the documentation etc. are for HD cameras (Foscam IPCamera CGI > 1.0.16).
This html file only requires JavaScript to work, and has no external dependencies. This on the other hand means quite a raw and clumsy user experience.
Commands are sent to the camera by opening the parsed URL as a new tab. The camera returns a response as an XML which you can see on the new tab. Therefore, some popups must be allowed, and also it makes it impossible to automatically process the response, unfortunately.
If you want to only see the parsed URL and not send the command when clicking the buttons with blue text, select the "Only show command URL" checkbox". On Linux you can turn the URL into a curl command with this syntax:
curl 'PasteFullUrlHere'
The RTSP video stream can be accessed with this kind of URLs (main, sub, audio):
rtsp://user:password@192.168.1.123:88/videoMain
rtsp://user:password@192.168.1.123:88/videoSub
rtsp://user:password@192.168.1.123:88/audio
If you are looking for a setting, you can show all categories by clicking the buttons at the top of this page and then use the search functionality of your browser. This user interface cannot know the model of your camera, so for example Wifi and PTZ (pan tilt zoom) settings are always visible but only work for cameras that support them. For more information about how this html file itself was developed, see the readme in GitHub: hyttysmyrkky/foscam_cgi_api_html.
The camera responds with an XML, for example when querying the IR LED config (getInfraLedConfig):
<CGI_Result>
<result>0</result>
<mode>0</mode>
</CGI_Result>
<result> 0 means success. Other codes for 'result':
| <result> | Meaning |
|---|---|
| 0 | Success |
| -1 | CGI request string format error |
| -2 | Username or password error |
| -3 | Access denied |
| -4 | CGI execute fail |
| -5 | Timeout |
| -7 | Unknown error |
The rest of the returned values depend on the command. If you look at the corresponding setter commands (in this case 'setInfraLedConfig'), most of them have a dropdown list of the options for the given parameter. From that list you can figure out the meaning of 0, 1, 2 and so on.
In some cases you have to look at the Foscam API PDF documentation.
In the table below there is a collection of the most commonly required commands when setupping a new camera. If you already changed the factory-default user in the 'Add/Remove camera' step, you can skip the 'changeUserNameAndPwdTogether' below. If you are setupping multiple cameras, take a look at the Custom view: There you can save the parameters (e.g. FTP server settings) and send them easily to all cameras.
| Description | Getter (read) command | Setter (write) command |
|---|---|---|
| Get users, change the factory-default | getUserList | changeUserNameAndPwdTogether |
| Test get a still image | snapPicture2 | |
| Camera name | getDevName | setDevName |
| Wifi settings (if your camera model supports wifi) | getWifiConfig | setWifiSetting |
| Clock settings | getSystemTime | setSystemTime |
| FTP settings | getFtpConfig | setFtpConfig |
| P2P settings (disable if not needed) | getP2PEnable | setP2PEnable |
| Email alarm settings when motion is detected | getSMTPConfig | setSMTPConfig |
| Snapshot settings, select save location SD card or FTP | getSnapConfig | setSnapConfig |
| Motion detection settings | getMotionDetectConfig | setMotionDetectConfig |
| Recording settings, select save location SD card or FTP | getRecordPath | setRecordPath |
| Length of recorded video clip | getAlarmRecordConfig | setAlarmRecordConfig |
| Cloud settings (disable if not needed) | getCloudConfig | setCloudConfig |
| OSD settings (text overlay on image) | getOSDSetting | setOSDSetting |
| PTZ presets, if your camera supports PTZ. Add a new preset. | getPTZPresetPointList | ptzAddPresetPoint |
| PTZ mode when camera boots (2 = go to preset) | getPTZSelfTestMode | setPTZSelfTestMode |
| PTZ preset to go at boot | getPTZPrePointForSelfTest | setPTZPrePointForSelfTest |
| Brightness | getImageSetting | setBrightness |
| Resolution and bitrate: currently active preset ("streamType") | getMainVideoStreamType | setMainVideoStreamType |
| Resolution and bitrate settings | getVideoStreamParam | setVideoStreamParam |
| Reboot camera | rebootSystem |
Motion will be detected in the checked boxes. You can set a snapshot image from the camera to the background of the table by clicking the 'Browse'. Before that you have to manually get the image (see the 'Operate' view) and save the image as jpg. When the correct area is selected, click the 'Apply area' button which will read the values from the table to the parameter fields of 'setMotionDetectConfig' below. Then set the other parameters and click 'Send to camera'.
This UI cannot read the currently active setting from the camera automatically, but the inputted setting is saved to localStorage for the selected camera.
Motion detection is enabled during every selected (starting) half an hour. Click 'Apply schedule' to read the table values to the parameter fields below.
The linkage (or action) what happens when motion is detected, is also defined the same way. Click 'Apply linkage' to read the table values to the parameter fields below.
(Not tested, may not work at all?)
(Not tested, so commented-out for now.)
| Zoom | Focus | ||
-
Here you can essentially save a set of parameters to easily send the same command later. For example, useful for making buttons "Enable motion detection" and "Disable motion detection".
The Viewer displays still images from the selected cameras in a loop. Here you can set which cameras are included.
Select some cameras in the Viewer Setup to start the Viewer.