Foscam

Foscam

new Foscam(config)

Foscam Client SDK

Source:
Parameters:
Name Type Description
config object
Name Type Attributes Description
username string

Username of a valid Foscam user.

password string

Password of the Foscam user.

host string

Host or IP address of the Foscam

port string <optional>

Optional port to use. Defaults to 88.

protocol string <optional>

Optional protocol to use. Defaults to http.

Methods

(static) parseResponse(xml) → {Promise.<object>}

Parses the response from the camera API request

Source:
Parameters:
Name Type Description
xml string

XML response

Returns:
Type:
Promise.<object>

A promise to the response.

addAccount()

Add user account

Source:
To Do:
  • Write the documentation.
  • Implement this function.

addMultiDev()

Add multiy device

Source:
To Do:
  • Write the documentation.
  • Implement this function.

changePassword()

Change password

Source:
To Do:
  • Write the documentation.
  • Implement this function.

changeUserName()

Change user name

Source:
To Do:
  • Write the documentation.
  • Implement this function.

changeUserNameAndPwdTogether()

Change user name and password together

Source:
To Do:
  • Write the documentation.
  • Implement this function.

clearIOAlarmOutput() → {Promise.<object>}

Clean IO alarm output.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

closeInfraLed() → {Promise.<object>}

Force close infra led.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

delAccount()

Delete user account

Source:
To Do:
  • Write the documentation.
  • Implement this function.

delMultiDev(channel)

Delete multiy device

Source:
Parameters:
Name Type Description
channel int

Channel number

exportConfig() → {Promise.<object>}

Export config file. After call this command, you can get the config file by visit the following addr:/configs/export/configs.bin

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

flipVideo(isFlip) → {Promise.<object>}

Set flip video setting.

Source:
Parameters:
Name Type Description
isFlip boolean

If flip should be set or not.

Returns:
Type:
Promise.<object>

A promise to the response.

fwUpgrade()

Upgrade firmware

Source:
To Do:
  • Write the documentation.
  • Implement this function.

get(command, paramsopt) → {Promise.<object>}

Sends an API request to the camera and parses the response.

Source:
Parameters:
Name Type Attributes Description
command string

CGI command to send

params object <optional>

Params to include with the request

Returns:
Type:
Promise.<object>

A promise to the response.

get485Info() → {Promise.<object>}

Get informations of 485.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getAlarmRecordConfig() → {Promise.<Foscam.alarmRecordConfig>}

Get alarm record config.

Source:
Returns:
Type:
Promise.<Foscam.alarmRecordConfig>

A promise to the response.

getCruiseCtrlMode() → {Promise.<object>}

Get control mode for continue cruise, by time or count.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getCruiseLoopCnt() → {Promise.<object>}

Set counts for continue cruise.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getCruisePrePointLingerTime()

Get linger time for cruise,when pt arrive prepoint

Source:
To Do:
  • Write the documentation.
  • Implement this function.

getCruiseTime() → {Promise.<object>}

Set time for continue cruise.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getCruiseTimeCustomed() → {Promise.<object>}

Set time for continue cruise by costomer.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getDDNSConfig() → {Promise.<object>}

Get DDNS config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getDeFrameLevel() → {Promise.<{level: int}>}

Get status of enhance the night vision definition

Source:
Returns:
Type:
Promise.<{level: int}>

A promise to the response

getDevInfo() → {Promise.<object>}

Get camera information.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getDevName() → {Promise.<object>}

Get camera name.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getDevState() → {Promise.<object>}

Get all device state.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getFirewallConfig() → {Promise.<object>}

Get firewall config

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getFtpConfig() → {Promise.<object>}

Get FTP config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getGeneratePubKey() → {Promise.<object>}

Get public key generated by camera for software reset.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getH264FrameReferenceMode() → {Promise.<{mode: int}>}

Get frame shipping reference mode of H264 encode stream.

Source:
Returns:
Type:
Promise.<{mode: int}>

