App-RPi-EnvUI

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

{
   "abstract" : "One-page asynchronous grow room environment control web application",
   "author" : [
      "Steve Bertrand <steveb@cpan.org>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

---
abstract: 'One-page asynchronous grow room environment control web application'
author:
  - 'Steve Bertrand <steveb@cpan.org>'
build_requires:
  ExtUtils::MakeMaker: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005'
license: perl
meta-spec:

README  view on Meta::CPAN

NAME

    App::RPi::EnvUI - One-page asynchronous grow room environment control
    web application

SYNOPSIS

        cd ~/envui
        sudo plackup bin/app.pl

    Now direct your browser at your Pi, on port 3000:

        http://raspberry.pi:3000

README  view on Meta::CPAN

    This is pretty much a singleton application, meaning that all web
    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

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

            override => $override,
        };
    };

true;

__END__

=head1 NAME

App::RPi::EnvUI - One-page asynchronous grow room environment control web
application

=head1 SYNOPSIS

    cd ~/envui
    sudo plackup bin/app.pl

Now direct your browser at your Pi, on port 3000:

    http://raspberry.pi:3000

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


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

    my $api = App::RPi::EnvUI::API->new;

    ... #FIXME: add a real example

=head1 DESCRIPTION

This class can be used outside of the L<App::RPi::EnvUI> web application to
update settings, read statuses, perform analysis and generate reports.

It's primary purpose is to act as an intermediary between the web app itself,
the asynchronous events that run within their own processes, the environment
sensors, and the application database.

=head1 METHODS

=head2 new(%args)

Instantiates a new core API object. Send any/all parameters in within hash
format (eg: C< testing =\> 1)).

Parameters:

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

Returns the string name of the temperature auxillary channel (default: C<aux1>).
Takes no parameters.

=head2 env_light_aux

Returns the string name of the light auxillary channel (default: C<aux3>).
Takes no parameters.

=head2 events

Initializes and starts the asynchronous timed events that operate in their own
processes, performing actions outside of the main thread.

Takes no parameters, has no return.

=head2 graph_data

Returns a hash reference with keys C<temp> and C<humidity>, where the values of
each are an array reference of array references with the inner arefs containing
the element number and the temp/humidity value.

lib/App/RPi/EnvUI/Configuration.pod  view on Meta::CPAN


Value: Integer, representing the interval (seconds) that the server will read
the current state of the system, and will enable/disable any functional GPIO
pins.

Default: C<3>

=head3 event_display_timer

Value: Integer, representing the interval (seconds) that the client UI will
automatically refresh the page (asynchronously).

Default: C<4>

=head3 time_zone

Value: A time zone as accepted by L<DateTime>'s C<new()> method's C<time_zone>
parameter.

Default: C<America/Edmonton> (MST)

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

        }
    );

    return $event;
}
1;
__END__

=head1 NAME

App::RPi::EnvUI::Event - Asynchronous events for the Perl portion of
L<App::RPi::EnvUI>

=head1 SYNOPSIS

    use App::RPi::EnvUI::API;
    use App::RPi::EnvUI::Event;

    my $api = App::RPi::EnvUI::API->new;
    my $events = App::RPi::EnvUI::Event->new;

    my $env_to_db_event  = $events->env_to_db;
    my $env_action_event = $events->env_action;

    $env_to_db_event->start;
    $env_action_event->start;

=head1 DESCRIPTION

This is a helper module for L<App::RPi::EnvUI>, which contains the scheduled
asynchronous Perl events on the server side of the webapp.

These events are objects of the L<Async::Event::Interval> class, and run in a
separate process than the rest of the application.

=head1 METHODS

=head2 new(%args)

Returns a new C<App::RPi::EnvUI::Event> object. The parameters are passed in
within a hash format.



( run in 0.965 second using v1.01-cache-2.11-cpan-0d8aa00de5b )