Power::Outlet::iBoot - Control and query a Dataprobe iBoot power outlet
my $outlet=Power::Outlet::iBoot->new( host => "mylamp", port => 80, #sane default from manufacture spec auth => "PASS", #sane default from manufacture spec ); print $outlet->query, "\n"; print $outlet->on, "\n"; print $outlet->off, "\n";
Power::Outlet::iBoot is a package for controlling and querying a Dataprobe iBoot network attached power outlet.
iBoot Protocol: The iBoot uses the TCP (Transport Communication Protocol) to communicate with the client system. To communicate with iBoot, establish a TCP connection using the Port as assigned in iBoot Setup. Once connected use the Send() function to send the commands to the iBoot and the Recv() function to receive the response. After sending a response iBoot will close the connection. The following outlines the commands and their responses.
Source: http://dataprobe.com/files/power/iboot_tcp.pdf
use Power::Outlet::iBoot; use DateTime; my $lamp=Power::Outlet::iBoot->new(host=>"lamp"); my $hour=DateTime->now->hour; my $night=$hour > 20 ? 1 : $hour < 06 ? 1 : 0; if ($night) { print $lamp->on, "\n"; } else { print $lamp->off, "\n"; }
my $outlet=Power::Outlet->new(type=>"iBoot", "host=>"mylamp"); my $outlet=Power::Outlet::iBoot->new(host=>"mylamp");
Sets and returns the hostname or IP address.
Manufacturer Default: 192.168.1.254
Sets and returns the TCP port
Manufacturer Default: 80
Sets and returns the case sensitive password
Manufacturer Default: PASS
Sends a TCP/IP message to the iBoot device to query the current state
Sends a TCP/IP message to the iBoot device to Turn Power ON
Sends a TCP/IP message to the iBoot device to Turn Power OFF
Queries the device for the current status and then requests the opposite.
Sends a TCP/IP message to the iBoot device to Cycle Power (ON-OFF-ON or OFF-ON-OFF). Cycle time is determined by Setup.
Manufacturer Default Cycle Period: 10 seconds
Please log on RT and send an email to the author.
DavisNetworks.com supports all Perl applications including this package.
Michael R. Davis CPAN ID: MRDVT DavisNetworks.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Power::Outlet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Power::Outlet
CPAN shell
perl -MCPAN -e shell install Power::Outlet
For more information on module installation, please visit the detailed CPAN module installation guide.