A promise to the response.

  • 0: Normal reference mode
  • 1: Two frames are separated by four skipping frames

getImageSetting() → {Promise.<Foscam.getImageSettingResponse>}

Get color attribute of video.

Source:
Returns:
Type:
Promise.<Foscam.getImageSettingResponse>

getInfraLedConfig() → {Promise.<object>}

Get infra led config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getIOAlarmConfig() → {Promise.<Foscam.ioAlarmConfig>}

Get IO alarm config.

Source:
Returns:
Type:
Promise.<Foscam.ioAlarmConfig>

A promise to the response.

getIPInfo() → {Promise.<object>}

Get IP Info.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getLocalAlarmRecordConfig() → {Promise.<Foscam.localAlarmRecordConfig>}

Get local alarm-record config

Source:
Returns:
Type:
Promise.<Foscam.localAlarmRecordConfig>

A promise to the response.

getLog(paramsopt) → {Promise.<object>}

Get system log

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Params for pagination.

Name Type Attributes Description
offset int <optional>

Where you want to start get log.

count int <optional>

How many logs you want to get, must 20 or less.

Returns:
Type:
Promise.<object>

A promise to the response.

getMainVideoStreamType() → {Promise.<{streamType: int}>}

Get the stream type of main stream.

Source:
Returns:
Type:
Promise.<{streamType: int}>

A promise to the response.

getMirrorAndFlipSetting() → {Promise.<Foscam.getMirrorAndFlipSettingResponse>}

Get mirror and flip attribute of video.

Source:
Returns:
Type:
Promise.<Foscam.getMirrorAndFlipSettingResponse>

A promise to the response.

getMJStream() → {Promise.<object>}

Get motion jpeg stream.

  1. Motion jpeg stream data is returned from http server by a serverpush mode
  2. MJ stream is VGA resolution @ 15fps
  3. For some version of Firefox browse, the Firefox will crash when use “GetMJStream” CGI to get mjstream long time. This problem is due to the browse has some defects, it can not parse data correctly and directly. In order to fix this problem, we should as follows:
    • Create a .html empty document, such as “MJ.html”.
    • Input the content into you .txt document, as follows:
      
               <html><body>
                   <img src="http://example.com:99/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=" />
               </body></html>
           

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getMotionDetectConfig() → {Promise.<Foscam.motionDetectConfig>}

Get motion detect config.

  • Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )
    • bit0: Ring
    • bit1: Sent mail
    • bit2: Snap picture
    • bit3: Record
Source:
Returns:
Type:
Promise.<Foscam.motionDetectConfig>

A promise to the response.

getMotionDetectConfig1() → {Promise.<Foscam.motionDetectConfig1>}

Get motion detect config. New CGI command obtained from Foscam Technical Support

  • Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )
    • bit0: Ring
    • bit1: Sent mail
    • bit2: Snap picture
    • bit3: Record
Source:
Returns:
Type:
Promise.<Foscam.motionDetectConfig1>

A promise to the response.

getMultiDevDetailInfo(channel) → {Promise.<object>}

Get multi device information.

Source:
Parameters:
Name Type Description
channel int

Channel no

Returns:
Type:
Promise.<object>

A promise to the response.

getMultiDevList() → {Promise.<object>}

Get multi device list.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getOSDMask() → {Promise.<Foscam.getOSDMaskResponse>}

Get OSD mask status.

Source:
Returns:
Type:
Promise.<Foscam.getOSDMaskResponse>

A promise to the response.

getOSDMaskArea() → {Promise.<Foscam.getOSDMaskArea>}

Get OSD mask area info. Our device can only support 4 mask areas.

Source:
Returns:
Type:
Promise.<Foscam.getOSDMaskArea>

A promise to the response.

getOSDSetting() → {Promise.<Foscam.getOSDSetting>}

Get OSD config.

Source:
Returns:
Type:
Promise.<Foscam.getOSDSetting>

A promise to the response.

getP2PEnable() → {Promise.<object>}

