MODE D'EMPLOI EM6561 Eminent
IPCAM CGI SDK 1.7
Contents
IPCAM CGI SDK 1.7 1
summary 3
snapshot.cgi 4
videoostream.cgi 4
videoostream.asf 4
get_status.cgi 5
get_camera.params.cgi 6
decoder_control.cgi 6
camera_control.cgi 7
reboot.cgi 8
restoreFACTORY.cgi 8
get.params.cgi 8
upgrade_firmware.cgi 11
upgrade_htmls.cgi 11
set alias.cgi 11
setdatetime CGI 12
set_users.cgi 12
set/devices.cgi 12
set_network.cgi 13
set_wifi.cgi 13
set_pppoe.cgi 14
set_upnp.cgi 14
set_ddns.cgi 15
setftp.cgi 15
set_mail.cgi 16
set alarm.cgi 16
Comm_write.cgi 16
SetForbidden.cgi 17
getForbidden.cgi 18
Set_misc.cgi 18
get_misc.cgi 19
setDecoder.cgi 19
summary
The CGI APIs is based on http protocal.
Different CGI with different Permissions: visitor, operator and Administrator. In this article, CGI only support get and post method. upgrade_firmware.cgi and upgrade_htmls.cgi only support post method, otherscgi only support get method.
next_url:an option param. If you don't want only return a simple "OK" when set succeed, you can add a param in the end—next_url. The param is the next file it jump to when set succeed. The param must be a Relative path.
Get: (Example)
<form action="/set_mail.cgi">
<input name="svr">
<input name="user">
<input name="pwd">
<input name="sender">
<input name="receiver1">
<input name="receiver2">
<input name="receiver3">
<input name="receiver4">
<input type="hidden name="next_url" value="index.htm">
<input type="submit value="ok">
</form>
Post: (Example)
<form action="upgrade_firmware.cgi?next_url=index.htm" method="post" enctype="multipart/form-data">
<input type="file" name="file" size="20">
</form>
snapshot.cgi
| description To obtain the snapshot |
| Permission | visitor |
| Syntax | /snapshot.cgi?[?user=&pwd=&next_url=] |
| Parameters | user:username
pwd:password
next_url:The name of snapshot |
| Note | 1 If not use the parameter "next_url", the snapshot name is: device id(Alias)_Current time.jpg
2 Use "next_url" (for example:next_url=1 the name of photo:1.jpg)
3 support 2 Authentication Methods: http Basic64 encode and use username/password in the param directly. |
videostream.cgi
| description Use | server push mode to send videostream to Client APP |
| Permission | visitor |
| Syntax | /videostream.cgi?[?user=&pwd=&resolution=] |
| Parameters | user:username
pwd:password |
| Note | Resolution: 8: 320*240
32: 640*480 |
videostream.asf
| description | Ipcam send videostream of asf format, only support VLC player and mplayer |
| Permission | visitor |
| Syntax | /videostream.asf[?user=&pwd=&resolution=] |
| Parameters | user:username pwd:password |
| Note | Resolution: 8: 320*240 32: 640*480 |
get.status.cgi
| description To obtain the Device status info. |
| Permission | everyone |
| Syntax | /get_status.cgi |
| return | now: The count of seconds form 1970-1-1 0:0:0 to now alarm_status: 0:no alarm1:motion alarm2:input alarmddns_status: DDNS status/details see below)upnp_status: UPNP status/details see below) |
| Note support 2 | Authentication Methods: http Basic64 encode and use username/password in the param directly. |
ddns_status
| Return description |
| 0 | No Action |
| 1 | It's connecting... |
| 2 Can't connect to the Server |
| 3 | Dyndns Succeed |
| 4 DynDns Failed: Dyndns.org Server Error |
| 5 DynDns Failed: Incorrect User or Password |
| 6 DynDns Failed: Need Credited User |
| 7 DynDns Failed: Illegal Host Format |
| 8 DynDns Failed: The Host Does not Exist |
| 9 DynDns Failed: The Host Does not Belong to You |
| 10 DynDns Failed: Too Many or Too Few Hosts |
| 11 DynDns Failed: The Host is Restricted for Abusing |
| 12 DynDns Failed: Bad Reply from Server |
| 13 DynDns Failed: Bad Reply from Server |
| 14 Oray Failed: Bad Reply from Server |
| 15 Oray Failed: Incorrect User or Password |
| 16 Oray Failed: Incorrect Hostname |
| 17 | Oray Succeed |
| 18 | Reserved |
| 19 | Reserved |
| 20 | Reserved |
| 21 | Reserved |
upnp_status
| Return description |
| 0 | No Action |
| 1 | Succeed |
| 2 Device System Error |
| 3 Errors in Network Communication |
| 4 Errors in Chat with UPnP Device |
| 5 Rejected by UPnP Device, Maybe Port Conflict |
get_camera.params.cgi
| description obtain | camera params |
| Permission | visitor |
| Syntax | /get_camera_parameters.cgi?[?user=&pwd=] |
| Parameters | user:username
pwd:password |
| Note | Return:
Resolution: 8: 320*240
32: 640*480
Brightness: 0-255
Contrast: 0-6
Mode: 0: 50hz
1: 60hz
2: outdoor format
Flip: 0: initial
1: vertical rotate
2: horizontal rotate
3: vertical + horizontal rotate |
decoder_control.cgi
| description | Decoder control |
| Permission | operator |
| Syntax | /decoder_control.cgi?command=[&next_url=] |
| Parameters | value | description |
| 0 | up |
| 1 | Stop |
| 2 | down |
| 3 | Stop |
| 4 | left |
| 5 | Stop |
| 6 | right |
| 7 | Stop |
| ... | Reserved |
| 25 | center |
| 26 | Vertical |
| 27 | Stop |
| 28 | Horizon |
| 29 Stop horizon patrol | |
| ... | Reserved |
| 94 IO output high | |
| 95 IO output low | |
camera_control.cgi
| description To control camera sensor Parameters |
| Permission | operator |
| Syntax | /camera_control.cgi?param=&value=[&next_url=] |
| Parameters | param
value (see below) |
| param | value |
| 0 Resolution 8:3 | 20*240 |
| 32:640*480 |
| 1 Brightness 0~2 | 55 |
| 2 Contrast 0~6 | |
| 3 mode 0:50Hz | 1:60Hz |
| 2:Outdoor |
| 5 Flip&mirror 0: default | 1: flip |
| 2: mirror |
| 3: flip + mirror |
reboot.cgi
| description | Reboot device |
| Permission | Administrator |
| Syntax | /reboot.cgi[?next_url=] |
restoreFACTORY.cgi
| description | Restore factory settings |
| Permission | Administrator |
| Syntax | /restoreFACTORY.cgi??next_url=] |
get.params.cgi
| description To obtain the device settings info. |
| Permission | Administrator |
| Syntax | /get_parameters.cgi |
Return:
| id | Device | ID |
| sys_ver Firmware version | number |
| app_ver Web UI version number |
| alias | alias |
| now The count of seconds | form 1970-1-1 0:0:0 to now |
| tz The current time zone | settings contrast with the standard time zone GMT (Unit: Seconds) |
| ntp_enable | 0: disable | ntp Calibration time 1: enable |
| ntp_svr | Ntp | Server |
| user1_name | User1 | name |
| user1 pwd | User1 password |
| user1_pri | User1 permission |
| ... | ... |
| user8_name | User8 name |
| user8 pwd | User8 password |
| user8_pri | User8 permission |
| dev2 Alias The 2nd Device alias |
| dev2_host The 2nd Device | host(IP or Domain name) |
| dev2_port The 2nd Device | port |
| dev2_user The 2nd Device | user name |
| dev2 pwd The 2nd Device | password |
| ... | ... |
| dev9 Alias The 9th Device | alias |
| dev9_host The 9th Device | host(IP or Domain name) |
| dev9_port The 9th Device | port |
| dev9_user The 9th Device | user name |
| dev9 pwd The 9th Device | password |
| ip | IP address |
| mask | mask |
| gateway | gateway |
| dns | Dns server |
| port | port |
| wifi_enable | 0: disable
1: enable |
| wifiSSID | WIFISSID |
| wifi_encrypt | 0: disable
1:web
2:wpa tkip
3:wpa aes
4:wpa2 aes
5:wpa2 tkip+aes |
| wifi_defkey Wep Default TX Key |
| wifi_key1 | Key1 |
| wifi_key2 | Key2 |
| wifi_key3 | Key3 |
| wifi_key4 | Key4 |
| wifi_authtype | Authenticaton type 0:open
1:share |
| wifi_keyformat | Keyformat 0:Hex
1:ASCII |
| wifi_key1_bits | 0:64 bits
1:128 bits |
| wifi_key2_bits | 0:64 bits
1:128 bits |
| wifi_key3_bits | 0:64 bits
1:128 bits |
| wifi_key4_bits | 0:64 bits
1:128 bits |
| wifi_channel_Channel (default 5) |
| wifi_mode_Mode (default 0) |
| wifi_wpa_psk | wpa_psk |
| pppoe_enable | 0: disable
1: enable |
| pppoe_user | pppoe user |
| pppoe pwd | pppoe password |
| upnp_enable | 0: disable
1: enable |
| ddns_service | 0: disable DDNS
1: oray.cn
2: Dyndns.org(dyndns)
3: Dyndns.org.statdns)
4: Dyndns.org(custom)
5: Reserved
6: Reserved
7: Reserved
8:3322.org(dyndns)
9:3322.org/statdns) |
| ddns_user | Ddns user |
| ddns pwd | Ddns password |
| ddns_host | Ddns host |
| ddnsproxy_svc Proxy server | only used in china ) |
| ddnsproxy_port | Proxy port |
| mail_svc | Mailbox server |
| mail_port Mailbox server port |
| mail_user | Mail user name |
| mail pwd | Mail password |
| mailsender | The sender mailbox |
| mail receiver1 | The receiver1 mailbox |
| mail receiver2 | The receiver2 mailbox |
| mailreceiver3 | The receiver3 mailbox |
| mailreceiver4 | The receiver4 mailbox |
| mail_inet_ip | Mail send internet IP 0: disable
1: enable |
| ftp_svc | FTP server |
| ftp_port | FTP server port |
| ftp_user | User name |
| ftp pwd | password |
| ftp_dir | catalogue |
| ftp_mode | 0:post
1:pasv |
| ftp_upload_interval | Upload interval (Seconds) 0: disable |
| alarm_motion_armed | 0:motion disable
1:enable |
| alarm_motion_sensitivity | Sensitivity 0:high 1:medium
2:low
3:ultra low |
| alarm_input_armed 0:input | detect disable
1:enable |
| alarm_iolinkage 0:when alarm disable IO linkage
1:enable |
| alarm_mail 0:when alarm disable mail send
1:enable |
| alarm_upload_interval | Upload interval (Seconds) 0: disable |
upgrade_firmware.cgi
| description | Upgrade firmware |
| Permission | Administrator |
| Syntax | /upgrade_firmware.cgi[?next_url=] |
| Note Must use POST method. |
upgrade_htmls.cgi
| description | Upgrade Web UI firmware |
| Permission | Administrator |
| Syntax | /upgrade_htmls.cgi?[?next_url=] |
| Note | Must use POST method. |
set alias.cgi
| description Set device alias |
| Permission | Administrator |
| Syntax | /set alias.cgi?alias=[&next_url=] |
| Parameters | Alias:length <=20 |
setdatetime CGI
| description Set device data time |
| Permission | Administrator |
| Syntax | /set Datingtime.cgi?tz=&ntp_enable=&ntp_svr=[&now=&next_url=] |
| Parameters now: The count of seconds form 1970-1-1 0:0:0 to now;if use, the device will calibration time depend on it. tz=set time zone. The current time zone settings contrast with the standard time zone GMT (Unit: Seconds)ntp_enable:0: disable 1: enablentp_svr:ntp server length <= 64 |
set_users.cgi
| description | Set device user settings |
| Permission | Administrator |
| Syntax | /set_users.cgi?user1=&pwd1=&pri1=&user2=&pwd2=&pri2=&user3=&pwd3=&pri3=&user4=&pwd4=&pri4=&user5=&pwd5=&pri5=&user6=&pwd6=&pri6=&user7=&pwd7=&pri7=&user8=&pwd8=&pri8=[&next_url=] |
| Parameters | user1: user1 name length <= 12
pwd1: user1 password length <= 12
pri1: user1 Permission 0:visitor 1:operator 2: administrator
...
user8: user1 name length <= 12
pwd8: user1 password length <= 12
pri8: user1 Permission 0:visitor
1:operator
2: administrator |
set/devices.cgi
| description | Set mutlt device |
| Permission | Administrator |
| Syntax | /set/devices.cgi?dev2 Alias=&dev2_host=&dev2_port=&dev2_user=&dev 2 pwd=&dev3 Alias=&dev3_host=&dev3_port=&dev3_user=&dev3 pwd= |
| &dev4alias=&dev4_host=&dev4_port=&dev4_user=&dev4 pwd=&dev5alias=&dev5_host=&dev5_port=&dev5_user=&dev5 pwd=&dev6alias=&dev6_host=&dev6_port=&dev6_user=&dev6 pwd=&dev7alias=&dev7_host=&dev7_port=&dev7_user=&dev7 pwd=&dev8alias=&dev8_host=&dev8_port=&dev8_user=&dev8 pwd=&dev9alias=&dev9_host=&dev9_port=&dev9_user=&dev9 pwd=[&next_url=] |
| Parameters | dev2alias:The 2nd Device aliasdev2_host:The 2nd Device host(IP or Domain name)dev2_port:The 2nd Device portdev2_user:The 2nd Device user namedev2 pwd:The 2nd Device password... ... dev9alias:The 9th Device aliasdev9_host:The 9th Device host(IP or Domain name)dev9_port:The 9th Device portdev9_user:The 9th Device user namedev9 pwd:The 9th Device password |
set_network.cgi
| description Set device basic net settings |
| Permission | Administrator |
| Syntax | /set_network.cgi?ip=&mask=&gateway=&dns=&port=[&next_url=] |
| Parameters Ip:ip | address; if ip set null,The device will DHCP Ip mask: mask gateway: gateway dns: dns server port: port number |
set_wifi.cgi
| description Set | device wireless settings (wifi) |
| Permission | Administrator |
| Syntax | /set_wifi.cgi?enable=&ssid=&encrypt=&defkey=&key1=&key2=&key3=&key4=&authtype=&keyformat=&key1_bits=&key2_bits=&key3_bits=&key4_bits=&channel=&mode=&wpa_psk=[&next_url=] |
| Parameters | enable: 0: disable
1: enable
ssid: wifi SSID |
| encrypt: 0: disable encrypt
1: web
2:wpa tkip
3:wpa aes
4:wpa2 aes
5:wpa2 tkip+aes
defkey: 0~3(web encrypt)
key1:wep key1
...
key4:wep key4
authtype: Authentication type 0:open
1:share
keyformat: Keyformat 0:Hex
1:ASCII
key1_bits: 0:64 bits
1:128 bits
...
key4_bits: 0:64 bits
1:128 bits
channel: Channel (default 5)
mode: Mode (default 0)
wpa_psk: wpa_psk length <= 64;if not use,set null. |
set_pppoe.cgi
| description Set device pppoe settings |
| Permission | Administrator |
| Syntax | /set_pppoe.cgi?enable=&user=&pwd=[&next_url=] |
| Parameters enable: 0: disable pppoe1: enableuser: user name length <=40pwd: password length <=20 |
set_upnp.cgi
| description | Set UPNP settings |
| Permission | Administrator |
| Syntax | /set_upnp.cgi?enable=[&next_url=] |
| Parameters enable: 0: disable UPNP |
set_ddns.cgi
| description Set device DDNS settings |
| Permission | Administrator |
| Syntax | /set_ddns.cgi?service=&user=&pwd=&host=&proxy_svr=&proxy_port=&next_url=] |
| Parameters | service:
0: disable DDNS;
1: oray.cn;
2: DynDns.org(dyndns);
3: DynDns.org.statdns);
4: DynDns.org(custom);
5: Reserved
6: Reserved
7: Reserved
8:3322.org(dyndns)
9:3322.org/statdns)
user: user name length <=20
pwd: password length <=20
host:DDNS domain name length <=40
proxy_svr: Proxy server length <=20 (only used in china Mainland or HongKong)
proxy_port: Proxy port |
setftp.cgi
| description Set device FTP settings |
| Permission | Administrator |
| Syntax | /setftp.cgi?svr=&port=&user=&pwd=&mode=&dir=&upload_interval=[&next_url=] |
| Parameters svr: | FTP server length <=64port: FTP server portuser: User namepwd: passworddir: FTP upload cataloguemode: 0:post1:pasv |
set_mail.cgi
| description Set device mail settings |
| Permission | Administrator |
| Syntax | /set_mail.cgi?svr=&port=&user=&pwd=&sender=&receiver1=&receiver2=&receiver3=&receiver4=&mail_inet_ip=[&next_url=] |
| Parameters svr: | mail server length <=64port: Mailbox server portuser: User name length <=20pwd: password length <=20sender: The sender mailbox length <=40receiver1: The receiver1 mailbox length <=40receiver2: The receiver2 mailbox length <=40receiver3: The receiver3 mailbox length <=40receiver4: The receiver4 mailbox length <=40mail_inet_ip: 0: disable1: enable |
set alarm.cgi
| description Set device alarm settings |
| Permission | Administrator |
| Syntax | /set_alarm.cgi?motion_armed=&motion_sensitivity=&input_armed=&io linkage=&mail=&upload_interval=[&next_url=] |
| Parameters | motion_armed: 0:motion disable 1:enable motion_sensitivity: Sensitivity 0:high 1:medium 2:low 3:ultra low input_armed: 0:input detect disable 1:enableiolinkage: 0:when alarm disable IO linkage 1:enable mail: 0:when alarm disable mail send 1:enable upload_interval: Upload interval (Seconds) 0: disable (range:0-65535) |
Comm_write.cgi
| description | Sending data through camera serial port. | Only support few model |
| Permission | Operator | |
| Syntax | /comm_write.cgi?port=&baud=&bytes=&data=[&next_url=] |
| Parameters Port: 0-3 |
| Baud: |
| 9: B1200 |
| 11: B2400 |
| 12: B4800 |
| 13: B9600 |
| 14: B19200 |
| 15: B38400 |
| 4097: B57600 |
| 4098: B115200 |
| Bytes: < 256 |
| Data: use url code |
SetForbidden.cgi
| description Setting the forbidden for checking video.audio |
| Permission | administratoror |
| Syntax | /setForbidden.cgi?schedule_enable=&schedule.sun_0=&schedule_s un_1=&schedule.sun_2=&schedule_mon_0=&schedule_mon_1=&sch edule_mon_2=&schedule_tue_0=&schedule_tue_1=&schedule_tue_2=&schedule_wed_0=&schedule_wed_1=&schedule_web_2=& schedul e_thu_0=&schedule_thu_1=&schedule_thu_2=&schedule_fri_0=&sch edule_fri_1=&schedule_fri_2=&schedule_sat_0=&schedule_sat_1=&s chedule_sat_2=[&next_url=] |
| Parameters | Schedule_enable Plan to forbidding for audio/video |
| Schedule.sun_0 | Sunday plan. 24hours/day. Divided 24hours to 96 time district, each district for 15 munites. Bit0-95: 0: not forbid, 1: forbid |
| Schedule.sun_1 |
| Schedule.sun_2 |
| Schedule_mon_0 | |
| Schedule_mon_1 |
| Schedule_mon_2 |
| Schedule_tue_0 | |
| Schedule_tue_1 |
| Schedule_tue_2 |
| Schedule_wed_0 | |
| Schedule_wed_1 |
| Schedule_wed_2 |
| Schedule_thu_0 | |
| Schedule_thu_1 |
| Schedule_thu_2 | |
| Schedule_fri_0 | |
| Schedule_fri_1 |
| Schedule_fri_2 |
| Schedule_sat_0 | |
| Schedule_sat_1 |
| Schedule_sat_2 |
getForbidden.cgi
| description | Access the forbidding for checking audio/video |
| Permission | Administrator |
| Syntax | /getForbidden.cgi |
| return See setForbidden.cgi |
Set_misc.cgi
| description | Set rotational Parameters of camera |
| Permission | Administrator |
| Syntax | /set_misc.cgi?
[led_mode=&ptz_center_onstart=&ptz_AUTO.patrol_interval=&ptz_AUTO(pa trol_type=&ptz.patrol_h_rounds=&ptz.patrol_v_rounds=&next_url=] |
| Parameters | Led_mode: 0:mode1
1:model2
2:shut off the led
Ptz_center_onstart: =1
Ptz_AUTO.patrol_interval, =0: no auto rotating
Ptz_AUTO.patrol_type: 0:no rotate
1:horizontal
2:vertical
3:horizontal + vertical |
| Ptz Patrol_h_round: | 0: Infinite |
| Ptz Patrol_v_round: | 0: Infinite |
| Ptz Patrol_rate: | 0-100, 0: the fastest |
| Ptz Patrol_up_rate: | 0-100, 0: the slowest |
| Ptz Patrol_down_rate | 0-100, 0: the slowest |
| Ptz Patrol_left_rate: | 0-100, 0: the slowest |
| Ptz Patrol_right_rate: | 0-100, 0: the slowest |
get_misc.cgi
| description | Obtain rotational Parameters of camera |
| Permission | Administrator |
| Syntax | /get_misc.cgi? |
| Parameters | See get_misc.cgi |
set Decoder.cgi
| description | Set the parameter for decoder |
| Permission | Administrator |
| Syntax | /set Decoder.cgi?baud=[&next_url=] |
| Parameters | Baud:9:B120011:B240012:B480013:B960014:B1920015:B384004097:B576004098:B115200 |