working project, maybe

This commit is contained in:
2019-08-22 19:24:35 +02:00
parent 8689dd8c63
commit a454a4aac5
152 changed files with 43419 additions and 316 deletions

View File

@@ -0,0 +1,31 @@
.. Plutonium reporter documentation master file, created by
sphinx-quickstart on Wed Apr 3 15:53:15 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
==============================================
!
==============================================
.. toctree::
:maxdepth: 3
:caption: Contents:
Dynamic data
=====================
.. automodule:: modules.dynamic
:members:
Dynamic Weather
================
.. autoclass:: modules.dynamic.DynamicWeather
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

78
doc/build/html/_sources/index.rst.txt vendored Normal file
View File

@@ -0,0 +1,78 @@
.. Plutonium reporter documentation master file, created by
sphinx-quickstart on Wed Apr 3 15:53:15 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
==============================================
DOC: Plutonium reporter
==============================================
.. toctree::
:maxdepth: 3
:caption: Contents:
introduction
Scope
=====
This document covers the **software part** of the reporter, although it consists
of a multitude of hw technologies, please keep that in mind.
Purpose
========
Delivering aggregated and comprehensive representation of data-value pairs
in such a way, that even a complete idiot can read them. *This project is
created by AND for me.*
In short, this application spins up a web server and on its address plots and
displays values gathered from various sources.
An example granted: https://bastart.spoton.cz
Sources
--------
The sources for feeding the **Plutonium** include:
- Davis Vantage vue weather station (with a couple HW mods)
- Victron MPPT solar converter (Utilizing the Victron Direct RS232 protocol)
- CPU, MEM, DISK, (W)LAN statistics, plotted
- Custom ESP8266 data loggers
- Temp / Humidity + battery logging
- Current monitoring for LED lighting
Discrepancies and hardware dependencies
---------------------------------------
Obviously, all the monitoring cannot be done without proper HW equipment.
Although this server is primarily aimed at use on a Raspberry PI, it can be
installed on an old notebook, or similar, as the platform is Python3 and thus
independent of the OS.
Solar / MPPT
++++++++++++
- Victron MPPT solar charge controller (Bluesolar)
- RS232 -> USB or similar, to get the data to RasPi
Davis Vantage Vue
+++++++++++++++++
- Obviously the Davis Vantage Vue weather station
- The CC1101 / wireless version
- arduino mini / Uno @ 3.3V
- CC1101 receiver with a couple other components
RasPI statistics
++++++++++++++++
- Just the RasPI
ESP8266 stuff
+++++++++++++
- basically anything that can feed into the influxDB.
Indices and tables
===================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@@ -0,0 +1,134 @@
.. Plutonium reporter documentation master file, created by
sphinx-quickstart on Wed Apr 3 15:53:15 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Introduction to Plutonium
+++++++++++++++++++++++++
.. toctree::
:maxdepth: 5
:caption: Contents:
Directory structure
===================
Following structure is applied to this project. Some directories are
minified in this view on purpose.
::
.
├── chttpd.py
├── config
│   └── plutonium.ini
├── config.py
├── doc ... (documentation in sphinx)
├── index.py
├── localdeploy.sh
├── modules
│   ├── dynamic.py
│   ├── status.py
│   ├── temphumi.py
│   ├── voltage.py
│   └── weather.py
├── static
│   ├── css
│   │   ├── bootstrap.css
│   │   └── dygraph.css ...
│   ├── img
│   │   ├── battery_0.png ...
│   └── js
│   ├── solar_graph.js
│   ├── status_graph.js
│   ├── temphum_graph.js
│   └── weather_graph.js ...
├── templates
│   ├── footer.html
│   ├── header.html
│   ├── landing_page.html
│   ├── status_admin.html
│   ├── temphumi_admin.html
│   ├── top_menu.html
│   ├── voltage_admin.html
│   └── weather_admin.html
└── TODO.txt
CherryPy configuration (config.py)
==================================
Configuration is stored in a separate file statically, so each submodule can
load the same configuration. This should be variables, that are project-wide.
CherryPy configuration file (plutonium.ini)
-------------------------------------------
Configuration file, .ini style. Option = value. File resides in ./config
directory. It is read by confi.py and parsed into a dict(), available
throughout the project.
::
_server_protocol = https
_server_name = bastart.spoton.cz
_server_port = 80
_server_bind_ip = 0.0.0.0
_influx_host = localhost
_influx_port = 8086
_influx_user = pi
_influx_pwd = password
_influx_weather_db = weather_v2
_influx_status_db = status
_influx_voltage_db = voltage
_influx_IoT_db = weather_v2
Configuration classes and functions
------------------------------------
.. automodule:: config
:members:
CherryPy server (chttpd.py)
===========================
The server uses CherryPy module. For more information, please consult the
Cherrypy documentation.
CHTTPD.py is also the executable, that can be launched as a standalone
application by simply typing ./chttpd.py, or python3 chttpd.py
.. automodule:: chttpd
:members:
Modules and web paths
---------------------
Modules are located in the `modules` directory, hence the imports from a
subdirectory
::
from modules import voltage
from modules import weather
from modules import dynamic
from modules import status
from modules import temphumi
As can be seen, each class / module is mounted under a specific web path. This
is the preferred way of future expansion modules.
::
cherrypy.tree.mount(voltage.EnergyInfo(), "/", conf)
cherrypy.tree.mount(voltage.EnergyInfo(), "/energy", conf)
cherrypy.tree.mount(weather.WeatherInfo(), "/weather", conf)
cherrypy.tree.mount(status.StatusInfo(), "/status", conf)
cherrypy.tree.mount(dynamic.Expose(), "/data", conf)
cherrypy.tree.mount(temphumi.PuerhInfo(), "/temphumi", conf)
Index (index.py)
================
Reserved for future use. Currently not displayed, as the EnergyInfo() class is
mounted under root(/) of the web, defined in chttpd.py
::
cherrypy.tree.mount(voltage.EnergyInfo(), "/", conf)
.. automodule:: index
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`