Get p2p status.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getP2PInfo() → {Promise.<object>}

Get p2p UID.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getP2PPort() → {Promise.<object>}

Get p2p port.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPCAudioAlarmCfg() → {Promise.<{isEnablePCAudioAlarm: boolean}>}

Get audio alarm config for PC(web live video).

Source:
Returns:
Type:
Promise.<{isEnablePCAudioAlarm: boolean}>

A promise to the response.

getPortInfo() → {Promise.<object>}

Get ports of camera.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPPPoEConfig() → {Promise.<object>}

Get PPPoE config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductAllInfo() → {Promise.<object>}

Get camera Information.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductAppVer() → {Promise.<object>}

Get camera application version.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductAudioFlag() → {Promise.<object>}

Whether camera support audio-speak.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductIoAlarmFlag() → {Promise.<object>}

Whether camera support IO alarm.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductLanguage() → {Promise.<object>}

Get camera main language.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductModel() → {Promise.<object>}

Get camera model number.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductModelName() → {Promise.<object>}

Get camera model name.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductOnvifFlag() → {Promise.<object>}

Whether camera support Onvif.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductOutdoorFlag() → {Promise.<object>}

Whether camera is outdoor machine.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductP2pFlag() → {Promise.<object>}

Whether camera support P2p.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductPtFlag() → {Promise.<object>}

Whether camera is pt machine.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductRs485Flag() → {Promise.<object>}

Whether camera support rs485.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductSdFlag() → {Promise.<object>}

Whether camera support sd card.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductSensorType() → {Promise.<object>}

Get camera sensor type number.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductTalkFlag() → {Promise.<object>}

Whether camera support audio-talk.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductWifiType() → {Promise.<object>}

Get camera wifi type number.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductWpsFlag() → {Promise.<object>}

Whether camera support Wps.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getProductZoomFlag() → {Promise.<object>}

Whether camera is zoom machine.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPTZPrePointForSelfTest() → {Promise.<object>}

Get the presetpoint for selftest of PTZ.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPTZPresetPointList() → {Promise.<object>}

Get all preset point.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPTZSelfTestMode() → {Promise.<object>}

Get the selftest mode of PTZ.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getPTZSpeed() → {Promise.<object>}

Get the speed of PT.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getRatio() → {Promise.<{ratio: int}>}

Get value for image distortion correction.

Source:
Returns:
Type:
Promise.<{ratio: int}>

A promise to the response. Three ranks for image distortion correction:

  • High: 150
  • Middle 210
  • Low: 430

getRaw(command, paramsopt, optionsopt) → {Promise.<object>}

Sends an API request to the camera and returns the raw response.

Source:
Parameters:
Name Type Attributes Description
command string

CGI command to send.

params object <optional>

Params to include with the request.

options object <optional>

Additional options to pass to request-promise

Returns:
Type:
Promise.<object>

A promise to the response.

getRecordList() → {Promise.<object>}

Get record list.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getRecordList2() → {Promise.<object>}

Get record list.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getRecordPath() → {Promise.<object>}

Get record path for storage.

Source:
Returns:
Type:
Promise.<object>

A promise to the response. path: 0-SD card, 2-FTP server free: The free capacity of storage device total: The total capacity of storage device

getScheduleInfraLedConfig() → {Promise.<object>}

Get config for infra led switch schedule.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getScheduleRecordConfig() → {Promise.<Foscam.scheduleRecordConfig>}

Get config for schedule recording.

Source:
Returns:
Type:
Promise.<Foscam.scheduleRecordConfig>

A promise to the response.

getScheduleRecordStreamChannel() → {Promise.<{chn: int}>}

Get stream channel for schedule record.

Source:
Returns:
Type:
Promise.<{chn: int}>

A promise to the response.

  • 0: main stream
  • 1: sub stream

getScheduleSnapConfig() → {Promise.<Foscam.scheduleSnapConfig>}

