Code Monkey home page Code Monkey logo

config's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

config's Issues

Restart button not working

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 ?

EmonHub.conf configuration editor

At the moment the emonhub.conf configuration editor is a simple text file editor:

image

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()

INPUTS all going n/a NULL after recent update

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 :-)

Typo in filename

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

restart button not working

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

config_controller.php

change line 29 from
$restart_log= sprintf("%s/%s",$homedir,$config->restart_log_name);
to
$restart_log= $config->restart_log_name;

config_module.php

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

Calibration options

Finish the calibration screen using vuejs to create the template and update the config file on edit

calibration screen - join similar js functions

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()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.