emoncms / config Goto Github PK
View Code? Open in Web Editor NEWConfigure emonhub.conf and view emonhub.log from within emoncms
License: GNU Affero General Public License v3.0
Configure emonhub.conf and view emonhub.log from within emoncms
License: GNU Affero General Public License v3.0
Actually there is an exec command in the PHP controller to realize this simple task
I've tested on two PIs upgraded to EmonCMSv10 and the restart button is working on none....
Anyway, everything is fine in command line and when I send the order "sudo /bin/systemctl restart emonhub > /dev/null &" the emonhub service is restarting fine
Shouldn't the restart command be sent by service runner ?
Implement the same feature as developed in emoncms/emoncms#1259 to edit log level in emonhub.conf
At the moment the emonhub.conf configuration editor is a simple text file editor:
It would be really nice to have a web ui version of the editor to make configuration easier to edit.
The configuration format used is python ConfigObj. There is no php parser of the configobj format. Eemoncms could load the config file via a socket request, MQTT or redis key made available by emonhub.
The configuration would be shared as a JSON object and changes transposed back into the original confobj object in emonhub when edits are made.
Basic example of reading from ConfigObj file, changing the apikey and writing the change back to the original file:
from configobj import ConfigObj
settings = ConfigObj("emonhub.conf", file_error=True)
settings["interfacers"]["emoncmsorg"]["runtimesettings"]["apikey"] = "test"
settings.write()
If the settings are transfered to emoncms as a json object, the json changes need to be merged with the original settings in the configobj class, preserving orignal comments, ordering, spacing and indentation:
import json
from configobj import ConfigObj
# 1. Load config object
# settings is more than a dict of the contents, it is an instance of the configobj class
settings = ConfigObj("emonhub.conf", file_error=True)
# 2. Translate configuration into json object and reload back to python dict
# json string could be sent or requested by emoncms at this point
jsonstr = json.dumps(settings)
# json string could be sent back to emonhub at this point
jsonsettings = json.loads(jsonstr)
# 3. Update apikey in dict
jsonsettings["interfacers"]["emoncmsorg"]["runtimesettings"]["apikey"] = "anther"
# 4. Merge dict with original configobj class
settings.merge(jsonsettings)
# 5. Save to conf file
settings.write()
Hi,
i'm a user of emoncms for years now, syncing several SDM630 and SDM230. never any issues on a raspi3. great and stable like hell. but 2 days ago a did a FULL update stable, and now i have no more feeds/inputs anymore with data. I found a discussion where they mentioned the same issue recently and that a chmod to the logfile should help. did try this with 777 but even after several reboots, not sucessfully. i did a manual (terminal) install.sh but this did not change anything. emonhub is on 2.1.5.
I really hope this can be fixed easily if somebody knows whats the issue with this recent update.
This is one of the monents i hate myself for always trying to be up to date with modules.......so time consuming :-)
There is a typo in the file name "emonnhub-sudoers". Guess it shall be "emonhub-sudoers" as in the instructions.
ls config/
config_controller.php config_menu.php config.png edit.php emonnhub-sudoers README.md
Dont know if others are facing the same issue but I have troubles with the restart button of the config module
I had to do the following
change line 29 from
$restart_log= sprintf("%s/%s",$homedir,$config->restart_log_name);
to
$restart_log= $config->restart_log_name;
lines 16 to 18 are
public $config_file = "/etc/emonhub/emonhub.conf";
public $logfile = "/var/log/emonhub/emonhub.log";
public $restart_log_name = "restart.log";
change line 18 into
public $restart_log_name = "/var/log/emonhub/restart.log";
and at last create the log file manually
cd /var/log/emonhub
sudo touch restart.log
sudo chown pi:pi restart.log
@TrystanLea : which is the best place for the file creation ? in the install.sh of emonhub, in the EmonScripts ?
Alex
Finish the calibration screen using vuejs to create the template and update the config file on edit
would be good to simplify the code and not have so many functions with repeating functionality:
eg: calibration.php
passOnSelection_ical()
& passOnSelection_vcal()
check_vcal_select()
& check_ical_select()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.