Get schedule snap config. The min unit of schedule is half an hour, scheduleN value range 2N -1(N[0-48])

Source:
Returns:
Type:
Promise.<Foscam.scheduleSnapConfig>

A promise to the response.

getSessionList() → {Promise.<object>}

Get current session list of the camera.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getSMTPConfig() → {Promise.<object>}

Get mail config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getSnapConfig() → {Promise.<Foscam.snapConfig>}

Get snap config.

Source:
Returns:
Type:
Promise.<Foscam.snapConfig>

A promise to the response.

getSubVideoStreamParam() → {Promise.<object>}

Get sub video stream param.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getSubVideoStreamType() → {Promise.<{streamType: int}>}

Get the stream type of sub stream.

Source:
Returns:
Type:
Promise.<{streamType: int}>

A promise to the response.

getSystemTime() → {Promise.<object>}

Get system time.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getUPnPConfig() → {Promise.<object>}

Get UpnP config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getUserList() → {Promise.<object>}

Get user account list of the camera.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getVideoStreamParam() → {Promise.<Foscam.videoStreamParamResponse>}

Get video stream param.

Source:
Returns:
Type:
Promise.<Foscam.videoStreamParamResponse>

A promise to the response.

getWifiConfig() → {Promise.<object>}

Get wifi config.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

getWifiList(startNoopt) → {Promise.<object>}

Get the aps around after refreshWifiList.

Source:
Parameters:
Name Type Attributes Description
startNo int <optional>

The page number of wifilist to return.

Returns:
Type:
Promise.<object>

A promise to the response.

getZoomSpeed() → {Promise.<object>}

Get the speed of Zoom.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

importConfig()

Import config file

Source:
To Do:
  • Write the documentation.
  • Implement this function.

logIn(paramsopt) → {Promise.<object>}

User log in to camera.

Source:
Parameters:
Name Type Attributes Description
params object <optional>
Name Type Attributes Description
username string <optional>

Username to login. Defaults to username supplied at api initialization.

password string <optional>

Password of user to login. Defaults to password supplied at api initialization.

Returns:
Type:
Promise.<object>

A promise to the response.

logOut(usernameopt) → {Promise.<object>}

User log out to camera.

Source:
Parameters:
Name Type Attributes Description
username string <optional>

Username to login. Defaults to username supplied at api initialization.

Returns:
Type:
Promise.<object>

A promise to the response.

mirrorVideo(isMirror) → {Promise.<object>}

Set mirror video setting.

Source:
Parameters:
Name Type Description
isMirror boolean

If mirror should be set or not.

Returns:
Type:
Promise.<object>

A promise to the response.

(private) notImplemented()

Generic method to throw an error for API methods that haven't been implemented yet

Source:

openInfraLed() → {Promise.<object>}

Force open infra led.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzAddPresetPoint()

Add preset point

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzDelCruiseMap()

Delete a cruise map

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzDeletePresetPoint()

Delete preset point by name

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzGetCruiseMapInfo()

Get the detail info of a cruise map by name

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzGetCruiseMapList() → {Promise.<object>}

Get all cruise map list. Our device can support at most 8 cruise map. We have 2 maps default:Horizental/Vertical.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzGotoPresetPoint() → {Promise.<object>}

Goto preset position.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveBottomLeft() → {Promise.<object>}

Move to bottom left.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveBottomRight() → {Promise.<object>}

Move to bottom right.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveDown() → {Promise.<object>}

Move down.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveLeft() → {Promise.<object>}

Move left.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveRight() → {Promise.<object>}

Move right.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveTopLeft() → {Promise.<object>}

Move to top left.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveTopRight() → {Promise.<object>}

Move to top right.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzMoveUp() → {Promise.<object>}

Move up.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzReset() → {Promise.<object>}

Reset PT to default position.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzSetCruiseMap()

Add a cruise map

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzStartCruise()

Start a specificate cruisep

Source:
To Do:
  • Write the documentation.
  • Implement this function.

