The remote configuration API (Application Programming Interface) http://192.168.171.236/admin/remoteconfig
provides the methods used for remotely changing configuration parameters directly on the camera.
The camera's HTTP interface processes commands and configuration parameters in an HTTP POST request as in the following example:
POST /admin/remoteconfig HTTP/1.0 Content-type: application/x-www-form-urlencoded Authorization: Basic YWRtaW46bWVpbnNt Content-length: 87 helo view section audio write params audio/MICRO=1 view section audio update store quit
Part |
Description |
---|---|
POST /admin/remoteconfig HTTP/1.0 Content-type: application/x-www-form-urlencoded Authorization: Basic YWRtaW46bWVpbnNt Content-length: 87 |
Header of the HTTP POST Request. |
|
Empty line; separates the request's header from its content. |
helo
|
Beginning of the command sequence. |
view section audio write params audio/MICRO=1 view section audio update store |
Command sequence with specific commands, as described in the Commands of the Remote Configuration API section. |
quit
|
End of the command sequence. |
Make sure to close the command sequence with a blank and a line break at the end.
The content type (Content-type: application/x-www-form-urlencoded
) does not need to be specified, but it is expected by the camera's web server.
The web server handles authentication (in this case, Basic
authentication is used). User name and password are concatenated by a colon (":") and Base64-encoded. See the line above
for the "admin:meinsm
" user name and password.
The length of the content (Content-length
) is the length of the entire data that follows the blank line after the header.
The content of the request itself is processed line by line.
Note that you need to URL-encode special characters in the parameters, as described in the Command Conventions section of the The HTTP API help page.
This example is discussed in detail in Output of the Remote Configuration API using the cURL
command line application.
You can use the commands as shown in the following syntax samples:
Simple command:
<command>
Command with keyword, separated by spaces:
<command> <keyword>
Command with parameters, separated by spaces:
<command> <parameter1> <parameter2>
Command keyword and one or more parameters, separated by spaces:
<command> <keyword> <parameter1> <parameter2>
Command |
Description |
||||||||
---|---|---|---|---|---|---|---|---|---|
|
Resets the entire camera configuration or individual sections thereof to the factory default values.
|
||||||||
|
Restores the configuration from the copy in Flash storage.
|
||||||||
|
Deletes the entire configuration, specific sections or individual parameters.
|
||||||||
|
Writes entire sections or − when used with the
|
||||||||
|
Appends data to configuration sections. The parameters to append to a section are specified line by line between SECTION <section name> Parameter=<value> Parameter=<value> ENDSECTION <section name> |
||||||||
|
Returns (shows) the entire configuration or specific sections.
|
||||||||
|
Permanently stores the configuration in the camera's Flash memory. |
||||||||
|
Reboots the camera. |
||||||||
|
Applies all changes to the configuration that can be activated without rebooting the camera.
|
||||||||
|
Returns one line with the name of the current configuration profile. This line is empty, if no profile is active. |
||||||||
|
Activates the configuration profile specified as parameter: activate_profile <profile name> |
||||||||
|
Returns all changed configuration sections, which require a reboot before they can be applied. This line is empty, if no change requires a reboot. NoteAfter changing the entire configuration (using |
||||||||
|
Identical meaning. Both commands end the preceding command and close the API command sequence. Note that you can only use one of these two commands in a command sequence. |
||||||||
|
Returns a list of available commands (see Returning a List of Commands Using |
The results consist of the data returned by the executed command.
Informational output starts with "#
" and documents the progress while processing the commands.
Error messages start with "ERROR:
", followed by a description of the error that occurred.
Commands without results data (reset
, store
, etc.) do not have any output.
If no errors have occurred, the camera acknowledges this by returning "OK
" before closing.
This example demonstrates how to activate the microphone using an HTTP request. For easily testing the remote configuration
API, the cURL
command line tool (http://curl.haxx.se/download.html) can be downloaded for Windows. It is automatically installed on Mac OS X and most Linux computers.
Using cURL
allows quickly and easily testing the commands, since this tool handles the communication with the camera. For example, cURL
automatically sends the correct header and calculates the length of the command sequence.
Commands |
Description |
---|---|
helo view section audio write params audio/MICRO=1 view section audio update store quit |
# Beginning of the command sequence. # Output the |
Open a command shell (Windows) or a terminal (Mac OS X, Linux).
Enter the following command line and replace <user name>
, <password>
and <IP address>
by the actual data of your camera:
curl -q -v -u "<user name>:<password>" --data-binary @- "http://<IP address>/admin/remoteconfig"
Press the [Return] key; cURL
is now waiting for commands.
Copy the text block from the left column of the last table from helo
to quit
.
Copy the contents of the clipboard to the command shell or terminal.
Press the [Ctrl+D] key combination twice (Windows, Linux) or once (Mac OS X) to send the command sequence to the camera.
<user name>: admin
<password>: meinsm
<IP address>: 10.8.0.118
* About to connect() to 10.8.0.118 port 80 (#0) * Trying 10.8.0.118... connected * Connected to 10.8.0.118 port 80 (#0) * Server auth using Basic with user 'admin' > POST /admin/remoteconfig HTTP/1.1 > Authorization: Basic YWRtaW46bWVpbnNt > User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18 > Host: 10.8.0.118 > Accept: */* > Content-Length: 87 > Content-Type: application/x-www-form-urlencoded > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: text/plain; charset=utf-8 < Cache-Control: no-cache < #read:helo: #read:view section audio: #exec cmd=view section audio SECTION audio SPEAKER=1 MICRO=0 PREAMPLIFIER=2 SPEAKERLEVEL=0 ENDSECTION audio #read:write params: #exec cmd=write params #read:view section audio: #exec cmd=view section audio SECTION audio SPEAKER=1 MICRO=1 PREAMPLIFIER=2 SPEAKERLEVEL=0 ENDSECTION audio #read:update: #exec cmd=update #updating daemons! #read:store: #exec cmd=store #Storing to flash... #read:quit: OK #bye * Closing connection #0
Output beginning with a "*
", "<
" or ">
" character is generated by cURL
. In the output, ">
" precedes the commands sent to the camera, while "<
" precedes the messages returned by the camera's web server. The remaining lines are returned by the remote configuration
API, as described in the Output of the Remote Configuration API section.
help
Commands |
Description |
---|---|
helo help quit |
# Beginning of the command sequence. # Call the help of the Remote Configuration API # End of the command sequence. |
Open a command shell (Windows) or a terminal (Mac OS X, Linux).
Enter the following command line and replace <user name>
, <password>
and <IP address>
by the actual data of your camera:
curl -q -v -u "<user name>:<password>" --data-binary @- "http://<IP address>/admin/remoteconfig"
Press the [Return] key; cURL
is now waiting for commands.
Copy the text block from the left column of the last table from helo
to quit
.
Copy the contents of the clipboard to the command shell or terminal.
Press the [Ctrl+D] key combination twice to send the command sequence to the camera.
<user name>: admin
<password>: meinsm
<IP address>: 10.8.0.118
* About to connect() to 10.8.0.118 port 80 (#0) * Trying 10.8.0.118... connected * Connected to 10.8.0.118 port 80 (#0) * Server auth using Basic with user 'admin' > POST /admin/remoteconfig HTTP/1.1 > Authorization: Basic YWRtaW46bWVpbnNt > User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18 > Host: 10.8.0.118 > Accept: */* > Content-Length: 87 > Content-Type: application/x-www-form-urlencoded > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: text/plain; charset=utf-8 < Cache-Control: no-cache < #read:helo: #read:help: The following commands are currently implemented: append reboot_needed view reboot write profile restore activate_profile reset update delete store exit quit help #read:quit: OK #bye * Closing connection #0
Output beginning with a "*
", "<
" or ">
" character is generated by cURL
. In the output, ">
" precedes the commands sent to the camera, while "<
" precedes the messages returned by the camera's web server. The remaining lines are returned by the remote configuration
API, as described in the Output of the Remote Configuration API section.
write
The ipnotifyaddress
target address of the network message profile ip0
in the ipnotify
configuration section is to be changed from 10.0.0.42:8000
to 10.11.12.13:6750
.
Make sure that you always need to write the entire profile line. It is not possible to change individual values within a profile.
Commands |
Description |
---|---|
helo view section ipnotify write params ipnotify/ip0/profile=ip0:_profilename=MxCC-Alarm :preset=mxpeg_alarm:ackn_time=60 :ipnotifyaddress=10.11.12.13%3A6750 :send=on_error:protocol=raw :boundary=--next-image--:httppath=:httpauth= :data=msg:ipnotifymessage=Hello World! :filetype=mxg:rate100=100:antetime=1 :posttime=1:systime=1440:ipnotifyport=0 view section ipnotify update store quit |
# Beginning of the command sequence. # Output the |
Open a command shell (Windows) or a terminal (Mac OS X, Linux).
Enter the following command line and replace <user name>
, <password>
and <IP address>
by the actual data of your camera:
curl -q -v -u "<user name>:<password>" --data-binary @- "http://<IP address>/admin/remoteconfig"
Press the [Return] key; cURL
is now waiting for commands.
Copy the text block from the left column of the last table from helo
to quit
.
Copy the contents of the clipboard to the command shell or terminal.
Press the [Ctrl+D] key combination twice to send the command sequence to the camera.
<user name>: admin
<password>: meinsm
<IP address>: 10.8.0.118
* About to connect() to 10.8.0.118 port 80 (#0) * Trying 10.8.0.118... connected * Connected to 10.8.0.118 port 80 (#0) * Server auth using Basic with user 'admin' > POST /admin/remoteconfig HTTP/1.1 > Authorization: Basic YWRtaW46bWVpbnNt > User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18 > Host: 10.8.0.118 > Accept: */* > Content-Length: 87 > Content-Type: application/x-www-form-urlencoded > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: text/plain; charset=utf-8 < Cache-Control: no-cache < #read:helo: #read:view section ipnotify: #exec cmd=view section ipnotify SECTION ipnotify ipnotify/ip0/profile=ip0:_profilename=MxCC-Alarm :preset=mxpeg_alarm:ackn_time=60 :ipnotifyaddress=10.0.0.42%3A8000 :send=on_error:protocol=raw :boundary=--next-image--:httppath=:httpauth= :data=msg:ipnotifymessage=Hello World! :filetype=mxg:rate100=100:antetime=1 :posttime=1:systime=1440:ipnotifyport=0 ... ENDSECTION ipnotify #read:write params: #exec cmd=write params #read:view section ipnotify: #exec cmd=view section ipnotify SECTION ipnotify ipnotify/ip0/profile=ip0:_profilename=MxCC-Alarm :preset=mxpeg_alarm:ackn_time=60 :ipnotifyaddress= 10.11.12.13%3A6750 :send=on_error:protocol=raw :boundary=--next-image--:httppath=:httpauth= :data=msg:ipnotifymessage=Hello World! :filetype=mxg:rate100=100:antetime=1 :posttime=1:systime=1440:ipnotifyport=0 ... ENDSECTION ipnotify #read:update: #exec cmd=update #updating daemons! #read:store: #exec cmd=store #Storing to flash... #read:quit: OK #bye * Closing connection 0
Output beginning with a "*
", "<
" or ">
" character is generated by cURL
. In the output, ">
" precedes the commands sent to the camera, while "<
" precedes the messages returned by the camera's web server. The remaining lines are returned by the remote configuration
API, as described in the Output of the Remote Configuration API section.