12
RF11iQP Warranty and User Manual
Given that the device has a HTML interface which displays status and provides a user interface
for this cpan.cgi command interface, the URL is not especially useful on its own. When, however, it
is combined with the cURL utility (available for Linux, Mac and Windows) it means that any of these
functions on the unit may be operated from the command line on any application.
NOTE: These methods all rely on the IP address remaining valid. It is recommended that you
either configure your RF11iQP with a static IP address or assign it a permanent lease in the
DHCP server if these scripting methods will be used long term, as by default the DHCP server
may change the assigned IP address periodically with lease renewals.
The syntax required for using cURL in this manner is as follows:
curl --user admin:<pass> “http://<address>/cpan.
cgi?param=<p>&value=<v>”
<address>, <p> and <v> are the same as above.
<pass> is your currently configured admin password for the unit.
Make sure you wrap the url in double quotes.
cURL is a built-in command on Linux, BSD and the Mac. There are several implementations
available for Windows and a simple search will reveal them.
Once this is configured, you can use other applications or utilities to drive (for example) the
outputs of the RF11 units based on a schedule or other network management alarms and so on.
A classic example – some devices may only be required during the day. By using the task
scheduler (Windows), cron (linux/BSD) or launchd (Mac) you can power up your rack in the morning
and shut it down in the evening to conserve power.
NOTE: Obviously, you will need to ensure that the appropriate shut-down of any equipment
powered off the controlled circuit has been performed or that the equipment is tolerant of
repetitive, unexpected power outages before using this procedure.
Linux Example
From a terminal type:
export EDITOR=<editor>
<editor> could be vi, nano, whatever your favourite text editor is.
sudo crontab -e
You’ll need to enter your password, and be an admin on the machine. Add the following lines:
0 9 * * 1-5 curl --user admin:THORRF11 “http://10.1.1.58/cpan.
cgi?param=p1&value=0”
0 17 * * 1-5 curl --user admin:THORRF11 “http://10.1.1.58/cpan.
cgi?param=p1&value=1”
Save and exit.
Now, at 0 minutes past 9am, every day of the month and every month, on days of week 1-5
(Monday to Friday), the output of circuit 1 will be switched on. Similarly, at 5pm on these days it will
be powered down.