ptzStopCruise() → {Promise.<object>}

Start current cruise.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

ptzStopRun() → {Promise.<object>}

Stop run PT.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

rebootSystem() → {Promise.<object>}

Reboot camera.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

refreshWifiList() → {Promise.<object>}

Start scan the aps around.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

reloadRecordIndex() → {Promise.<object>}

Synchronization of record index for Play.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

resetImageSetting() → {Promise.<object>}

Reset color parameters to default value.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

restoreToFactorySetting() → {Promise.<object>}

Restore to factory setting.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

set485Info()

Get informations of 485

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setAlarmRecordConfig(config) → {Promise.<object>}

Set alarm record config

Source:
Parameters:
Name Type Description
config Foscam.alarmRecordConfig
Returns:
Type:
Promise.<object>

A promise to the response.

setBrightness(brightness) → {Promise.<object>}

Set brightness of video.

Source:
Parameters:
Name Type Description
brightness int

New level of brightness. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setContrast(contrast) → {Promise.<object>}

Set contrast of video.

Source:
Parameters:
Name Type Description
contrast int

New level of contrast. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setCruiseCtrlMode()

Set control mode for continue cruise, by time or count

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setCruiseLoopCnt()

Set counts for continue cruise

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setCruisePrePointLingerTime()

Set linger time for cruise,when pt arrive prepoint

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setCruiseTime()

Set time for continue cruise

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setCruiseTimeCustomed()

Set time for continue cruise by costomer

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setDDNSConfig()

Set DDNS config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setDeFrameLevel(level) → {Promise.<object>}

Set status to enhance night vision definition

Source:
Parameters:
Name Type Description
level int

Enhance status, 0 or 1

Returns:
Type:
Promise.<object>

A promise to the response

setDenoiseLevel(level) → {Promise.<object>}

Set DenoiseLevel of video. Not in use.

Source:
Parameters:
Name Type Description
level int

New level of denoise. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setDevName(name) → {Promise.<object>}

Set camera name.

Source:
Parameters:
Name Type Description
name string

Camera name.

Returns:
Type:
Promise.<object>

A promise to the response.

setFirewallConfig()

Set firewall config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setFtpConfig()

Set FTP config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setH264FrameReferenceMode(mode) → {Promise.<object>}

Set frame shipping reference mode of H264 encode stream.

Source:
Parameters:
Name Type Description
mode int

1 or 0. 0 for 'Normal reference mode'. 1 for 'Two frames are separated by four skipping frames'.

Returns:
Type:
Promise.<object>

A promise to the response.

setHue(hue) → {Promise.<object>}

Set hue of video.

Source:
Parameters:
Name Type Description
hue int

New level of hue. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setInfraLedConfig()

Set infra led config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setIOAlarmConfig(ioAlarmConfig) → {Promise.<object>}

Set IO alarm config

Source:
Parameters:
Name Type Description
ioAlarmConfig Foscam.ioAlarmConfig
Returns:
Type:
Promise.<object>

A promise to the response.

setIpInfo()

Set IP Info

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setLocalAlarmRecordConfig(params) → {Promise.<object>}

Set local alarm-record config

Source:
Parameters:
Name Type Description
params Foscam.localAlarmRecordConfig
Returns:
Type:
Promise.<object>

A promise to the response.

setMainVideoStreamType(streamType) → {Promise.<object>}

Set the stream type of main stream.

Source:
Parameters:
Name Type Description
streamType int

The stream type 0~3.

Returns:
Type:
Promise.<object>

A promise to the response.

setMotionDetectConfig(params) → {Promise.<object>}

Set motion detect config

 - 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, scheduleN value range 2N -1(N[0-48])
 - areaN value 2N -1(N[0-10])
Source:
To Do:
  • Document format for schedules and areas
Parameters:
Name Type Description
params Foscam.motionDetectConfig
Returns:
Type:
Promise.<object>

