EnerGenie EG-PM2-LAN (Programmable, 6x Outlet Socket, LAN)
Review of Linux Compatibility
The EnerGenie EG-PM2-LAN is a programmable 6-times multiple socket outlet, which can be accessed via Ethernet. In contrast to the USB version there is no dedicated tool available for this LAN version. However, it is possible to send commands to the Web interface, which is embedded in the EG-PM2-LAN. In the following it is described how these commands can be sent via “curl”.
First, the web server needs a login with a password (“PASSWORD” is used in the following)
curl -sd 'pw=PASSWORD' http://EG-PM2-LAN-IP-Adress | fgrep -q Status
The return value should be “true”. As one can see, the password is sent unencrypted, which shows the low safety measures of the EG-PM2-LAN and could be a drawback for certain scenarios.
The integrated web server does not support sessions. Instead, after transmitting the password each process from the same IP address of this login can access the EG-PM2-LAN. Furthermore, all other IPs are blocked, while this login is still active. After some minutes of idling the login times out and a new login is necessary to access the web frontend.
Now, it is possible to switch via shell command one of the sockets (X = 1 … 4) on (Y=1) or off (Y=0). E.g., if socket 3 should be powered on, this is done by the command:
curl -sd 'cte3=1' http://EG-PM2-LAN-IP-Adresse | fgrep -q Status
or in general by
curl -sd 'cteX=Y' http://EG-PM2-LAN-IP-Adresse | fgrep -q Status
The logout is achieved by:
curl -s http://EG-PM2-LAN-IP-Adresse | fgrep -q password
Hardware specification: http://www.gembird.be/item.aspx?id=6668