Emonhub.conf not reloading after save change [SOLVED]

After 9.3 update, when I change EMONHUB.CONF it is not updating.
I need to run manually a restart from service.
Is this correct? How to debug this if it is a problem

Thanx!

pb66's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

What version emonhub?

How are you updating it ? via the config page of emoncms or ssh ?

are there any error messages?

What are you changing?

You say the changes saved but not loaded until the next restart of emonhub, I did not think that was possible so can you confirm?

What happens in emonhub.log ? (check you have loglevel = DEBUG set in emonhub.conf)

If unable to save emonhub.conf in emoncms, have you tried doing it directly via ssh? if so what happened?

Paul

allmac's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

Update where following steps:
1) http://openenergymonitor.org/emon/node/11407
2) https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/general.md#module-installation

With no error message doing update steps...

For this "not reloading emonhub.conf" issue after changes.. I have no error in Emonhub.log DEGUB.

Looking better the situation...
When I save emonhub.conf from web-interface, it really changes ~/data/emonhub.conf.
However, I need to restart Emonhub with: sudo service emonhub restart

And sometimes I have "not able to read emonhub.conf" file. Not everytime.

But the worst problem is not auto-update after Save new configurations.
Is this a new feature?

Thanx.

allmac's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

I found something really crazy...
I have this configuration:

[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0 #RF
        com_baud = 38400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,
        group = 210 #(default:210)
        frequency = 868 #(default:433)
        baseid = 5 #(emonPi default:5)
        quiet = false #(default:true)
        calibration = 110V #(UK/EU: 230V, US: 110V)
        # datacode = B #(default:h)
        # scale = 100 #(default:1)
        # interval = 300 #(default:0)
        # nodeoffset = 32 #(default:0)

[[MQTT]]
    Type = EmonHubMqttInterfacer
    [[[init_settings]]]
        mqtt_host = 192.168.1.11
        mqtt_port = 1883
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        basetopic = emonhub/
        quiet = false #(default:true)

To receive RFM data I need to enable BOTH interfacers.
If I disable any of these interfacers, than I do not receive data from RFM into Nodes.

However, I have 3 others MQTT Nodes. Even if I disable all interfacers, these keep receiving data.
And I don't have log about MQTT, only when I restart Emonhub:

INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
INFO MainThread MQTT Init mqtt_host=192.168.1.11 mqtt_port=1883 mqtt_user=
INFO MQTT Connecting to MQTT Server
INFO MQTT connection status: Connection successful
INFO MQTT on_subscribe

It looks like Emonhub is completly crazy...

pb66's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

I don't think it is emonhub that is crazy. your "RFM" data is received on a "Jee" type device, most probably an RFM2Pi. It passes into emonhub via it's EmonHubJeeInterfacer that data is then parsed using the info in the [nodes] section and passed out via the EmonHubMqttInterfacer to your MQTT broker so that the emoncms "nodes" module can subscribe to that topic. That seems pretty normal and yes if you stop the data entering or exiting emonhub it will not reach emoncms.

What are your other "MQTT nodes" ? if they are publishing direct to the MQTT broker and emoncms is subscribing directly to that topic tree then it doesn't involve emonhub, so no stopping emonhub will not effect that data.

Paul

allmac's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

So... after update to 9.3

My RFM is not updating respective NODE from EmonHubJeeInterfacer. I need EmonHubJeeInterfacer and EmonHubMqttInterfacer, both enable to update the NODE that before the update where working with EmonHubJeeInterfacer only.

And... all my MQTT data is sent to broker (same Emonhub server and EmonHubMqttInterfacer config). All them to the same topic (/emonhub/rx/"node"/values). And before to update, they could update only if  EmonHubMqttInterfacer where enable. Now they keep updating even with this interfacer off.

emonhub/rx/5/values 209,7,76,133,125,32
emonhub/rx/5/rssi -48
​emonhub/rx/11/values 434,138,296,0,5,47,48.7,61.4,72.2,94,49,0

So... Emonhub is crazy:

- updates RFM only with interfacers Jee and Mqtt enable;
- updates Mqtt even if interfazer Mqtt is disable.

pb66's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

No, the description I gave above has been the same for many months.

"updates RFM only with interfacers Jee and Mqtt enable"

No. it only accepts data FROM the rfm device if you enable the Jee interfacer and then it will only pass it on TO the places you configure it to for example the mqtt interfacer. one is incoming the other is out going.

if you want to pass data from RFM to emoncms via http you will need BOTH the jee and http interfacers, remove either and data will not reach it's target.

"updates Mqtt even if interfazer Mqtt is disable"

No. if you bypass emonhub and send your data directly from your mqtt devices to the broker NOT VIA EMONHUB then nothing you do in emonhub will effect that DIRECT connection.

This has nothing to do with the 9.3 emoncms update, in fact it has nothing to do with emoncms at all. it must be a coincidence or someone has some crossed wires somewhere.

Paul

allmac's picture

Re: Emonhub.conf not reloading after save change [SOLVED]

Thanx! To solve what I want, I did a "hacked" EmonHubMqttInterfacer...

Now I have Arduino's OpenEnergy Shield connected to my Raspberry's Emoncms via SERIAL only (USB cable), than I can also power up Arduino.

Power data (from Arduino) is received into NODES, than sent to INPUT using EmonHubEmoncmsHTTPInterfacer and to Mqtt-broker (to use also in another Raspberry and Openhab) using hacked EmonHubMqttInterfacer.

And hacked EmonHubMqttInterfacer also get all other Mqtt-broker data (from others equipments) and send them to INPUT.

Alberto

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.