I have a stand-alone emonhub installation on a Pi: i.e. I only have emonhub and rfm12 installed. It is configured to connect to a Mosquitto broker on another local machine. For various reasons, I needed to rebuild the Pi and now emonhub doesn’t seem to connect to the broker.
I installed emonhub as per the instructions and replaced the installed version of emonhub.conf with my old one. I had problems with the new system service file as it expected var-log.mount
, which doesn’t exist on Debian bullseye, but that’s OK, I just edited it.
If I run /usr/local/bin/emonhub/emonhub.py
(no options) from the pi
account, emonhub starts. Apart from an error when it looks for a non-existent config file:
ERROR MainThread Config file not found: "/opt/openenergymonitor/emonhub/conf/available.conf".
Unable to load available.conf
it runs, connects to the rfm12 and seems to work. However, it never connects to the broker. No errors are reported though.
Question: Is it this missing config file (which will never be there if I don’t install the entire openenergymonitor suite), or something else? The relevant portion of my emonhub.conf
looks like this:
[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
### Uncomment this to also send to syslog
use_syslog = yes
#######################################################################
####################### Interfacers #######################
#######################################################################
[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[RFM2Pi]]
Type = EmonHubJeeInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 38400 # 9600 for old RFM12Pi
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
group = 210
frequency = 433
baseid = 5 # emonPi / emonBase nodeID
calibration = 230V # (UK/EU: 230V, US: 110V)
quiet = true # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
# interval = 300 # Interval to transmit time to emonGLCD (seconds)
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = ****
mqtt_port = 1883
mqtt_user = emonhub
mqtt_passwd = ****
[[[runtimesettings]]]
#pubchannels = ToRFM12,
subchannels = ToEmonCMS,
# emonhub/rx/10/values format
# Use with emoncms Nodes module
node_format_enable = 1
node_format_basetopic = emonhub/
# emon/emontx/power1 format - use with Emoncms MQTT input
# http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
nodevar_format_enable = 1
nodevar_format_basetopic = emon/
# Single JSON payload published - use with Emoncms MQTT
node_JSON_enable = 0
node_JSON_basetopic = emon/