diff --git a/python/davis_etl.py b/python/davis_etl.py index a42f2a5..4b72673 100755 --- a/python/davis_etl.py +++ b/python/davis_etl.py @@ -25,6 +25,7 @@ import datetime import serial import simplejson as json import influxdb +import configparser # optionally, future modules, locally available, I hate dependencies from pprint import pprint @@ -40,6 +41,9 @@ sys.path.append(_SCRIPT_PATH + "/lib") Define variables -------------------------------------------------------------------------------- ''' +config = configparser.ConfigParser() +config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini") + _VERSION = 2.0 _NAME = u"Vantage Vue Decoding shite" _LOG_DIR = _SCRIPT_PATH + '/log/' @@ -64,12 +68,13 @@ rain = 0 influx_status_write = [] influx_weather_write = [] -influx_host = 'localhost' -influx_port = 8086 -influx_user = 'pi' -influx_pwd = 'Ventil6996' -weather_db = 'weather_v2' -status_db = 'status' +influx_host = config['InfluxDB']['_influx_host'] +influx_port = config['InfluxDB']['_influx_port'] +influx_user = config['InfluxDB']['_influx_user'] +influx_pwd = config['InfluxDB']['_influx_pwd'] +weather_db = config['InfluxDB']['_influx_weather_db'] +status_db = config['InfluxDB']['_influx_status_db'] + ''' -------------------------------------------------------------------------------- diff --git a/python/enriched_data_collect.py b/python/enriched_data_collect.py index ffc12e0..bf8648e 100644 --- a/python/enriched_data_collect.py +++ b/python/enriched_data_collect.py @@ -37,6 +37,8 @@ import datetime import serial import simplejson as json import influxdb +import configparser + # optionally, future modules, locally available, I hate dependencies from pprint import pprint @@ -51,6 +53,9 @@ sys.path.append(_SCRIPT_PATH + "/lib") Define variables -------------------------------------------------------------------------------- ''' +config = configparser.ConfigParser() +config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini") + _VERSION = 1.0 _NAME = u"Vantage Vue external measure enrichment" _LOG_DIR = _SCRIPT_PATH + '/log/' @@ -67,11 +72,12 @@ pressure_adjusted = 0 influx_weather_write = [] -influx_host = 'localhost' -influx_port = 8086 -influx_user = 'pi' -influx_pwd = 'Ventil6996' -weather_db = 'weather_v2' +influx_host = config['InfluxDB']['_influx_host'] +influx_port = config['InfluxDB']['_influx_port'] +influx_user = config['InfluxDB']['_influx_user'] +influx_pwd = config['InfluxDB']['_influx_pwd'] +weather_db = config['InfluxDB']['_influx_weather_db'] +status_db = config['InfluxDB']['_influx_status_db'] ''' -------------------------------------------------------------------------------- diff --git a/python/sysstats.py b/python/sysstats.py index e67318e..651a2f0 100644 --- a/python/sysstats.py +++ b/python/sysstats.py @@ -24,6 +24,7 @@ import simplejson as json import influxdb import psutil import socket +import configparser # optionally, future modules, locally available, I hate dependencies from pprint import pprint @@ -40,8 +41,11 @@ _hostname = socket.gethostname() Define variables -------------------------------------------------------------------------------- ''' +config = configparser.ConfigParser() +config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini") + _VERSION = 2.0 -_NAME = u"Vantage Vue Decoding shite" +_NAME = u"System statistics for RasPi" _LOG_DIR = _SCRIPT_PATH + '/log/' _LOG_FILE_ROOT = re.sub(u'./', '', sys.argv[0]) _LOG_FILE = _LOG_DIR + _LOG_FILE_ROOT + u'.log' @@ -49,11 +53,12 @@ _DEBUG_FILE = _LOG_DIR + _LOG_FILE_ROOT + u'.dbg' influx_status_write = [] -influx_host = 'localhost' -influx_port = 8086 -influx_user = 'pi' -influx_pwd = 'Ventil6996' -status_db = 'status' +influx_host = config['InfluxDB']['_influx_host'] +influx_port = config['InfluxDB']['_influx_port'] +influx_user = config['InfluxDB']['_influx_user'] +influx_pwd = config['InfluxDB']['_influx_pwd'] +status_db = config['InfluxDB']['_influx_status_db'] + ''' -------------------------------------------------------------------------------- diff --git a/web/chttpd.py b/web/chttpd.py index ee303a9..e218e95 100755 --- a/web/chttpd.py +++ b/web/chttpd.py @@ -48,7 +48,7 @@ def main_server_loop(): } } - cherrypy.tree.mount(voltage.EnergyInfo(), "/", conf) + cherrypy.tree.mount(index.landingPage(), "/", conf) cherrypy.tree.mount(voltage.EnergyInfo(), "/energy", conf) cherrypy.tree.mount(weather.WeatherInfo(), "/weather", conf) cherrypy.tree.mount(status.StatusInfo(), "/status", conf) diff --git a/web/config/plutonium.ini b/web/config/plutonium.ini index 2ff0ebc..a590a22 100644 --- a/web/config/plutonium.ini +++ b/web/config/plutonium.ini @@ -1,11 +1,14 @@ +[General] _server_protocol = https _server_name = bastart.spoton.cz _server_port = 443 _server_bind_ip = 0.0.0.0 + +[InfluxDB] _influx_host = localhost _influx_port = 8086 _influx_user = pi -_influx_pwd = Ventil +_influx_pwd = Ventil6996 _influx_weather_db = weather_v2 _influx_status_db = status _influx_voltage_db = voltage diff --git a/web/templates/landing_page.html b/web/templates/landing_page.html index 3985b47..17ff57e 100644 --- a/web/templates/landing_page.html +++ b/web/templates/landing_page.html @@ -4,19 +4,25 @@

Plutonium monitoring

-
Keeping an eye on things
+
Keeping an eye on things, since 11/2017
-
+
- Not available, due to RasPi gone crazy from all that traffic -
-
- But is surely was beautiful. +

The whole idea of this is a RasPi based monitoring of

+
    +
  • Base RasPi metrics
  • +
  • Victron based solar MPPT trackers (optional module)
  • +
  • Davis Vantage Vue (optional module)
  • +
  • Any other IoT stuff (optional)
  • +
+

Feel free to explore the tabs in the upper menu

+

For additional information, look at + Git for this project

- + Cheers.
diff --git a/web/templates/top_menu.html b/web/templates/top_menu.html index 5b25a8a..5459a41 100644 --- a/web/templates/top_menu.html +++ b/web/templates/top_menu.html @@ -7,7 +7,7 @@