SYNOPSIS
sispmctl -ssispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] -b <on|off>
sispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] < -o | -f | -t | -g | -m > <1..4|all>
sispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] < -a | -A > <1..4|all> [ --Aat '...' ] [ --Aafter ... ] [ --Ado <on|off> ] ... [ --Aloop ... ]
sispmctl [ -d 0... ] [ -D ... ] [ -i <ip> ] [ -p <#port> ] [ -u <path> ] -l
DESCRIPTION
sispmctl is a tool to switch the USB controlled outlets of Gembird Silver Shield PM. It is known by many names, e.g. Revolt Power Switch.It is coded in C and uses the usb specific library (LibUSB). This allows you a portable and fast solution.
OPTIONS
- -h
- print usage information
- -s
- scan for supported GEMBIRD devices
- -l
- daemonize and start to listening as a simple http webserver (default port: 2638)
- -p
- IP network port (default: 2638) for listener. There is no authentication implemented yet.
- -u
- give the directory path where pages lay, that are served (default: /usr/local/httpd/sispmctl). The Web path component is completely ignored for security reasons.
- -b
- switch the buzzer on and off
- -o
- switch the given outlet(s) to "ON"
- -f
- switch the given outlet(s) to "OFF"
- -t
- toggle the state of the given outlet(s)
- -g
- show the status of the given outlet(s)
- -m
- get power supply status for the given outlet(s)
- -d
- Use not the first but the given device in the sequence of detected devices, starting with "0" for the first device (see scan option)
- -D
- Same as -d, but choose by serial number (see scan option)
- -n
- do not print "ON" and "OFF", but "1" and "0" instead
- -q
- do neither print explanations nor disclaimers except it is requested
- -a
- get plannification for given outlet
- -A
-
set plannification for given outlet
--Aat "date" - sets an event time as a date '%Y-%m-%d %H:%M'
--Aafter N - sets an event time as N minutes after the previous one
--Ado <on|off> - sets the current event's action
--Aloop N - loops to 1st event's action after N minutes - -v
-
print version & copyright
WEB INTERFACE
The sispmctl program provides a web interface when started with the -l option. No additional http server is needed. Each selected usb device is blocked by sispmctl while running.
After installation, the first of two web-interfaces is selected. The default location of the HTML files is /usr/local/httpd/sispmctl/doc which is a symbolic link to /usr/local/httpd/sispmctl/skin1.
The http capabilities of sispmctl are limited. Technically speaking, only the first line of each http request is parsed. The terminating path component, i.e. file name, is looked up in the repository directory. If present the file is parsed and in absence of control sequences sent as is. The files must include the http header portion.
Control sequences start and end with double dollar `$$'. They consist of a command portion separated by a question mark `?' from alternative outputs which are separated by the first colon `:'. The command portion is a token followed by an embraced number that references the outlet, e.g. $$command(1)?positive:negative$$ while command is one of status, toggle, on or off. I strongly recommend to avoid the on/off/toggle commands in pages that may be reloaded. Best is to redirect to other pages that only include status requests.
PLANNIFICATIONS
The sispmctl program provides plannifications, plannifications can be used to turn given outlets of the device "ON" or "OFF" at or after a given time. Plannifications can also be set to loop after a given number of minutes.
To show the planned plannification for a given outlet use the option -a and specify the wanted outlet(s). The option -A plus any of the options --Aat , --Aafter , --Ado and --Aloop will create a new plannification for the given output. If only -A plus an outlet is called, the plannification for the outlet will be deleted.
EXAMPLES
Switch off the first outlet of the first SiS-PM and the third outlet of the second SiS-PM:sispmctl -f 1 -d 1 -f 3
Print the status of the forth outlet as zero or one:
sispmctl -nqg 4
Set a planification so outlet 2 on the first device gets turned "ON" on the given date and time:
sispmctl -A 2 --Aat '2011-07-27 20:45' --Ado on
Set a planification so outlet 3 on the second device gets turned "ON" after 2 minutes and "OFF" after another 10 minutes. The planification will loop after 1 hour:
sispmctl -d 1 -A 3 --Aafter 2 --Ado on --Aafter 10 --Ado off --Aloop 60
Run sispmctl on the second device as a web-server:
sispmctl -d 1 -l
You can connect to it from the same machine by pointing to http://localhost:2638 with your webbrowser
AUTHOR
First version by Mondrian Nuessle, [email protected]
Web integration and man page by Andreas Neuper, ANeuper-at-web-dot-de
Plannifications by Olivier Matheret