Community
OpenEnergyMonitor

Community

Temporarily suspend logging to feed

Is there a simple way to temporarily stop a feed from logging? As a compulsive “fiddler” I regularly modify some of the inputs and end up with crazy values that get logged as sensors are moved/replaced/modified. I know I can remove the “log-to-feed” and then reinstate it after, but wondering if there is an “on/off” option on feed anywhere?

No there isn’t.

Where is the data coming from?

emonhub has (had?) the ability to pause any interfacer/reporter, I have no idea if the current emonpi variant still maintains that code but if the feature is no longer functional there are other ways of achieving the same in emonhub, tell us about your set up.

When I’m making changes to a specific site/device I use emonhub to hold and buffer the data as per above, but for the purpose of server maintenance I also have set up a second virtual host in apache pointing at the same root dir, ie the same emoncms site is accessible via 2 urls so that I can take down the “main” vhost that all the devices use and then access emoncms via my “admin” vhost backdoor. This is great for updates and backups etc

Both of these methods result in zero packets lost due to all data coming via emonhub which buffers data til it can post.

All of the above refers to http data, if you are using MQTT then you could simply stop the mosquitto server but that will mean missing data for the duration of the edits as there is no buffering the way it is currently configured AFAIR.

1 Like

I’ve got both emonhub (v2.04) and MQTT running. MQTT is doing hot water and wind sensors while emonhub is doing energy and temps. I could stop the MQTT server as you suggest, but that would stop logging of all MQTT inputs, including those not under maintenance.
I couldn’t see any means of selectively pausing emonhub inputs in the config file…
I like the virtual host idea for server maintenance, and might give that a try once this round of fiddling is finished!

I’m intrigued - do you mean ‘root’ or do you mean ‘data’ directory? Just trying to visualise how this works and what it does.

How do you do that?

How are they passed from emonhub to emoncms? http or mqtt?

Looking at the code (briefly) I think the pause functions have been lost along the way in the emonpi variant, but there are work arounds, for example if you are using http, edit the server url in emonhub.conf to fudge it, that way emonhub won’t be able to find the server and start buffering, once you are done just edit it back and it will catch up. If you do not want to buffer the data and just want to stop it, add a hash (#) to comment out the Type = EmonHub*****Interfacer line for which ever interfacer(s) you want to stop and remove the hash once you are done editing. By commenting out the Type = the interfacer instance will be deleted and then recreated when uncommented again. This latter method is probably what you will need to use for mqtt via emonhub as the mqtt data is not timestamped so buffering is pointless.

I have used both of these methods successfully many times in the past with original emonhub, but I have not tried them on the emonpi variant of emonhub so whilst I see no reason for them not to work, please use with caution and confirm what you expect to happen has happened correctly by observing the logs. I’m sure you know, but just in case, the emonhub.conf file needs saving after each of my suggested edits for emonhub to pick up the changed setting.

There may be another level of pausing you could try too, this would be at individual node levels but it would stop, not buffer. That would be to fudge the datacodes setting for the node in question so that emonhub discards packets for that node, eg add/remove a datacode so the expected size changes but the actual data doesn’t.

Things are much easier in original emonhub, simply set pause = *** in any interfacer or reporter [[[runtimesettings]]]. pause can be one of 3 values “off”, “in” or “out”.

  • off - is the default position and is pretty self explanatory.
  • out - basically prevents the said interfacer/reporter from sending on any data, in the case of reporters only, the data will then be buffered. for interfacers the data is processed as if it is going to be sent but discarded instead, this is useful for tinkering with firmwares and emonhub settings without screwing up emoncms.
  • in - this essentially stops data from passing through said interfacer/reporter altogether, a full pause with no processing or buffering.

I think the official term is document root (off the top of my head), It’s the directory that the vhost points to, the root of the website eg /var/www/emoncms or similar. I essentially serve exactly the same emoncms instance via 2 urls/domains, that is usually something like emoncms.clientX.com and clientX.mydomain.com. when I shut down the emoncms.clientX.com vhost all activity to the emoncms instance stops whilst I can still log in via clientX.mydomain.com and see all ClientX’s data and settings etc or carryout upgrades etc whilst the remote emonhubs buffer data.

1 Like

mostly mqtt, with one set using modbusTCP. I used #Type = EmonModbusTcpInterfacer and that stopped the modbus logging - thanks. The mqtt logs are not causing a problem so I’m going to let them be.

1 Like