A promise to the response.

Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=16&
     snapInterval=2&sensitivity=1&triggerInterval=5&schedule0=1023&schedule1=
     1023&schedule2=1023&schedule3=1023&schedule4=1023&schedule5=1023&
     schedule6=1023&area0=1023&area1=1023&area2=1023&area3=1023&area4=
     1023&area5=1023&area6=1023&area7=1023&area7=1023&area8=1023&area9=1023

setMotionDetectConfig1(params) → {Promise.<object>}

Set motion detect config

 - 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, scheduleN value range 2N -1(N[0-48])
 - areaN value 2N -1(N[0-10])
Source:
To Do:
  • Document format for schedules and areas
Parameters:
Name Type Description
params Foscam.motionDetectConfig1
Returns:
Type:
Promise.<object>

A promise to the response.

Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=0&
     snapInterval=0&triggerInterval=0&isMovAlarmEnable=1&isPirAlarmEnable=1&
     schedule0=0&schedule1=0&schedule2=0&schedule3=0&schedule4=0&schedule5=0&
     schedule6=0&x1=0&y1=0&width1=10000&height1=10000&threshold1=52254&
     sensitivity1=30396&valid1=0&x2=0&y2=0&width2=10000&height2=10000&threshold2=0&
     sensitivity2=0&valid2=0&x3=0&y3=0&width3=12&height3=0&threshold3=2&
     sensitivity3>0&valid3=65535

setOSDMask(isEnabledOSDMask) → {Promise.<object>}

Set OSD mask status.

Source:
Parameters:
Name Type Description
isEnabledOSDMask boolean
Returns:
Type:
Promise.<object>

A promise to the response.

setOSDMaskArea(params) → {Promise.<object>}

Set OSD mask area info. Our device can only support 4 mask areas.

Source:
Parameters:
Name Type Description
params Foscam.getOSDMaskArea
Returns:
Type:
Promise.<object>

A promise to the response.

setOSDSetting(params) → {Promise.<object>}

Set OSD config.

Source:
Parameters:
Name Type Description
params Foscam.getOSDSetting
Returns:
Type:
Promise.<object>

A promise to the response.

setP2PEnable()

Set p2p status

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setP2PPort()

Set p2p port

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setPCAudioAlarmCfg(isEnablePCAudioAlarm) → {Promise.<object>}

