RPi::SysInfo - Retrieve hardware system information from a Raspberry Pi
Fetch live-time and other system information from a Raspberry Pi.
Most functions will work equally as well on Unix/Linux systems.
# Object Oriented
my $sys = RPi::SysInfo->new;
use RPi::SysInfo qw(:all);
Functions are not exported by default. You can load them each by name:
...or use the :all tag to bring them all in at once.
Instantiates and returns a new RPi::SysInfo object.
Takes no parameters.
Returns the percentage of current CPU usage.
Return: Two decimal floating point number.
Returns the percentage of physical RAM currently in use.
Returns the core CPU temperature of the system.
Optional, String: By default we return the temperature in Celcius. Simply send in the letter f to get the result returned in Fahrenheit.
Return: Two decimal place floating point number.
Fetches the current configuration and status of one or many GPIO pins.
Optional, Aref of Integers: By default, we'll return the information for all GPIO pins on the system. Send in an aref of pin numbers and well fetch the data for only those pins (eg: gpio_info or gpio_info([2, 4, 6, 8])).
gpio_info([2, 4, 6, 8])
Return: Single string containing all of the data requested.
Feteches the directive names and values the Pi is configured with.
Return: String, the contents of the current configuration.
Fetches and returns various file system information as a string.
Fetches and returns the Pi's network configuration details as a string.
Fetches and returns various information about the Pi, including the OS info, along with several hardware platform details as a string.
Formats a float/double value to two decimal places.
Mandatory, Float/Double: The number to format.
Steve Bertrand, <steveb at cpan.org>
<steveb at cpan.org>
Copyright 2019 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install RPi::SysInfo, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.