Skip to content

Latest commit

History

History
134 lines (114 loc) · 6.06 KB

File metadata and controls

134 lines (114 loc) · 6.06 KB

EmonCMS file system

EMONCMS_WWW/var/www/emoncmslocation of the core package and of the main modules (admin, dashboards, config)
EMONCMS_DATADIR/var/opt/emoncmstimeseries database directories
EMONCMS_DIR/opt/emoncmslocation of symlinked modules (postprocess, sync) and of uploaded tar.gz archives when importing a backup
OPENENERGYMONITOR_DIR/opt/openenergymonitorlocation of EmonScripts, emonhub and of created backup archives
EMONCMS_LOG_LOCATION/var/log/emoncmslog location for emoncms logs
emoncms.log is main emoncms log, managed with the EmonLogger PHP class

main dependencies

web serverApache2
relational databasesmysql or maria
key:value databaseredis-serverdata buffering for timeseries and backgroud processing for service-runner
message brokermosquitto
data engine languagephp with extensionspear (for pecl needs)
mysql
gd dev, common
mbstring
redis
mosquitto (https://github.com/mgdm/Mosquitto-PHP)
curl

EmonCMS systemd services

all systemd services have to be symlinked in /etc/systemd/system

emoncms_mqtt.service -> /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.service
emonhub.service -> /opt/openenergymonitor/emonhub/service/emonhub.service
feedwriter.service -> /var/www/emoncms/scripts/services/feedwriter/feedwriter.service
service-runner.service -> /var/www/emoncms/scripts/services/service-runner/service-runner.service

MariaDB and Redis services are in lib/systemd/system, but they are compiled...

mysqld.service -> /lib/systemd/system/mariadb.service
mysql.service -> /lib/systemd/system/mariadb.service
redis.service -> /lib/systemd/system/redis-server.service
phpmqtt input (PHP)listen to payloads published to the mosquitto broker on topic emon
scriptpathEMONCMS_WWW/scripts/services/emoncms_mqtt/emoncms_mqtt.php
ServicepathEMONCMS_WWW/scripts/services/emoncms_mqtt/emoncms_mqtt.service
globals$log , $mysqli, $redis, $user, $feed_settings, $mqtt_server $mqttsettings, $mqtt_client,
$feed, $input, $process
non globals$connected, $subscribed, $last_retry, $last_heartbeat, $count
loguses emoncms main log file
journalctl -f -u emoncms_mqtt
specific conf fileno
feedwriter (PHP)writes input data from redis-buffer to disk in order to feed the timeseries database
scriptpathEMONCMS_WWW/scripts/feedwriter.php
ServicepathEMONCMS_WWW/scripts/services/feedwriter/feedwriter.service
globals$log, $feed_settings, $mysqli, $redis
$user, $feed
loguses emoncms main log file
journalctl -f -u feedwriter
specific conf fileno
Service-runner (Python)trigger background workers from modules (update, backup, sync, postprocess)
scriptpathEMONCMS_WWW/scripts/services/service-runner/service-runner.py
ServicepathEMONCMS_WWW/scripts/services/service-runner/service-runner.service
loguses systemd log file
journalctl -f -u service-runner
specific conf fileno
emonhub (Python)listen on serial port or ethernet and publish to mosquitto broker topic emon
scriptpathOPENENERGYMONITOR_DIR/emonhub/src/emonhub.py
ServicepathOPENENERGYMONITOR_DIR/service/emonhub.service
loglog file is in /var/log/emonhub
journalctl -u emonhub -n 30 –no-pager
specific conf file/etc/emonhub/emonhub.conf
/etc/emonhub/emonhub.env
emonPiLCD (Python)manages the emonpi LCD screen
scriptpathOPENENERGYMONITOR_DIR/emonpi/lcd/emonPiLCD.py
ServicepathOPENENERGYMONITOR_DIR/emonpi/lcd/emonPiLCD.service
loglog file is in /var/log/emonpilcd
journalctl -u emonPiLCD
specific conf fileno

EmonCMS modules

adminmodule integrated into the core package - does not have its own git repo
placeEMONCMS_WWW/Modules/admin
globals$mysqli,$session,$route,$updatelogin,$allow_emonpi_admin, $redis, $openenergymonitor_dir, $admin_show_update, $path
$log, $log_location, $log_enabled, $log_level
background workersnone
loguses emoncms main log file
specific conf fileno
configweb interface to supervise and configure emonhub
placeEMONCMS_WWW/Modules/config
globals$route, $session, $redis, $homedir
non globals$emonhub_config_file, $emonhub_logfile, $restart_log
Also in model : $logfile, $config_file, $restart_log_name
background workersrestart.sh
log/var/log/emoncms/emonhub-restart.log
specific conf fileno
dashboardDashboard Module
placeEMONCMS_WWW/Modules/dashboard
globals$mysqli, $session, $route, $path
background workersno
logno
specific conf fileno
graphmain graph module with averaging on the fly
placeEMONCMS_WWW/Modules/graph
globals$session,$route,$mysqli,$redis, $path
background workersno
logno
specific conf fileno
backupimport/export all timeseries+mysql database
placeEMONCMS_DIR/modules/backup
globals$route, $session, $path, $redis, $linked_modules_dir, $log_location
background workersemoncms-import.sh
emoncms-export.sh
emoncms-copy.sh ?
service-runner bash file why ? All things related to service-runner are in controller
logEMONCMS_LOG_LOCATION/exportbackup.log
EMONCMS_LOG_LOCATION/importbackup.log
specific conf fileconfig.cfg which has to be set up during installation
syncconnect to distant EmonCMS machines to retrieve feeds
IOT flavoured alternative to backup
placeEMONCMS_DIR/modules/sync
globals$linked_modules_dir,$path,$session,$route
$mysqli,$redis,$user,$feed_settings,$log_location
$log in model
background workersemoncms-sync.sh launching sync_run.php in CLI
logEMONCMS_LOG_LOCATION/sync.log
also uses emoncms main log file
specific conf fileno
postprocesspostprocess feeds - calculation module
placeEMONCMS_DIR/modules/postprocess
globals$linked_modules_dir,$session,$route,$mysqli,$redis,$feed_settings, $log_location
background workerspostprocess.sh launching postprocess_run.php in CLI
Postprocess_run.php scans the redis postprocessqueue and start process functions
logEMONCMS_LOG_LOCATION/postprocess.log
specific conf fileno