Set audio alarm config for PC(web live video.

Source:
Parameters:
Name Type Description
isEnablePCAudioAlarm boolean

Enable state

Returns:
Type:
Promise.<object>

A promise to the response.

setPortInfo()

Set ports of camera

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setPowerFrequency(frequency) → {Promise.<object>}

Set power freq of sensor.

Source:
Parameters:
Name Type Description
frequency int

1 or 0. 0 for '60HZ'. 1 for '50HZ'. 2 for 'outdoor mode'

Returns:
Type:
Promise.<object>

A promise to the response.

setPPPoEConfig()

Set PPPoE config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setPTZPrePointForSelfTest()

Set informations of 485

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setPTZSelfTestMode()

Set the selftest mode of PTZ

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setPTZSpeed(speed) → {Promise.<object>}

Set the speed of PT.

Source:
Parameters:
Name Type Description
speed int

0: Very slow 1: Slow 2: Normal speed 3: Fast 4: Very fast

Returns:
Type:
Promise.<object>

A promise to the response.

setRatio(ratio) → {Promise.<object>}

Set value for image distortion correction

Source:
Parameters:
Name Type Description
ratio int

0-511. Three ranks:

  • High: 0-150
  • Middle (default): 151-430.
  • Low:431-511.
Returns:
Type:
Promise.<object>

A promise to the response.

setSaturation(saturation) → {Promise.<object>}

Set saturation of video

Source:
Parameters:
Name Type Description
saturation int

New level of saturation. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setScheduleInfraLedConfig()

Set config for infra led switch schedule

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setScheduleRecordConfig() → {Promise.<object>}

Set schedule recordconfig.

Source:
Parameters:
Name Type Description
scheduleRecordConfig. Foscam.scheduleRecordConfig
Returns:
Type:
Promise.<object>

A promise to the response.

setScheduleRecordStreamChannel(channel) → {Promise.<object>}

Set stream channel for schedule record.

Source:
Parameters:
Name Type Description
channel int

1 or 0. 0 for 'Main Stream'. 1 for 'Sub Stream'.

Returns:
Type:
Promise.<object>

A promise to the response.

setScheduleSnapConfig() → {Promise.<Object>}

Set schedule snap config

Source:
Parameters:
Name Type Description
config. Foscam.scheduleSnapConfig
Returns:
Type:
Promise.<Object>

A promise to the response.

setSharpness(sharpness) → {Promise.<object>}

Set sharpness of video.

Source:
Parameters:
Name Type Description
sharpness int

New level of sharpness. Between 1-100.

Returns:
Type:
Promise.<object>

A promise to the response.

setSMTPConfig()

Set mail config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setSnapConfig(config) → {Promise.<object>}

Set snap config.

Source:
Parameters:
Name Type Description
config Foscam.snapConfig

Config for snap

Returns:
Type:
Promise.<object>

A promise to the response.

setSubStreamFormat(format) → {Promise.<object>}

Set the stream format of sub stream. 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.

Source:
Parameters:
Name Type Description
format int

0: H264. 1: MotionJpeg

Returns:
Type:
Promise.<object>

A promise to the response.

setSubVideoStreamParam(params) → {Promise.<object>}

Set the sub video stream param of stream N

Source:
Parameters:
Name Type Description
params object
Name Type Attributes Description
streamType int

0-3.

resolution int

Resolution of stream type N.

bitRate int

Bit rate of stream type N (20480~2097152).

frameRate int

Frame rate of stream type N.

GOP int

P frames between I frame of stream type N. The suggest value is: X * frameRate

isVBR boolean <optional>

Not in use currently. Defaults to false.

Returns:
Type:
Promise.<object>

A promise to the response.

setSystemTime()

Set system time

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setUPnPConfig()

Set UpnP config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setVideoStreamParam(params) → {Promise.<object>}

Set the video stream param of stream N

Source:
Parameters:
Name Type Description
params object
Name Type Attributes Description
streamType int

0-3.

resolution int

Resolution of stream type N.

bitRate int

Bit rate of stream type N (20480~2097152).

frameRate int

Frame rate of stream type N.

GOP int

P frames between I frame of stream type N. The suggest value is: X * frameRate

isVBR boolean <optional>

Change bit rate of stream type. Defaults to false.

Returns:
Type:
Promise.<object>

A promise to the response.

setWifiSetting()

Set wifi config

Source:
To Do:
  • Write the documentation.
  • Implement this function.

setZoomSpeed()

Set the speed of PTZ

Source:
To Do:
  • Write the documentation.
  • Implement this function.

smtpTest()

Test mail setting

Source:
To Do:
  • Write the documentation.
  • Implement this function.

snapPicture() → {Promise.<Object>}

Manual snap picture. Picture resolution is the same as main stream resolutionnapPicture.

Source:
Returns:
Type:
Promise.<Object>

A promise to the response. We will return a html script directly.

snapPicture2() → {Promise.<Object>}

Manual snap picture. This command will return jpeg image data directly.

Source:
Returns:
Type:
Promise.<Object>

A promise to the response. jpeg image data directly.

testFtpServer()

Test FTP server

Source:
To Do:
  • Write the documentation.
  • Implement this function.

toolResetToFactory()

Set camera reset to factory by software

Source:
To Do:
  • Write the documentation.
  • Implement this function.

usrBeatHeart()

user checks connection with camera

Source:
To Do:
  • Write the documentation.
  • Implement this function.

zoomIn() → {Promise.<object>}

Zoom in.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

zoomOut() → {Promise.<object>}

Zoom out.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

zoomStop() → {Promise.<object>}

Stop zoom run.

Source:
Returns:
Type:
Promise.<object>

A promise to the response.

Type Definitions

alarmRecordConfig

Properties:
Name Type Description
isEnablePreRecord boolean

Preview record state

preRecordSecs int

Preview record time

alarmRecordSecs int

Alarm record time

Source:

getImageSettingResponse

Properties:
Name Type Description
brightness int

0-100.

contrast int

0-100.

hue int

0-100.

saturation int

0-100.

sharpness int

0-100.

denoiseLevel int

Not in use.

Source:

getMirrorAndFlipSettingResponse

Properties:
Name Type Description
isMirror boolean

If the image or mirrored or not.

isFlip boolean

If the image is flipped or not.

Source:

getOSDMaskArea

Properties:
Name Type Description
x1_N int

The top left X position of mask N

y1_N int

The top left Y position of mask N

x2_N int

The bottom right X position of mask N

y2_N int

The bottom right Y position of mask N

Source:

getOSDSetting

Properties:
Name Type Description
isEnableTimeStamp boolean

Time stamp will display on screen or not.

isEnableDevName boolean

Camera name will display on screen or not

dispPos int

OSD display position, currently can only be 0

isEnableOSDMask boolean

Is OSD mask effective.

Source:

localAlarmRecordConfig

Properties:
Name Type Description
isEnableLocalAlarmRecord boolean

false: Disable. true: Enable.

localAlarmRecordSecs int

Recording time.

Source:

motionDetectConfig

  • Video region is divided into 10*10 sub areas.
    • The min unit of schedule is half an hour, scheduleN value range 2^n - 1(N[0-48])
    • areaN value 2^n - 1(N[0-10])
Properties:
Name Type Description
isEnable boolean

Is enable motion detect alarm

linkage

Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )

  • bit0: Ring
  • bit1: Sent mail
  • bit2: Snap picture
  • bit3: Record
