Foscam IP Camera User Manual

Foscam IPCamera CGI User Guide
1
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
2
Contents
getImageSetting...................................................................................................................... 2
setBrightness .......................................................................................................................... 2
setContrast .............................................................................................................................. 2
setHue ...................................................................................................................................... 3
setSaturation ........................................................................................................................... 3
setSharpness .......................................................................................................................... 3
resetImageSetting .................................................................................................................. 4
getMirrorAndFlipSetting ......................................................................................................... 4
mirrorVideo .............................................................................................................................. 4
flipVideo ................................................................................................................................... 5
setPwrFreq .............................................................................................................................. 5
getVideoStreamParam........................................................................................................... 5
setVideoStreamParam ........................................................................................................... 6
getMainVideoStreamType ..................................................................................................... 6
getSubVideoStreamType....................................................................................................... 6
setMainVideoStreamType ..................................................................................................... 7
setSubVideoStreamType ....................................................................................................... 7
GetMJStream .......................................................................................................................... 8
getOSDSetting ........................................................................................................................ 8
setOSDSetting ........................................................................................................................ 8
getOsdMaskArea .................................................................................................................... 9
setOsdMaskArea .................................................................................................................... 9
getMotionDetectConfig .......................................................................................................... 9
setMotionDetectConfig ........................................................................................................ 10
getSnapConfig ...................................................................................................................... 12
setSnapConfig ...................................................................................................................... 12
snapPicture ........................................................................................................................... 13
snapPicture2 ......................................................................................................................... 13
getRecordList ........................................................................................................................ 13
getAlarmRecordConfig ........................................................................................................ 14
setAlarmRecordConfig ........................................................................................................ 14
setIOAlarmConfig ................................................................................................................. 14
getIOAlarmConfig ................................................................................................................. 15
clearIOAlarmOutput ............................................................................................................. 15
getMultiDevList ..................................................................................................................... 16
getMultiDevDetailInfo ........................................................................................................... 16
addMultiDev .......................................................................................................................... 16
delMultiDev ............................................................................................................................ 17
addAccount ........................................................................................................................... 17
delAccount ............................................................................................................................. 18
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
3
changePassword .................................................................................................................. 18
changeUserName ................................................................................................................ 18
logIn ........................................................................................................................................ 19
logOut ..................................................................................................................................... 19
getSessionList ....................................................................................................................... 20
getUserList ............................................................................................................................ 20
usrBeatHeart ........................................................................................................................... 20
ptzMoveUp ............................................................................................................................ 21
ptzMoveDown ....................................................................................................................... 21
ptzMoveLeft ........................................................................................................................... 21
ptzMoveRight ........................................................................................................................ 22
ptzMoveTopLeft .................................................................................................................... 22
ptzMoveTopRight .................................................................................................................. 22
ptzMoveBottomLeft .............................................................................................................. 22
ptzMoveBottomRight ............................................................................................................ 23
ptzStopRun ............................................................................................................................ 23
ptzReset ................................................................................................................................. 23
getPTZSpeed ........................................................................................................................ 24
setPTZSpeed ........................................................................................................................ 24
getPTZPresetPointList ......................................................................................................... 24
ptzAddPresetPoint................................................................................................................ 25
ptzDeletePresetPoint ........................................................................................................... 25
ptzGotoPresetPoint .............................................................................................................. 25
ptzGetCruiseMapList ........................................................................................................... 26
ptzGetCruiseMapInfo ........................................................................................................... 26
ptzSetCruiseMap .................................................................................................................. 26
ptzDelCruiseMap .................................................................................................................. 27
ptzStartCruise........................................................................................................................ 27
ptzStopCruise ........................................................................................................................ 27
zoomIn ................................................................................................................................... 27
zoomOut ................................................................................................................................ 28
zoomStop ............................................................................................................................... 28
getZoomSpeed ..................................................................................................................... 28
setZoomSpeed ...................................................................................................................... 29
setPTZSelfTestMode ............................................................................................................ 29
getPTZSelfTestMode ........................................................................................................... 29
setPTZPrePointForSelfTest ................................................................................................ 30
getPTZPrePointForSelfTest ................................................................................................ 30
set485Info .............................................................................................................................. 30
get485Info .............................................................................................................................. 31
getIPInfo ................................................................................................................................. 31
setIpInfo ................................................................................................................................. 32
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
4
refreshWifiList ....................................................................................................................... 32
getWifiList .............................................................................................................................. 32
setWifiSetting ........................................................................................................................ 33
getWifiConfig ......................................................................................................................... 34
getPortInfo ............................................................................................................................. 35
setPortInfo ............................................................................................................................. 35
getUPnPConfig ..................................................................................................................... 36
setUPnPConfig ..................................................................................................................... 36
getDDNSConfig .................................................................................................................... 36
setDDNSConfig .................................................................................................................... 37
setFtpConfig .......................................................................................................................... 37
getFtpConfig .......................................................................................................................... 38
testFtpServer ......................................................................................................................... 38
getSMTPConfig .................................................................................................................... 38
setSMTPConfig ..................................................................................................................... 39
smtpTest ................................................................................................................................. 40
setSystemTime ..................................................................................................................... 40
getSystemTime ..................................................................................................................... 41
openInfraLed ......................................................................................................................... 42
closeInfraLed ......................................................................................................................... 42
getInfraLedConfig ................................................................................................................. 43
setInfraLedConfig ................................................................................................................. 43
getDevState ........................................................................................................................... 43
getDevName ......................................................................................................................... 44
setDevName ......................................................................................................................... 45
getDevInfo ............................................................................................................................. 45
rebootSystem ........................................................................................................................ 46
restoreToFactorySetting ...................................................................................................... 46
exportConfig .......................................................................................................................... 46
ImportConfig .......................................................................................................................... 47
FwUpgrade ............................................................................................................................ 47
getFirewallConfig .................................................................................................................. 48
setFirewallConfig .................................................................................................................. 48
getLog .................................................................................................................................... 48
Copyright@ Shenzhen Foscam Intelligent Technology Limited
5
History
Ver
Auth
Edit date
Changes
1.0.0
XiaoJinsheng
2012-11-21
V1.0.0
1.0.1
Houzhen
2012-12-09
Add the following CGI command to set PT startup position:
1) setPTZSelfTestMode
2) getPTZSelfTestMode
3) setPTZPrePointForSelfTest
4) getPTZPrePointForSelfTest
1.0.2
XiaoJinsheng
2013-01-29
1. Add a snap CGI(snapPicture2) which retrun jpeg image data directly but a image url
2. Add MotionJpeg stream support
1.0.3
Houzhen
2013-6-5
Check and Modify CGI command document
1.0.4
Limaike
2013-6-8
CGI command check
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
1
value
mean
0
Success
-1
CGI request string format error
-2
Username or password error
-3
Access deny
-4
CGI execute fail
-5
Timeout
-6
Reserve
-7
Unknown error
-8
Reserve
General description
Our device can only support authentication by pass user name or password attached
at CGI request string currentlly. For example: http://192.168.1.2/cgi-bin/CGIProxy.fcgi&usr=admin&pwd=123&cmd=ABC
We only support GET and POST method. Only importConfig and fwUpgrade can
support POST method.
The cgi request string must be encode in url format. URL encode rule:
The following chars will not be encoded: [A~Z] [a~z] [0~9] + @ * / The other chars will be encoded into hex format. For example:
http://192.168.1.6:88/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=getIPInfo
will be encode to:
http://192.168.1.6:88/cgi-bin/CGIProxy.fcgi?usr%3Dadmin%26pwd%3D%26cmd%3DgetIPInfo
cgi execute result
1) We orgnize the cgi execute result as xml format, for example: <CGI_Result> <result>0</result> <isDHCP>1</isDHCP> <ip>192.168.1.8</ip> <gate>0.0.0.0</gate> <mask>255.255.255.0</mask> <dns1>0.0.0.0</dns1> <dns2>0.0.0.0</dns2> </CGI_Result>
<result></result> means the common execute result
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
2
Function
Get color attribute of video
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting
Param
None
Return
brightness
0~100
contrast
0~100
hue
0~100
saturation
0~100
sharpness
0~100
denoiseLevel
Not use
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting&usr=admin&pwd=
Function
Set brightness of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness
Param
brightness
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness&brightness=50&usr=admin& pwd=
Function
Set contrast of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setContrast
Param
contrast
0~100
Return
None
Note
AV Function
getImageSetting
setBrightness
setContrast
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
3
Example
/cgi-bin/CGIProxy.fcgi?cmd=setContrast&contrast=50&usr=admin&pwd =
Function
Set hue of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setHue
Param
hue
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setHue&hue=50&usr=admin&pwd=
Function
Set saturation of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation
Param
saturation
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation&saturation=50&usr=admin& pwd=
Function
Set sharpness of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
Param
sharpness
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness&sharpness=50&usr=admin& pwd=
setHue
setSaturation
setSharpness
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
4
Function
Reset color parameters to default value
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting&usr=admin&pwd=
Function
Get mirror and flip attribute of video
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting
Param
None
Return
isMirror
0 Not mirred
1 Mirred
isFlip 0 Not filpped
1 Flipped
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting&usr=admin&pwd=
Function
Mirror video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo
Param
isMirror 0 Not mirror
1 Mirror
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&usr=admin&pwd=
resetImageSetting
getMirrorAndFlipSetting
mirrorVideo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
5
Function
Flip video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo
Param
isFlip 0 Not flip
1 Flip
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo&usr=admin&pwd=
Function
Set power freq of sensor
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq
Param
freq 0 60HZ
1 50HZ
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=admin&pwd=
Function
Get video stream param
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam
Param
None
Return
resolutionN
Resolution of stream type N
bitRateN
Bit rate of stream type N (20480~2097152)
frameRateN
Frame rate of stream type N
GOPN
P frames between I frame of stream type N
isVBRN
Not in use currentlly
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam&usr=admin&pwd=
flipVideo
setPwrFreq
getVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
6
Function
Set the video stream param of stream N
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam
Param
streamTyp e
0~3
resolutio n
Resolution of stream type N
bitRate
Bit rate of stream type N (20480~2097152)
frameRat e
Frame rate of stream type N
GOP
P frames between I frame of stream type N The suggest value is: X * frameRate
isVBR
Not in use currentlly
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam&streamType=0&res olution=0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=a dmin&pwd=
Function
Get the stream type of main stream
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType
Param
None
Return
streamType
The stream type 0~3
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType&usr=admin&pw d=
Function
Get the stream type of sub stream
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType
setVideoStreamParam
getMainVideoStreamType
getSubVideoStreamType
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
7
Param
None
Return
streamType
The stream type 0~3
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=admin&pwd =
Functio n
Set the stream type of main stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType
Param
streamType
The stream type 0~3
Return
None
Note
Exampl e
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType&streamType=0&usr=admi n&pwd=
Function
Set the stream format of sub stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStream 统一
Param
format
0
H264
1
MotionJpeg
Return
None
Note
Our device can only support 2 streams:Main stream for PC access and Sub stream for mobile access, but someone need a MJ stream to embed their camera into a webpage, in this case, we should set sub stream format to Motion Jpeg, and then you can get MJ stream by command: /cgi-bin/CGIStream.cgi?cmd=GetMJStream, but when you login as a sub stream user, the stream data will be same as main stream.
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamType&format=0&usr=admin&pw d=
setMainVideoStreamType
setSubVideoStreamType
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
8
Function
Get motion jpeg stream
privilege
visitor
Usage
/cgi-bin/CGIStream.cgi?cmd=GetMJStream
Param
None
Return
Motion jpeg stream data
Note
1) Motion jpeg stream data is returned from http server by a serverpush mode
2) MJ stream is VGA resolution @ 15fps
Example
/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=
Function
Get OSD config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting
Param
None
Return
isEnableTimeStamp
Time stamp will display on screen or not
isEnableDevName
Camera name will display on screen or not
dispPos
OSD display position, currently can only be 0
isEnableOSDMask
Is OSD mask effective
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting&usr=admin&pwd=
Function
Set OSD config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting
Param
isEnableTimeStamp
Time stamp will display on screen or not
isEnableDevName
Camera name will display on screen or not
dispPos
OSD display position, currently can only be 0
isEnableOSDMask
Is OSD mask effective
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting&isEnableTimeStamp=1&isEnable DevName=1&dispPos=0&isEnableOSDMask=0&usr=admin&pwd=
GetMJStream
getOSDSetting
setOSDSetting
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
9
Function
Get OSD mask area info
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea
Param
None
Return
x1_N
The top left X position of mask N
y1_N
The top left Y position of mask N
x2_N
The bottom right X position of mask N
y2_N
The bottom right Y position of mask N
Note
Our device can only support 4 mask areas
Example
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea&usr=admin&pwd=
Function
Set OSD mask area info
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea
param
x1_N
The top left X position of mask N
y1_N
The top left Y position of mask N
x2_N
The bottom right X position of mask N
y2_N
The bottom right Y position of mask N
Resturn
None
Note
Our device can only support 4 mask areas
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea&x1_0=100&y1_0=100&x2_0=2 00&y2_0=200&x1_1=0&y1_1=0&x2_1=0&y2_1=0&x1_2=0&y1_2=0&x2_2=0 &y2_2=0&x1_3=0&y1_3=0&x2_3=0&y2_3=0&usr=admin&pwd=
Function
Get motion detect config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig
Param
None
Return
isEnable
Is enable motion detect alarm
linkage
Motion alarm linkage ( bit3 | bit2 | bit1 | bit0 )
bit0:Ring
bit1:Send mail
getOsdMaskArea
setOsdMaskArea
getMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
10
bit2:Snap picture
bit3:Record
snapInterval
The interval time to snap picture again
sensitivity
Motion detect sensitivity
0 : Low
1: Normal
2: High
3: Lower
4: Lowest
triggerInterval
The time of which motion detect alaram can trigger again when a motion detection has happened.
scheduleN
The motion alaram schedule of one week, N = 0(Monday) ~6(Sunday) For detail, see *1 bellow
areaN
The area info of row N For detail, see *2 bellow
Note
·Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
·The min unit of schedule is half an hour
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=
Function
Set motion detect config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig
Param
isEnable
Is enable motion detect alarm
linkage
Motion alarm linkage ( bit3 | bit2 | bit1 | bit0 )
bit0:Ring
bit1:Send mail
bit2:Snap picture
bit3:Record
snapInterval
The interval time to snap picture again
sensitivity
Motion detect sensitivity
0 : Low
1: Normal
2: High
3: Lower
4: Lowest
triggerInterval
The time of which motion detect alaram
setMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
11
can trigger again when a motion detection has happened.
scheduleN
The motion alaram schedule of one week, N = 0(Monday) ~6(Sunday) For detail, see *1 bellow
areaN
The area info of row N For detail, see *2 bellow
Return
None
Note
·Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
·The min unit of schedule is half an hour
Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=16&
snapInterval=2&sensitivity=1&triggerInterval=5&schedule0=1024&schedule1
=1024&schedule2=1024&schedule3=1024&schedule4=1024&schedule5=102 4&schedule6=1024&area0=1024&area1=1024&area2=1024&area3=1024&ar ea4=1024&area5=1024&area6=1024&area7=1024&area7=1024&area8=1024 &area9=1024&usr=admin&pwd=
0 1 2 3 4 5 6 7
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
bit8
bit9
40
41
42
43
44
45
46
47
Monday
Tuesday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Wednesday
area0
area1
area2
area3
area4
area5
area6
area7
*1 schedule bitmap
Each grid of a row presents half of an hour of one day. For example, 40 presents 20:00 ~20:30. The bit 40 set to “1” means the motion detection is effective between 20:00 to 20:30
*2 area bitmap
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
12
Function
Get snap config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSnapSetting
Param
None
Return
snapPicQuality
0
Low quality
1
Normal quality
2
High quality
saveLocation
0
Save to sd card
1
Not in use now
2
Upload to FTP
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSnapConfig&usr=admin&pwd=
Function
Set snap config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSnapSetting
Param
snapPicQuality
0
Low quality
1
Normal quality
2
High quality
saveLocation
0
Save to sd card
1
Not in use now
2
Upload to FTP
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSnapConfig&usr=admin&pwd=&snapPicQuali
ty=1&saveLocation=2
area8
area9
The video region is divided into 10*10 sub areas, bit0 above present the first area, when this bit is set to “1”, it means motion detection is effective on this area.
getSnapConfig
setSnapConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
13
Function
Manual snap picture
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=snapPicture
Param
None
Return
We will return a html script directly: <html><body><img src="../snapPic/20121121-215939.jpg"/></body></html>
Note
Picture resolution is the same as main stream resolutionnapPicture
Example
/cgi-bin/CGIProxy.fcgi?cmd=snapPicture&usr=admin&pwd=
Function
Manual snap picture
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2
Param
None
Return
Jpeg image data
Note
This command will return jpeg image data directly
Example
/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=admin&pwd=
Function
Get snap config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getRecordList
Param
recordPath
Record path
startTime
Start time for research
endTime
End time for research
recordType
Recort type
startNo
Start no
Return
totalCnt
Total record count
curCnt
Current record count
recordN
N(0-9), Record information
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getRecordList&usr=admin&pwd=
snapPicture
snapPicture2
getRecordList
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
14
Function
Get alarm record config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getAlarmRecordConfig
Param
None
Return
isEnablePreRec
ord
Preview record state
preRecordSecs
Preview record time
alarmRecordSec
s
Alarm record time
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getAlarmRecordConfig&usr=admin&pwd=
Function
Set alarm record config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setAlarmRecordConfig
Param
isEnablePreRec
ord
Preview record state
preRecordSecs
Preview record time
alarmRecordSec
s
Alarm record time
Return
Set result(0-success,-1-error)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setAlarmRecordConfig&usr=admin&pwd=&isEnab
lePreRecord=1&preRecordSecs=5&alarmRecordSecs=30
Function
Set IO alarm config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setIOAlarmConfig
Param
isEnable
Preview record state
linkage
IO alarm linkage
bit0:Ring
bit1:Send mail
bit2:Snap picture
getAlarmRecordConfig
setAlarmRecordConfig
setIOAlarmConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
15
bit3:Record
alarmLevel
Alarm level
snapInterval
Interval for snap picture
triggerInterva l
Interval for trigger alarm again
scheduleN
N(0-6), alarm schedule
Return
Set result(0-success,-1-error)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setIOAlarmConfig&usr=admin&pwd=&isEnable=1 &linkage=16&snapInterval=2&alarmLevel=1&triggerInterval=5&schedule0=10 24&schedule1=1024&schedule2=1024&schedule3=1024&schedule4=1024&s chedule5=1024&schedule6=1024
Function
Get IO alarm config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getIOAlarmConfig
Param
None
Return
isEnable
Preview record state
linkage
IO alarm linkage
bit0:Ring
bit1:Send mail
bit2:Snap picture
bit3:Record
alarmLevel
Alarm level
snapInterval
Interval for snap picture
triggerInterva l
Interval for trigger alarm again
scheduleN
N(0-6), alarm schedule
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getIOAlarmConfig&usr=admin&pwd=
Function
Clean IO alarm output
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=clearIOAlarmOutput
Param
None
getIOAlarmConfig
clearIOAlarmOutput
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
16
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=clearIOAlarmOutput&usr=admin&pwd=
Function
Get multi device list
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMultiDevList
Param
None
Return
devN
N(0-8), device information
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMultiDevList&usr=admin&pwd=
Function
Get multi device information
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMultiDevDetailInfo
Param
chnnl
Channel no
Return
productType
Device type
ip
Device IP
port
Web port
mediaPort
Media port
userName
User name
passWord
Password
devName
Device name
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMultiDevDetailInfo&usr=admin&pwd=
Function
Add multiy device
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=addMultiDev
Param
chnnl
Channel no
productType
Device type
getMultiDevList
getMultiDevDetailInfo
addMultiDev
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
17
ip
Device Ip
port
Web port
mediaPort
Media port
userName
User name
passWord
Password
devName
Device name
Return
Add result(0-success,-1-error)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=addMultiDev&usr=admin&pwd=&chnnl=2&product
Type=H264&ip=192.168.1.3&port=88&mediaPort=88&userName=admin&pass Word=&devName=FI9805W
Function
Delete multiy device
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=delMultiDev
Param
chnnl
Channel no
Return
Delete result(0-success,-1-error)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=delMultiDev&usr=admin&pwd=&chnnl=2
Function
Add user account
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=addAccount
Param
usrName
user name
usrPwd
user password
privilege
0
Visitor
1
Operator
2
Administrator
Return
None
delMultiDev
User account
addAccount
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
18
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=addAccount&usrName=test&usrPwd=test&privile ge=0& usr=admin&pwd=
Function
Delete user account
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=delAccount
Param
usrName
user name
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=delAccount&usrName=test&usr=admin&pwd=
Function
Change password
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=changePassword
Param
usrName
The user you want to change password
oldPwd
old password
newPwd
new password
Return
None
Note
Admin can change every user’s password, visitor and operator can only
change their own password
Example
/cgi-bin/CGIProxy.fcgi?cmd=changePassword&usrName=admin&oldPwd=&ne wPwd=test&usr=admin&pwd=
Function
Change user name
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=changeUserName
Param
usrName
The user you want to change name
newUsrName
The new user name
delAccount
changePassword
changeUserName
Copyright@ Shenzhen Foscam Intelligent Technology Limited
19
Return
None
Note
Admin can change every user’s name, visitor and operator can only change their own name
Example
/cgi-bin/CGIProxy.fcgi?cmd=changeUserName&usrName=admin& newUsrName=newname&usr=admin&pwd=
logIn
Function
User log in to camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd= logIn
Param
usrName
User name
ip
Access IP
groupId
An id use to distinguish different users,can be set to current cpu tick
Return
logInResult
0
Login success
-1
Parameter check error
-2
Exceed max user
-4
User not exist
-6
Password error
-7
Access deny
privilege
0
Visitor
1
Operator
2
Administrator
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=logIn&usrName=admin&ip=192.168.1.12&p wd=&groupId=673982479 &usr=admin&pwd=
Function
User log out to camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=logOut
Param
usrName
User name
ip
Access IP
groupId
An id use to distinguish different users,can be set to
Foscam IPCamera CGI User Guide
logOut
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
20
current cpu tick
Return
logOutResult
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=logOut&usrName=admin&ip=192.168.1.12&grou pId=673982479&usr=admin&pwd=
Function
Get current session list of the camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSessionList
Param
None
Return
usrCnt
session count
usrN
User name of session N
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSessionList&usr=admin&pwd=
Function
Get user account list of the camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getUserList
Param
None
Return
usrCnt
User count
usrN
User name of accnount N
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getUserList&usr=admin&pwd=
Function
user checks connection with camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=usrBeatHeart
Param usrName
User name
remoteIp
Access IP
getSessionList
getUserList
usrBeatHeart
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
21
groupId
An id use to distinguish different users,can be set to current cpu tick
Return
checkResult(0-success,-1-error)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=usrBeatHeart&usrName=admin&ip=192.168.1.13 &groupId=673982479&usr=admin&pwd=
Function
Move up
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=admin&pwd=
Function
Move down
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&usr=admin&pwd=
Function
Move to left
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveLeft
Param
None
PTZ Control
ptzMoveUp
ptzMoveDown
ptzMoveLeft
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
22
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveLeft&usr=admin&pwd=
Function
Move to right
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveRight
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveRight&usr=admin&pwd=
Function
Move to top left
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveTopLeft
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveTopLeft&usr=admin&pwd=
Function
Move to top right
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveTopRight
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveTopRight&usr=admin&pwd=
Function
Move to bottom left
ptzMoveRight
ptzMoveTopLeft
ptzMoveTopRight
ptzMoveBottomLeft
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
23
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveBottomLeft
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveBottomLeft&usr=admin&pwd=
Function
Move to bottom right
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveBottomRight
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveBottomRight&usr=admin&pwd=
Function
Stop run PT
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzStopRun
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzStopRun&usr=admin&pwd=
Function
Reset PT to default position
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzReset
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzReset&usr=admin&pwd=
ptzMoveBottomRight
ptzStopRun
ptzReset
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
24
Function
Get the speed of PT
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getPTZSpeed
Param
None
Return
speed
0
Very slow
1
Slow
2
Normal speed
3
Fast
4
Very fast
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getPTZSpeed&usr=admin&pwd=
Function
Set the speed of PT
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setPTZSpeed
Param
speed
0
Very slow
1
Slow
2
Normal speed
3
Fast
4
Very fast
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setPTZSpeed&usr=admin&pwd=
Function
Get all preset point
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getPTZPresetPointList
Param
None
Return
cnt
Current preset point count
pointN
The name of point N
getPTZSpeed
setPTZSpeed
getPTZPresetPointList
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
25
Note
Our device can support at most 16 preset point We have 4 point default:LeftMost\RightMost\TopMost\BottomMost
Example
/cgi-bin/CGIProxy.fcgi?cmd=getPTZPresetPointList&usr=admin&pwd=
Function
Add preset point
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzAddPresetPoint
Param
name
Preset point name
Return
None
Note
The preset point position is current PT position
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzAddPresetPoint&name=test&usr=admin&pwd =
Function
Delete preset point by name
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzDeletePresetPoint
Param
name
Preset point name
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzDeletePresetPoint&name=test&usr=admin&p wd=
Function
Goto preset position
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint
Param
name
Preset point name
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=test&usr=admin&pwd =
ptzAddPresetPoint
ptzDeletePresetPoint
ptzGotoPresetPoint
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
26
Function
Get all cruise map list
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzGetCruiseMapList
Param
None
Return
cnt
Current cruise map point count
mapN
The name of map N
Note
Our device can support at most 8 cruise map We have 2 maps default:Horizental/Vertical
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzGetCruiseMapList&usr=admin&pwd=
Function
Get the detail info of a cruise map by name
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzGetCruiseMapInfo
Param
name
Name of the cruise map
Return
getResult 0
Success
-1
Fail
pointN
The preset point name of this cruise map
Note
Our device can support at most 8 preset point one cruise map
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzGetCruiseMapInfo&name=Horizental&usr=ad min&pwd=
Function
Add a cruise map
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzSetCruiseMap
Param
name
Name of the cruise map
pointN
The name of preset point N
Return
None
Note
Our device can support at most 8 preset point one cruise map
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzSetCruiseMap&name=test&point0=test0&point 1=test1&point2=test2&point3=test3&point4=test4&point5=test5&point6=&poin
ptzGetCruiseMapList
ptzGetCruiseMapInfo
ptzSetCruiseMap
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
27
t7=&usr=admin&pwd=
Function
Delete a cruise map
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzDelCruiseMap
Param
name
Name of the cruise map
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzDelCruiseMap&name=test&usr=admin&pwd=
Function
Start a specificate cruise
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzStartCruise
Param
mapName
Name of the cruise map
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzStartCruise&mapName=test&usr=admin&pwd=
Function
Start current cruise
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=ptzStopCruise
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=ptzStopCruise&usr=admin&pwd=
Function
Zoom in
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=zoomIn
ptzDelCruiseMap
ptzStartCruise
ptzStopCruise
zoomIn
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
28
Param
None
Return
None
Note
Only supported by the device has zoom lens
Example
/cgi-bin/CGIProxy.fcgi?cmd=zoomIn&usr=admin&pwd=
Function
Zoom out
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=zoomOut
Param
None
Return
None
Note
Only supported by the device has zoom lens
Example
/cgi-bin/CGIProxy.fcgi?cmd=zoomOut&usr=admin&pwd=
Function
Stop zoom run
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=zoomStop
Param
None
Return
None
Note
Only supported by the device has zoom lens
Example
/cgi-bin/CGIProxy.fcgi?cmd=zoomStop&usr=admin&pwd=
Function
Get the speed of Zoom
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getZoomSpeed
Param
None
Return
speed
0
Slow
1
Normal
2
Fast
Note
Only supported by the device has zoom lens
Example
/cgi-bin/CGIProxy.fcgi?cmd=getZoomSpeed&usr=admin&pwd=
zoomOut
zoomStop
getZoomSpeed
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
29
Function
Set the speed of PTZ
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setZoomSpeed
Param
speed
0
Slow
1
Normal
2
Fast
Return
None
Note
Only supported by the device has zoom lens
Example
/cgi-bin/CGIProxy.fcgi?cmd=setZoomSpeed&usr=admin&pwd=&speed=1
Function
Set the selftest mode of PTZ
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd= setPTZSelfTestMode
Param
mode
0
No selftest
1
Normal selftest
2
After normal selftest, then goto presetpoint-appointed
Return
None
Note
Only supported by ipc that can enable ptz-selftest
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=setPTZSelfTestMode&mod e=2
Function
Get the selftest mode of PTZ
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd= getPTZSelfTestMode
Param
None
Return
mode
0
No selftest
1
Normal selftest
2
After normal selftest, then goto presetpoint-appointed
Return
None
setZoomSpeed
setPTZSelfTestMode
getPTZSelfTestMode
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
30
Note
Only supported by ipc that can enable ptz-selftest
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=getPTZSelfTestMode
Function
Set presetpoint for selftest of PTZ
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd= setPTZPrePointForSelfTest
Param
name
Preset point name
Return
None
Note
Only supported by ipc that can enable ptz-selftest-2
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=setPTZPrePointForSelfTes t&name=TopMost
Function
Get the presetpoint for selftest of PTZ
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd= getPTZPrePointForSelfTest
Param
None
Return
name
Preset point name
Note
Only supported by ipc that can enable ptz-selftest
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=getPTZPrePointForSelfTes t
Function
Set informations of 485
privilege
operator
Usage
/cgi-bin/CGIProxy.fcgi?cmd=set485Info
Param
rs485Protocol
Protocol
rs485Addr
Address
rs485Baud
Baud rate
rs485DataBit
DataBit
rs485StopBit
StopBit
rs485Check
Parity
Return
None
setPTZPrePointForSelfTest
getPTZPrePointForSelfTest
set485Info
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
31
Note
Only supported by ipc that can enable 485
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=set485Info&rs485Protocol =0&rs485Addr=1&rs485Baud=1200&rs485DataBit=7&rs485StopBit=1&rs4 85Check=0
Function
Get informations of 485
privilege
Visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=get485Info
Param
None
Return
rs485Protocol
Protocol
rs485Addr
Address
rs485Baud
Baud rate
rs485DataBit
DataBit
rs485StopBit
StopBit
rs485Check
Parity
Note
Only supported by ipc that can enable 485
Example
/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=get485Info
Function
Get IP Info
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getIPInfo
Param
None
Return
isDHCP
Obtain ip from dhcp server or not
ip
ip address(Can only support ipv4 yet)
gate
gateway(“0.0.0.0” when use dhcp)
mask
subnet mask
dns1
The first dns server addr(“0.0.0.0” when use dhcp)
dns2
The second dns server addr(“0.0.0.0” when use dhcp)
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getIPInfo&usr=admin&pwd=
get485Info
Network getIPInfo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
32
setIpInfo
Function
Set IP Info
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setIpInfo
Param
isDHCP
Obtain ip from dhcp server or not
ip
ip address(Can only support ipv4 yet)
gate
gateway
mask
subnet mask
dns1
The first dns server addr
dns2
The second dns server addr
Return
None
Note
System will reboot automatically to take effect after call this CGI command
Example
/cgi-bin/CGIProxy.fcgi?cmd=setIpInfo&isDHCP=0&ip=192.168.1.88&gate=192 .168.1.1&mask=255.255.255.0&dns1=192.168.1.1&dns2=192.168.1.1&usr=a dmin&pwd=
Function
Start scan the aps around
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=refreshWifiList
Param
None
Return
None
Note
This operation may takes a while, about 20 seconds or above, the other operation on this device will be blocked during the period.
Example
/cgi-bin/CGIProxy.fcgi?cmd=refreshWifiList&usr=admin&pwd=
Function
Get the aps around after refreshWifiList
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getWifiList
Param
startNo
The start NO of the ap list you want to get. For example:The are 30 aps around you, you want to look at the last ten aps, then startNo=20
Return
totalCnt
Total count of aps
Foscam IPCamera CGI User Guide
refreshWifiList
getWifiList
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
33
curCnt
Current aps count
apN
The detail info of ap N Format: ssid+mac+quality+isEncryp t+encrypType
ssid
AP name
mac
AP’s mac address
quality
Signal quality(0~100)
isEncrypt
Encrypt or not
encrypType
0
Open mode
1
WEP
2
WPA
3
WPA2
4
WPA/WPA2
Note
Only 10 aps will be returned one time
Example
/cgi-bin/CGIProxy.fcgi?cmd=getWifiList&startNo=0&usr=admin&pwd=
Function
Set wifi config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setWifiSetting
Param
isEnable
Enable state
isUseWifi
Use wifi or not
ssid
AP name
netType 0
Infra net
1
Ad-hoc Not supported yet
encryptTyp e
0
Open mode
1
WEP
2
WPA
3
WPA2
4
WPA/WPA2
psk
The psk of WPA WPA2
authMode
0
Open mode
1
Shared key
2
Auto mode
keyFormat 0
ASIC
1
Hex
defaultKey
1~4
key1
key2
setWifiSetting
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
34
key3
key4
key1Len
64 or 128
key2Len
64 or 128
key3Len
64 or 128
key4Len
64 or 128
Return
None
Note
Camera will not connect to AP unless you enject your cable
Example
/cgi-bin/CGIProxy.fcgi?cmd=setWifiSetting&isEnable=1&isUseWifi=1&ssid=fosta r_soft&netType=0&encryptType=4&psk=software&authMode=0&keyFormat=0&d efaultKey=1&key1=&key2=&key3=&key4=&key1Len=64&key2Len=64&key3Len =64&key4Len=64&usr=admin&pwd=
Function
Get wifi config
privilege
Visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getWifiConfig
Param
None
Return
isEnable
Enable state
isUseWifi
Use wifi or not
isConnecte d
Connected state
connected Ap
Connedted ap ssid
AP name
encryptTyp e
0
Open mode
1
WEP
2
WPA
3
WPA2
4
WPA/WPA2
psk
The psk of WPA WPA2
authMode
0
Open mode
1
Shared key
2
Auto mode
keyFormat 0
ASIC
1
Hex
getWifiConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
35
defaultKey
1~4
key1
key2
key3
key4
key1Len
64 or 128
key2Len
64 or 128
key3Len
64 or 128
key4Len
64 or 128
Return
None
Note
Camera will not connect to AP unless you enject your cable
Example
/cgi-bin/CGIProxy.fcgi?cmd=getWifiConfig&usr=admin&pwd=
Function
Get http port and media port of camera
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getPortInfo
Param
None
Return
webPort
http port(default value is 88)
httpsPort
https port(default value is 443)
mediaPort
media port(default value is 88)
Note
You can call this CGI command without usr or pwd section
Example
/cgi-bin/CGIProxy.fcgi?cmd=getPortInfo&usr=admin&pwd=
Function
Set http port and media port of camera
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getPortInfo
Param
webPort
http port(default value is 88)
mediaPort
media port(default value is 88)
httpsPort
https port(default value is 443)
Return
None
Note
Re login is needed after call this CGI command
Example
/cgi-bin/CGIProxy.fcgi?cmd=setPortInfo&webPort=88&mediaPort=88&httpsPo rt=443&usr=admin&pwd=
getPortInfo
setPortInfo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
36
Function
Get UpnP config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getUPnPConfig
Param
None
Return
isEnable
is Enable UpnP function
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getUPnPConfig&usr=admin&pwd=
Function
Set UpnP config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setUPnPConfig
Param
isEnable
is Enable UpnP function
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setUPnPConfig&isEnable=1&usr=admin&pwd=
Function
Get DDNS config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getDDNSConfig
Param
None
Return
isEnable
is Enable DDNS update
hostName
DDNS domain
ddnsServer
0
Factory DDNS
1
Oray
2
3322
3
no-ip
4
dyndns
user
user name
password
password
factoryDDNS
factory ddns
Note
getUPnPConfig
setUPnPConfig
getDDNSConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
37
Example
/cgi-bin/CGIProxy.fcgi?cmd=getDDNSConfig&usr=admin&pwd=
Function
Set DDNS config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setDDNSConfig
Param
isEnable
is Enable DDNS update
hostName
DDNS domain
ddnsServer
0
Factory DDNS
1
Oray
2
3322
3
no-ip
4
dyndns
user
user name
password
password
Return
None
Note
This command can only be used to set the third party ddns
Example
/cgi-bin/CGIProxy.fcgi?cmd=setDDNSConfig&isEnable=1&hostName=test.dyn dns.org&ddnsServer=4&user=test&password=test&usr=admin&pwd=
Function
Set FTP config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setFtpConfig
Param
ftpAddr
FTP server address, you can contain sub directory in it
ftpPort
FTP port
mode 0
PASV mode
1
PORT mode
userName
user name
password
password
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setFtpConfig&ftpAddr=ftp://192.168.1.2/sbuDir&ft pPort=21&mode=0&userName=test&password=test&usr=admin&pwd=
setDDNSConfig
setFtpConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
38
Function
Get FTP config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getFtpConfig
Param
None
Param
ftpAddr
FTP server address, you can contain sub directory in it
ftpPort
FTP port
mode 0
PASV mode
1
PORT mode
userName
user name
password
password
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getFtpConfig&usr=admin&pwd=
Function
Test FTP server
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=testFtpServer
Param
ftpAddr
FTP server address, you can contain sub directory in it
ftpPort
FTP port
mode 0
PASV mode
1
PORT mode
userName
user name
password
password
Return
testResult 0
Success
-1
Fail
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=testFtpServer&ftpAddr=ftp://192.168.1.2/sbuDir&ft pPort=21&mode=0&userName=test&password=test&usr=admin&pwd=
Function
Get mail config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSMTPConfig
getFtpConfig
testFtpServer
getSMTPConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
39
Param
None
Return
isEnable
is enable camera send mail?
server
SMTP server address
port
smtp port
isNeedAuth
Need auth user account or not
tls
0
None
1
TLS
2
STARTTLS
user
user name
password
password
sender
reciever
Use “,” between 2 senders, for exapler: aaa@123.com,bbb@456.com
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSMTPConfig&usr=admin&pwd=
Function
Get mail config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSMTPConfig
Param
isEnable
is enable camera send mail?
server
SMTP server address
port
smtp port
isNeedAuth
Need auth user account or not
tls
0
None
1
TLS
2
STARTTLS
user
user name
password
password
sender
reciever
Use “,” between 2 senders, for exapler: aaa@123.com,bbb@456.com
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSMTPConfig&isEnable=1&server=smtp.gmail. com&port=587&isNeedAuth=1&user=test&password=test&send=test@gmail.c
setSMTPConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
40
om&reciever=aa@123.com,bb@456.com&usr=admin&pwd=
Function
Test mail setting
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=smtpTest
smtpServer
SMTP server address
port
smtp port
isNeedAuth
Need auth user account or not
tls
0
None
1
TLS
2
STARTTLS
user
user name
password
password
Return
testResult 0
Success
-1
Fail
Note
You must call setSMTPConfig firstly. We will send a test mail to all recievers
Example
/cgi-bin/CGIProxy.fcgi?cmd=smtpTest&smtpServer=smtp.gmail.com&port=587 &isNeedAuth=1&user=test&password=test&usr=admin&pwd=
Function
Set system time
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSystemTime
Param
timeSource 0
Get time from NTP server
1
Set time manually
ntpServer
ntp server addr Support ntp server: time.nist.gov time.kriss.re.kr time.windows.com time.nuri.net
smtpTest
Device manage
setSystemTime
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
41
dateFormat
0
YYYY-MM-DD
1
DD/MM/YYYY
2
MM/DD/YYYY
timeFormat 0
12 hours
1
24 hours
timeZone
The seconds between local time and GMT time. For example: timeZone=3600 presents GMT-01:00
timeZone=-3600 presents GMT+01:00
isDst
Daylight saving time (0-disable,1-enable)
dst
Not in use currently
year
month
day hour
min sec
Return
None
Note
This command can only be used to set the third party ddns
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSystemTime&timeSource=1&ntpServer=&date Format=0&timeFormat=0&timeZone=0&isDst=0&dst=0&year=2012&mon=1& day=6&hour=9&minute=35&sec=0&usr=admin&pwd=
Function
Get system time
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSystemTime
Param
None
Return
timeSource 0
Get time from NTP server
1
Set time manually
ntpServer
ntp server addr Support ntp server: time.nist.gov time.kriss.re.kr time.windows.com time.nuri.net
dateFormat
0
YYYY-MM-DD
1
DD/MM/YYYY
2
MM/DD/YYYY
getSystemTime
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
42
timeFormat 0
12 hours
1
24 hours
timeZone
The seconds between local time and GMT time. For example: timeZone=3600 presents GMT-01:00
timeZone=-3600 presents GMT+01:00
isDst
Daylight saving time (0-disable,1-enable)
dst
Not in use currently
year
month
day hour
min sec
Note
This command can only be used to set the third party ddns
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSystemTime&usr=admin&pwd=
Function
Force open infra led
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=openInfraLed
Param
None
Return
ctrlResult 0
Success
-1
Fail
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=openInfraLed&usr=admin&pwd=
Function
Force close infra led
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=closeInfraLed
Param
None
Return
ctrlResult 0
Success
-1
Fail
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=closeInfraLed&usr=admin&pwd=
openInfraLed
closeInfraLed
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
43
Function
Get infra led config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getInfraLedConfig
Param
None
Return
mode 0
Auto mode
1
Manual mode
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getInfraLedConfig&usr=admin&pwd=
Function
Set infra led config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setInfraLedConfig&mode=0
Param
mode 0
Auto mode
1
Manual mode
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setInfraLedConfig&usr=admin&pwd=
Function
Get all device state
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getDevState
Param
None
Return
IOAlarm
0
Disabled
1
No alaram
2
Detect alarm
motionDetectAlar am
0
Disabled
1
No alarm
2
Detect alarm
soundAlarm
0
Disabled
getInfraLedConfig
setInfraLedConfig
getDevState
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
44
1
No alarm
2
Detect alarm
record 0
Not in recording
1
Recording
sdState
0
No sd card
1
Sd card ok
2
Sd card read only
sdFreeSpace
Free space of sd card by unit of k
sdTotalSpace
Total space of sd card by unit of k
ntpState
0
Disabled
1
Update success
2
Update fail
ddnspState
0
Disabled
1
Update success
2
Update fail
url
DDNS url
upnpState
0
Disabled
1
Update success
2
Update fail
isWifiConnected 0
No wifi connected
1
Connected
wifiConnectedAP
The ssid of the ap which has been connected
infraLedState 0
OFF
1
ON
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
Function
Get camera name
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getDevName
Param
None
Return
devName
Camera name
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getDevName&usr=admin&pwd=
getDevName
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
45
Function
Set camera name
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setDevName
Param
devName
Camera name
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setDevName&devName=test&usr=admin&pwd=
Function
Get camera information
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getDevInfo
Param
None
Return
productNam e
Camera model serialNo
Serial no
devName
Camera name
mac
Mac address
year
mon
day hour
min sec timeZone
Time zone
firmwareVer
Firmware version
hardwareVer
Hardware version
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getDevInfo&usr=admin&pwd=
setDevName
getDevInfo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
46
Function
Reboot camera
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=rebootSystem
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=rebootSystem&usr=admin&pwd=
Function
Restore to factory setting
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=restoreToFactorySetting
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd= restoreToFactorySetting&usr=admin&pwd=
Function
Export config file
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=exportConfig
Param
None
Return
fileName
The config name
Note
After call this command, you can get the config file by visit the following addr: /configs/export/configs.bin
Example
/cgi-bin/CGIProxy.fcgi?cmd=exportConfig&usr=admin&pwd=
System
rebootSystem
restoreToFactorySetting
exportConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
47
Function
Import config file
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=importConfig&usr=admin&pwd=
Param
None
Return
None
Note
System will reboot automatically after this operation
Example
<form name="form5" method="post" target="retframe" enctype="multipart/form-data" action="cgi-bin/ CGIProxy.fcgi?cmd=importConfig&usr=admin&pwd=" > <input type="file" name="setting_file" > <input type="submit" value="import" > </form>
Function
Upgrade firmware
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=fwUpgrade&usr=admin&pwd=
Param
None
Return
upgradeResu lt
0
Upgrade success
-1
Upgrade fail
Note
System will reboot automatically after this operation. This action may takes about 120s when upgrade app firmware, takes about 60s when upgrade system firmware
Example
<form name="form5" method="post" target="retframe" enctype="multipart/form-data" action="cgi-bin/ CGIProxy.fcgi?cmd=fwUpgrade&usr=admin&pwd=" > <input type="file" name="fw_file" > <input type="submit" value="upgrade" > </form>
ImportConfig
FwUpgrade
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
48
Function
Get firewall config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getFirewallConfig
Param
None
Return
isEnable
Use firewall or not
rule 0
The ip list can’t access
1
Only allow the ip list to access
ipListN
The ip address(Network address) of list N
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getFirewallConfig&usr=admin&pwd=
Function
Set firewall config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setFirewallConfig
Param
isEnable
Use firewall or not
rule 0
The ip list can’t access
1
Only allow the ip list to access
ipListN
The ip address(Network address) of list N
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setFirewallConfig&isEnable=1&rule=0&ipList0=0 &ipList1=0&ipList2=0&ipList3=0&ipList4=0&ipList5=0&ipList6=0&ipList7=0&us r=admin&pwd=
Function
Get system log
privilege
visitor
MISC
getFirewallConfig
setFirewallConfig
getLog
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
49
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getLog
Param
offset
Where you want to start get log
count
How many logs you want to get, must less then 20
Return
totalCnt
Total log count
curCnt
current log count
logN
log information, consist by time+user+ip+logID
Note
We can have 1000 record of log at most. We can get 10 log at most one time
Example
/cgi-bin/CGIProxy.fcgi?cmd=getLog&offset=0&count=20&usr=admin&pwd=
*logID: 0:System power on 1:Detect motion alarm 2:user login 3:user logout 4:user off line
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Loading...