CGI access
This section describes the Common Gateway Interface (CGI) available from the default or custom web pages. The web pages enable the user to send commands from the device to the network and request information from the network.
CGI uses Basic Authentication when calling GetDyNet.cgi or SetDyNet.cgi
Using credentials of an Ethernet Gateway configured user, the username and password are Base64 encoded and provided in the Authorization header of the HTTPS request.
headers:
{ 'Authorization': 'Basic ' + Base64.encode(username + ':' + password); }
| The default web interface is preloaded directly under the B:/WWW folder. |
The CGI has been modelled on the Dynalite Text protocol and Dynalite Tasking syntax. In these protocols many of the command parameters are optional, so if a parameter is not specified then the default value (or the value that was previously specified) for this parameter is used for subsequent CGI requests. Alternatively, you may explicitly specify a value for all parameters each time a command is executed.
-
If your default page is no longer index.htm, then you must change the option in Device Properties.
-
The filename WebPage.cgi is reserved for retrieving webpage data.
-
The filename SetDyNet.cgi is reserved for issuing DyNet commands.
-
The filename GetDyNet.cgi is reserved for retrieving DyNet status.
-
All files names are case sensitive on this device, following Unix and web standards.
-
The ? character is used to initialise a CGI string and the & char is used for delimiting.
Example: 192.168.2.2/SetDyNet.cgi?a=3&p=2
DyNet commands and status requests
Following table lists the HTTP/CGI requests available from the device.
Required parameters are shown in bold.
| Function | CGI request | Parameters | Value Required | Value Range | Description |
|---|---|---|---|---|---|
Preset |
P or PRESET |
A |
Yes |
0 to 65535 |
Also supports special presets: |
Channel Level |
L or LEVEL |
A |
Yes |
0 to 100 |
Channel level in percentage |
Colour Temperature |
CT |
A |
Yes |
0 to 65535 |
Colour temperature in Kelvin (2500-7000) |
Program/Save Preset |
PP or S |
L, A |
Yes |
0 to 255 |
Saves the current channel levels to the specified preset |
Start Task |
STT |
- |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Stop Task |
SPT |
- |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Pause Task |
PT |
- |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Enable Event |
EEVT |
- |
Yes |
0 to 255 |
0 = All Events |
Disable Event |
DEVT |
- |
Yes |
0 to 255 |
0 = All Events |
Trigger Event |
TEVT |
- |
Yes |
1 to 255 |
0 = All Events |
Read Task Port Value |
RPV |
- |
Yes |
0 to 255 |
SBP is optional for task sub-port number |
Write on Task Port |
WPV |
- |
Yes |
0 to 255 |
SBP is optional for task sub-port number |
Write on Sub-Task Port |
SBP |
RPV or WPV |
Yes |
0 to 255 |
|
Value to Write to Port |
V |
WPV |
Yes |
0 to 255 |
Specifies the value to write to task port. |
Nudge Up |
NU |
A |
Yes |
0 to 100 |
Channel level in percentage |
Nudge Down |
ND |
A |
Yes |
0 to 100 |
Channel level in percentage |
Ramp Level |
RL or RAMPLEVEL |
A |
Yes |
0 to 100 |
Channel level in percentage |
Stop Fade |
SF or STOPFADE |
A |
No |
||
Current Temperature |
TPTR or TEMPERATURE |
A |
No |
-64 to 64 |
Returned temperature shall be in +/- xx.yy format |
Temperature Setpoint |
TPSP or TEMPERATURESETPOINT |
A |
Set: Yes |
-64 to 64 |
Returned temperature is in +/- xx.yy format |
DALI Driver Runtime Status (See note) |
QBS |
DC, BN, C |
No |
Reply if CN not specified: 0: Lamp failure, driver offline |
|
Preset Offset |
O or OFFSET |
A |
Yes |
0 to 127 |
Set the preset offset for an area. |
Reply Timeout |
REPLYTIMEOUT |
- |
Set: Yes |
200 to 20000 |
This is the amount of time that device will wait for a any request message (when GetDyNet.cgi is used) to get back with a reply. If there is no reply after this time, device will reply with an error back to the client. |
Task Register X |
X |
- |
No |
0 to 255 |
|
Task Accumulator |
ACC |
- |
No |
0 to 255 |
|
Area |
A or AREA |
- |
Yes |
Area: 0 to 65535 |
If no area specified, request is processed for most recent area received and saved by the export. Otherwise channel level for requested area is returned without storing the requested area. |
Join |
J or JOIN |
- |
Yes |
0 to 255 |
|
Channel Number |
C or CHANNEL |
- |
Yes |
0 to 65535 |
|
Number of Physical Channels |
CN |
- |
Yes |
0 to 65535 |
|
Box Number |
BN |
- |
Yes |
0 to 255 |
|
Device Code |
DC |
- |
Yes |
0 to 255 |
|
Fade Time |
F or FADE |
- |
Yes |
0 to 5,242,710 ms |
|
'Get DALI driver runtime status' (QBS)
Example: 192.168.2.2/GetDyNet.cgi?DC=100&BN=13&C=23&CN=3&QBS The reply to this request would include the driver status for channels 23, 24, and 25. |
DyNet commands and status request examples
To control DyNet Areas, DyNet logical commands use the HTTP Set method with the SetDyNet.cgi file. DyNet logical status requests use the HTTP Get method with the GetDyNet.cgi file.
http://192.168.10.10/SetDyNet.cgi?a=3&p=2
This sets area 3 to preset 2. Multiple parameters may be used in the one request; however, only one of them should be of the command type. The response from this HTTP request automatically redirects the browser back to the calling page as detailed below:
<html><body onload=history.back()></body></html>
http://192.168.10.10/GetDyNet.cgi?a=3&p or http://192.168.10.10/GetDyNet.cgi?a=3
The response from this HTTP request contains the state retrieved from the DyNet area.
A single numeric value is returned indicating the current preset or channel level. If the logical entity does not exist a single full stop character "." is returned. If the response shown below is returned from the request, then area 3 is in preset 4:
p=4
http://192.168.10.10/SetDyNet.cgi?a=2&o=6
If the current preset is 4, the reply will be:
p=4 o=6
Reading the current setting:
http://192.168.10.10/GetDyNet.cgi?replytimeout
returns:
replytimeout=200
Now set it to a new value:
http://192.168.10.10/SetDyNet.cgi?replytimeout=2000
(this is typically for wireless devices that can have a very slow response times)
http://192.168.10.10/SetDyNet.cgi?a=2&c=3&j=255&l=25&pp=10
http://192.168.10.10/SetDyNet.cgi?a=2&c=3&j=255&l=25&f=5000
http://192.168.10.10/GetDyNet.cgi?a=2&c=3&j=255&p=4
http://192.168.10.10/GetDyNet.cgi?a=3&c=2&j=255&l
or
http://192.168.10.10/GetDyNet.cgi?a=3&c=2&j=255
returns:
l=23