snapInterval int

The interval time to snap picture again

Motion int

sensitivity detect.

  • 0: Low
  • 1: Normal
  • 2: High
  • 3: Lower
  • 4: Lowest
triggerInterval int

The time of which motion detect alarm can trigger again when a motion detection has happened.

scheduleN int

The motion alaram schedule of one week,

  • N = 0 (Monday) - 6 (Sunday)
areaN int

The area info of row N

Source:

scheduleRecordConfig

The min unit of schedule is half an hour, scheduleN value range 2^n -1(N[0-48])

Properties:
Name Type Description
isEnable boolean

Schedule-Record enable status, 0-disable,1-enable.

recordLevel int

Level for drop frame.

  • 0: 30/30
  • 1: 24/30
  • 2: 15/30
  • 3: 8/30,
  • 4: 4/30
  • 5: 1/30
spaceFullMode int

The process method when SD card is full,0-cover the oldest video and continue record,1-stop record

isEnableAudio boolean

Is recording include audio?

scheduleN int

The motion alarm schedule of one week,N = 0(Monday) ~6(Sunday)

Source:

scheduleSnapConfig

Properties:
Name Type Description
isEnable boolean

Is enable motion detect alarm.

snapInterval int

The interval time to snap picture again.

scheduleN int

The motion alaram schedule of one week.

  • N = 0(Monday) ~6(Sunday)
  • The min unit of schedule is half an hour, scheduleN value range 2^n -1(N[0-48])
Source:

snapConfig

Properties:
Name Type Description
snapPicQuality int

0: Low Quality. 1: Normal Quality. 2: High quality.

saveLocation int

0: Save to sd card. 1: Not in use now. 2: Upload to FTP.

Source:

videoStreamParamResponse

N means streamType [0~3]

Properties:
Name Type Description
resolutionN int

Resolution of stream type N.

bitRateN int

Bit rate of stream type N (20480~2097152)

frameRateN int

Frame rate of stream type N

GOPN int

P frames between I frame of stream type N

isVBRN boolean

Change bit rate of stream true-yes false-nosetSubVideoStreamParam

Source: