Emonhub config empty?


for understanding, here the complete story:
An hour ago I added a power meter with a pulse counting output to one of my emonTX (V2 compatible, built on breadboard). With the laptop attached via USB/RS232 I could see the emonTX working, sending the additional two values.

On my Raspberry PI 3 and on emoncms.org I didn’t get the new values, even the old ones didn’t appear since I uploaded the new firmware to my emonTX. So I added the two values to the emonhub configuration on the Raspberry website and saved it, but nothing happened. So my idea was, that something is wrong with this configuration. When I tried to edit it again, I only get a blank input window.

How can that happen and what can I do to get the configuration back? It seems all other emonTX are still working, even after pressing “restart” at the emonhub configuration.

The default EmonPi emonhub.conf can be found here, if you want to copy and paste it in and click save:


Hi Trystan,

I’ve allready found the default config before. Doing the complete configuration again is not the thing I’m looking for. This is my last option, if there is no other possibility.
What I’m searching for for is to read out the actual (active) configuration on the raspberry. Is it possible to dump the running configuration somehow?
I’ve had a look in several directories but every file that looked suitable was empty or with the default configuration.

best regards

When the emonhub service starts it looks to the /etc/default/emonhub file for the location of the config file. The path and file defined there as EMONHUB_CONFIG is the “actual” conf file used by emonhub.

If that file is missing/blank emonhub will not start, so unless emonhub is refusing to start I would assume it is present and readable. If that is the case but the contents are not being displayed in emoncms then the problem lays with emoncms not finding/accessing the file.

emonhub.conf is a text file so you can use cat or nano to read it no problem, you can copy it for a backup using cp etc like any other text file.

From the command line you should also be able to run sudo emonhub --show-settings, although you may need to use the full path, depending on how it has been installed, I do not have an emonPi handy to check right now. The output from this should contain the same settings as can be viewed in the emonhub.conf file unless the conf file has been altered or deleted in an unacceptable way since emonhub was started as emonhub will refuse to load an invalid conf and continue to run on the existing good settings as it was designed for non-stop use.

The emonhub.conf file belongs to emonhub and the emoncms config module has just been granted read/write permission to view/edit the file via a webpage to make life easier. So the fact you cannot access it in emoncms doesn’t necessarily mean there is a problem with the file it’s self.

Hi Paul,

The file/path in EMONHUB_CONFIG is /home/pi/data/emonhub.conf
When I look at this file, its completely empty (0 bytes), last modification: yesterday 16:42. That would fit to the latest transmisson of the missing node/data. :frowning:

I’ve found the location of emonhub (Python?) at /usr/share/emonhub
When I execute the following line “sudo ./emonhub.py --show-settings” I get a configuration, but it looks like the default config again, so I think that’s a dead end.

If nobody has another idea, it looks like my last option is to rewrite the complete configuration again. This time I’ll save the config to a file on my PC that does backups to my NAS from time to time.

Hi everyone,

After a reboot of the raspberry my problems multiplicated and I wasn’t able to get any value. Updating the emonpi via webinterface on emoncms made the situation worse. I was able to get values from 4 of my 6 emonTX now, the 5th is offline at that daytime because it’s monitoring a solar panel. I also got very strange messages with python, so I finally decided to do a complete new installation on the Raspberry.
So I took the latest image and installed it on the SD card. After setting up emonhub I get the same kind of messages again, I attached a part of the log. It’s restarting over and over again :frowning:

emonhub.txt (2.2 KB)

Try changing datacode = to datacodes = for node [[9]] in the [nodes] section of emonhub.conf.

[EDIT] FYI the plural “datacodes” setting is used to define a list of datacodes for decoding the payload where as the singular “datacode” is used to define that the payload consists of one or instances of the same data type. eg

datacode = h


datacodes = h, h, h, h 

would both work for a payload consisting of 4 16bit signed ints.

However, if the payload consisted of 3 or 5 16bit signed ints only the former would work, not the latter.

Either can be preferable depending on application. Using the former allows you to vary the payload size freely, where as the latter is stricter and therefore safer if the payload was to get altered accidentally, ie if one value was missing the payload would be discarded rather than guess which 3 of the 4 ints are present and potentially contaminating your data.

1 Like

I was at work during the weekend and have just arrived home.

Paul, you are right, I think I had datacode=h first in the config for node 9 and then changed it to configure each individual input but forgot to use the plural :smirk:
Now all (actual online) emonTX deliver values, I also switched on the aircondition to see, if the new feed on the extra power meter for the aircondition works => it does :wink:

I also had to change the datacode for the pulsecounter to “h” (was set to “L”, because it didn’t work with the example code on the emonTX V2, maybe the newer V3 nodes (with RFM69) can send more than integer?