Power outage, and suddenly stops sending data to emoncms

Sorry, python isn’t my first choice language. I’ve just added many self._log.info("line x") to the source until I worked out what was going on.

The ERROR MainThread 'available' is coming from src/emonhub.py:93

The exception is from EmonHubAutoConf(settings). I’m not really sure what’s going on in here, but the reason it was crashing, was that the hardcoded file /opt/openenergymonitor/emonhub/conf/available.conf was in my case symlinked to /etc/emonhub/emonhub.conf and did not contain the [available] header. I may have upgraded the source many times, and my config file was from an older version?

Anyway, fixed by copying the example conf/available.conf to that hard-coded location.

I don’t know how my installation config got in such a mess, but the debugging messages did not really help to identify that there was no [available] header in my emonhub.conf.

2 Likes

Ah, there is a GitHub Issue open for this. @TrystanLea

Relative path for available.conf? · Issue #197 · openenergymonitor/emonhub (github.com)

And this

I’m trying to revive my (simple) installation after downloading a recent version of emonhub.

Runs OK from commandline but not as a service.

Config file not found: "conf/available.conf".

I put a copy of available.conf in the same place as emonhub.conf
I see you also mention apikey but there is no such thing in my conf

### emonHub configuration file
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = ERROR ##DEBUG
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
#######################       Interfacers       #######################
#######################################################################

[interfacers]

[[MQTT]]
    Type = EmonHubMqttInterfacer
        [[[init_settings]]]
            mqtt_host = 127.0.0.1
            mqtt_port = 1883
            mqtt_user = emonpi
            mqtt_passwd = emonpimqtt2023
        [[[runtimesettings]]]
             subchannels = ToEmonCMS,
             pubchannels = emon/CHANNEL1,
             timestamped = True

[[MBUS]]
    Type = EmonHubMBUSInterfacer
    [[[init_settings]]]
        device = /dev/ttyAMA0
        baud = 2400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 60
        validate_checksum = False
        nodename = heatmeter
        [[[[meters]]]]
            [[[[[heatmeter]]]]]
                address = 1
                type = sontex531

Also tried putting autoconf = 0 in the [hub] section. Can start using command line (not service) but no data is being sent to MQTT.