File: README

package info (click to toggle)
sispmctl 4.12-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,964 kB
  • sloc: sh: 4,602; ansic: 1,629; makefile: 77; xml: 28
file content (178 lines) | stat: -rw-r--r-- 5,543 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
SiS-PM Control for Linux
========================

(c) 2015-2023, Heinrich Schuchardt <xypron.glpk@gmx.de>
(c) 2011-2016, Pete Hildebrandt <send2ph@gmail.de>
(c) 2005-2011, Mondrian Nuessle et al.

Overview
--------

This project provides a management software for the following USB controlled
powerstrips:

* Gembird SIS-PMS SilverShield
* Gembird MSIS-PM
* EnerGenie EG-PM
* EnerGenie EG-PMS
* EnerGenie EG-PM2
* EnerGenie EG-PMS2

Installation
------------

The installation is done by issueing the following commands

    ./autogen.sh # only needed after checkout of the Git repository
    ./configure
    make
    sudo make install
    sudo ldconfig

See the file INSTALL for generic installation instructions.

The following configure options may be of interest:

* --prefix=directory-prefix
  Set installation directory-prefix (default is /usr/local)

* --enable-webless
  Disable the builtin webserver. It will not be compiled into
  the binary. The command line options for the web-interface will
  not be available.

* --with-webdir=directory
  Install the web-interface file to subdirectories of the
  given directory. A symbolic link in this directory will point
  to skin2. And the path will be the default path compiled into
  the binary.
  The default without this option is /usr/local/share/doc/sispmctl/skin.

* --with-bindaddr=ipaddress
  Give the IP address (in dotted decimal form, i.e. 127.0.0.1) for
  the default interface that the webserver accepts connections on.
  The default without this option is to use all available interfaces.

* --with-default-port=portnumber
  Give the default port number the webserver is listening on.
  If you do not specify this option, the default is 2638.

Dependencies
------------

- libusb 0.1.9+ must be installed; libusb-config must be in $PATH

Command Line Interface
----------------------

The command `sispmctl` can be used to

* show the status of one or all outputs
* switch on or off, or toggle an output
* program a schedule according to which outputs shall be switched on and off
* launch the web interface

You can display the man page with

    man sispmctl

Web-Interface
------------

The web interface may be started manually (i.e. `sispmctl -l`). The default
port is 2638.

The web interface does not recognize which device type is connected, so always
four outlets will be displayed.

The web server can be started automatically with systemd. This requires the
following steps:

Create user sispmctl in group sispmctl. The command on Debian and Ubuntu is

    adduser sispmctl --system --group --disabled-login --no-create-home

Provide the necessary authorizations via udev (see below).

    cp examples/60-sispmctl.rules /lib/udev/rules.d/60-sispmctl.rules
    udevadm control --reload-rules

Adjust and copy the systemd service definition

    cp examples/sispmctl.service /lib/systemd/system

Enable and start the service with

    systemctl enable sispmctl.service
    systemctl start sispmctl.service

The webserver supports basic authentication. To set the password create file
/etc/sispmctl/password. The first line must contain the colon separated and
base64 encoded user and password, e.g user:password is encoded as
dXNlcjpwYXNzd29yZA==. You can use the `base64` command for encoding. Enter
CRTL+D twice after entering user:password.

    mkdir /etc/sispmctl
    base64 > /etc/sispmctl/password
    chown sispmctl:sispmctl /etc/sispmctl/password
    chmod 400 /etc/sispmctl/password

Or just use the bash script examples/passwordsetup.sh.

There are multiple skins between you might select:

* src/web1/ - a classic skin
* src/web2/ - a dark skin suitable for mobiles
* src/web3/ - a light skin suitable for mobiles

The skins are installed under
$(PREFIX)/share/doc/sispmctl/httpd/skin1..3

The default skin is selected by the symbolic link
$(PREFIX)/share/doc/sispmctl/skin which points to skin2 after
installation. You can easily select a different skin by passing the directory
with parameter -u to `sispmctl` in the service definition.

It is quite easy to change one or write a new one. Try it.

Permissions
-----------

Per default, only root is allowed to use devices directly, therefore the SiS-PM
also only works as root.

To allow group sispmctl access create file /lib/udev/rules.d/60-sispmctl.rules
with the following content

    SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="fd10", GROUP="sispmctl", MODE="660"
    SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="fd11", GROUP="sispmctl", MODE="660"
    SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="fd12", GROUP="sispmctl", MODE="660"
    SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="fd13", GROUP="sispmctl", MODE="660"
    SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="fd15", GROUP="sispmctl", MODE="660"

Then reload the udev rules with

    udevadm control --reload-rules

Solaris Support
---------------

Solaris 10 and later come with sufficient libusb support; the ugen (generic USB)
driver needs to be associated with the SIS-PM devices by issueing the following
command before plugging in the device:

    for SIS-PM:
	update_drv -a -i '"usb4b4,fd11"' ugen
    for mSIS-PM:
	update_drv -a -i '"usb4b4,fd10"' ugen
	update_drv -a -i '"usb4b4,fd12"' ugen
    for energenie:
	update_drv -a -i '"usb4b4,fd13"' ugen
    for EG-PMS2:
	update_drv -a -i '"usb4b4,fd15"' ugen

License
-------

SiS-PM Control for Linux is published under the GNU Public License Version 2 or
(at your option) any later version.