App-RPi-EnvUI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

          tests)
        - updated API::_bool() to allow the $bool param to be both true/false
          and 1/0, as we do call it in both of those contexts, so we don't
          have to translate the param in code before sending it in
        - added new t/226 test for fully testing the set_aux_override route
        - fix issue where when API::switch() was called, we were setting the
          physical pin state even when the state hadn't changed (fixes #52)
        - fix issue where the log_file directive in the config had no effect,
          rendering an empty log file (fixes #56)

0.29    2017-10-24
        - this project is still in BETA status and should not be used in a
          production growing environment without extreme monitoring
        - added DB::delete(), which will remove all data from a table
        - stats DB table is now emptied on webapp load. This will make graphing
          easier (avoid gaps where the app was down)
        - added new stats template and stats.js logic, Statistics in the menu
          load this template for the statistical graphs for temperature and
          humidity
        - the various templates now have a div id, so that we can combine all of
          our javascript/jquery into a single file

Changes  view on Meta::CPAN

        - if 'stats' table is empty on first API::env() call, we now return an
          href where the temp and hum are both -1 (added tests as well)
        - fixed an issue where the DB::new() connect() call wasn't able to be
          tested thoroughly (thanks 'NetWallah' from Perlmonks:
          http://perlmonks.org/?node_id=1173884
        - added a check to ensure we found the config file ok in API
        - added initial user authentication implementation (outside of normal
          run modes for now)
        - added session support (JSON files at this time)

0.24    2016-10-11
        - all modules now have initial draft POD
        - separated out setting/fetching API variables from $self->{} to
          $self->method()
        - migrated the API initialization tasks out of new() and into a new
          _init() method
        - all subs in API now alphabetical in public/private sections
        - logging is now configurable via method calls
        - new db() method, sets/gets the db object
        - new testing() method, sets/gets testing
        - replaced all die() calls in API to confess(), makes it much easier to

README  view on Meta::CPAN

    on a Raspberry Pi with wiringPi <http://wiringpi.com> installed. We
    also require sudo to run the webapp, due to limitations in other
    software I rely upon, but I've got fixes in the works to eliminate the
    sudo requirement.

    This distribution reads environmental sensors, turns on/off devices
    based on specific thresholds, contains an adjustable grow light timer,
    as well as feeding timers.

    The software connects to Raspberry Pi GPIO pins for each "auxillary",
    and at specific times or thresholds, turns on and or off the 120/240v
    devices that you've relayed to that voltage (if you choose to use this
    functionality).

    Whether or not you connect/use the automation functionality, the web UI
    is a one-page app that relies on jQuery/Javascript to pull updates from
    the server, push changes to the server, and display up-to-date live
    information relating to all functionality.

    Buttons are present to manually override devices (turn on/off) outside
    of their schedule or whether they've hit thresholds or not. Devices

README  view on Meta::CPAN

    browsers open to the app's UI page will render updates at the same
    time, regardless if another browser or the automation makes any
    changes.

WHAT IT DOES

    Reads temperature and humidity data via a hygrometer sensor through the
    RPi::DHT11 distribution.

    It then allows, through a one-page asynchronous web UI to turn on and
    off 120/240v devices through buttons, timers and reached threshold
    limits.

    For example. We have a max temperature limit of 80F. We assign an
    auxillary (GPIO pin) that is connected to a relay to a 120v exhaust
    fan. Through the configuration file, we load the temp limit, and if the
    temp goes above it, we enable the fan via the GPIO pin.

    To prevent the fan from going on/off repeatedly if the temp hovers at
    the limit, a minimum "on time" is also set, so by default, if the fan
    turns on, it'll stay on for 30 minutes, no matter if the temp drops

lib/App/RPi/EnvUI.pm  view on Meta::CPAN


A self-contained, one-page web application that runs on a Raspberry Pi and
monitors and manages an indoor grow room environment, with an API that can be
used external to the web app itself.

This distribution reads environmental sensors, turns on/off devices based on
specific thresholds, contains an adjustable grow light timer, and five extra
auxillary channels that you can configure for your own use.

The software connects to Raspberry Pi GPIO pins for each C<"auxillary">, and at
specific times or thresholds, turns on and or off the 120/240v devices that
you've relayed to that voltage (if you choose to use this functionality).

=head1 WHAT IT DOES

Reads temperature and humidity data via a hygrometer sensor through the
L<RPi::DHT11> distribution.

It then allows, through a one-page asynchronous web UI to turn on and off
120/240v devices through buttons, timers and reached threshold limits.

For example. We have a max temperature limit of 80F. We assign an auxillary
(GPIO pin) that is connected to a relay to a 120v exhaust fan. Through the
configuration file, we load the temp limit, and if the temp goes above it, we
enable the fan via the GPIO pin.

To prevent the fan from going on/off repeatedly if the temp hovers at the limit,
a minimum "on time" is also set, so by default, if the fan turns on, it'll stay
on for 30 minutes, no matter if the temp drops back below the limit.

lib/App/RPi/EnvUI/API.pm  view on Meta::CPAN

}
sub graph_data {
    my ($self) = @_;

    my $graph_data = $self->db->graph_data;

    my $check = 1;
    my $count = 0;
    my %data;

    my $need = 5760 - @$graph_data; # approx 4 per min, for 24 hours (4*60*24)

    for (@$graph_data) {

        # we need to pad out to get to 24 hours worth of valid data

        if ($need){
            my $last_t = $_->[2];
            my $last_h = $_->[3];
            while($need){
                push @{ $data{temp} }, [ $count, $last_t ];



( run in 0.486 second using v1.01-cache-2.11-cpan-7add2cbd662 )