Skip to content

trebb/p-rout

Repository files navigation

P-rout
======

P-rout may be useful for owners of one of the various types of a
solar energy appliance called PowerRouter, manufactured by Nedap
N.V.

The appliance is connected to the Internet and uploads data to an HTTP
server (logging1.powerrouter.com) that is owned by the manufacturer,
who provides another HTTP server where customers can view their data.

P-rout does basically the same while keeping everything on the owner's
premises.  It provides a data-collecting HTTP server where one or more
PowerRouters can upload.  Data is stored in a PostgreSQL database and
can be reviewed on a second HTTP server.

P-rout provides an optional raw data interface that can be accessed by
the home automation software FHEM (http://fhem.org).

The software is intended to be installed on a single-board computer
with two network interfaces.


Installation
============

If you are on Arch Linux, cd archlinux and follow the README there.

If not on Arch Linux and there is already a configure file, run as
usual

  ./configure && make && make install.

Otherwise, call

  autoreconf -vif

first which should create the configure file.


Configuration (on Arch Linux)
=============================

(1)  P-rout in its default configuration expects a local PostgreSQL
     database named 'p_rout' where user 'p-rout' (password 'p-rout')
     has administrative rights.

(2)  Connect your first network interface to your LAN. Configure it and
     find out its IP number. Make sure the IP number isn't allowed to
     change. (Let's suppose it's 192.168.178.1)

(3)  Connect the PowerRouter(s) to a dedicated (second) network
     interface and find out the name of the interface.  (Let's suppose
     it's called ens4v1.)

(4)  Use ./example/ens4v1_static as a template for
     /etc/netctl/ens4v1_static.  Edit the line that says

       Interface=ens4v1

     accordingly and rename the file to reflect the new interface name.
     Run

       netctl enable ens4v1_static,
       netctl start ens4v1_static.

(5)  Copy ./example/hosts over /etc/hosts.

(6)  Use ./example/dnsmasq.conf as a template for /etc/dnsmasq.conf.
     Edit the line that says

       interface=ens4v1

     accordingly.  Activate dnsmasq:

       systemctl enable dnsmasq,
       systemctl start dnsmasq.

(7)  In /usr/lib/systemd/system/p-rout-view.service edit the line that
     says

       ExecStart=/usr/bin/p-rout-view.scm

     into something like

       ExecStart=/usr/bin/p-rout-view.scm --addr=192.168.178.1

     or perhaps

       ExecStart=/usr/bin/p-rout-view.scm --addr=192.168.178.1 --port=8080

     using the IP from (2).  Call

       p-rout-view.scm --help

     to learn about other options.

(8)  Start P-rout services:

       systemctl enable p-rout-collect p-rout-view p-rout-dump.timer,
       systemctl start p-rout-collect p-rout-view p-rout-dump.timer.

(9)  (Optional) Change hostname: put a hostname of your choice into
     /etc/hostname; reboot.

(10) Point your browser to http://192.168.178.1/view.  Enjoy.

(11) (Optional) For FHEM users (home automation software,
     http://fhem.org)

     Find your fhem.cfg.  Using the IP from (2), add auto-generated
     configuration for accessing P-rout:

       p-rout-view.scm --addr=192.168.178.1 --fhem-cfg >> path/to/fhem.cfg


(12) You may want to copy dumps of p-rout's collected data to a safe
     place.  The dumps are created daily in /var/lib/p-rout/ and get
     deleted once they are older than 14 days.

(13) Restoring a database dump from an earlier instance of p-rout:

       p-rout-restore.scm <your-sql-dump>.gz.

     Stop p-rout-collect while doing this.

     Restoring a dump multiple times into the same database leaves you
     with multiple instances of every record.  To get rid of such
     duplicates, run

       p-rout-prune.scm.

     (No need to stop p-rout-collect here.)


Bugs
====

- After a restart of postgresql, both p-rout-collect and p-rout-view
  need to be restarted too.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published