Emoncms Sync module v3.x.x

The latest version of the Emoncms Sync module is now available :tada: Key improvements:

  • New emoncms_sync.service that handles automated upload of feed data at a user selected interval, e.g every 5, 10, 15, 30 minutes, hourly or daily. No need to setup a crontab entry.

  • Significantly improved upload efficiency by reducing the number of HTTP/s requests required. Instead of sending separate requests for each feed, data from multiple feeds is now consolidated into a single HTTP/s request. This reduces bandwidth consumption primarily by minimising the repeated transfer of HTTP/s headers.

These improvements make using the emoncms sync module a more viable option for uploading data from e.g a local emonPi2 up to emoncms.org in a regular automated way. This can replace using emonHub for data upload in many applications, saving the need to duplicate input processing on both local and remote emoncms instances and improving reliability of data upload when there are connectivity outages.

Other sync interface improvements include:

  • Option to authenticate with remote server using username and password login or write apikey - whichever is easiest to access.
  • Feeds grouped by node name
  • Quick select/deselect option to register feeds for upload or to stop uploading data for a feed.
  • Multi select to select/deselect multiple feeds.
  • emoncms_sync service status

To update:

Option 1: Update via Admin Update > Full Update
Option 2: Selectively update Emoncms Core and the Sync module via Admin > Components.

Reconfigure sync remote settings if you have an existing configuration in place.

If you added a manual crontab entry to run the older sync_upload.php periodically, please make sure to remove it.

3 Likes

Probably a dumb question, but do I need to change the senddata = 1 (below) to senddata = 0 in emonhub before enabling sync? I have not used sync previously.

Thanks,

Gordon

  [[emoncmsorg]]
        Type = EmonHubEmoncmsHTTPInterfacer
        [[[init_settings]]]
        [[[runtimesettings]]]
            pubchannels = ToRFM12,
            subchannels = ToEmonCMS,
            url = http://emoncms.org
            apikey = xxxxxxxxxxxxxxxxxxxxxxxxxx
            senddata = 1    # Enable sending data to Emoncms.org
            sendnames = 1    # Send full input names (compression will be automatically enabled)
            interval = 30    # Bulk send interval to Emoncms.org in seconds
1 Like

This is a great addition - worth pinning I’d suggest for a month or so.

2 Likes

Yes good point, you can disable that interfacer completely by putting a # just before Type = at the top. E.g:

  [[emoncmsorg]]
        # Type = EmonHubEmoncmsHTTPInterfacer

v3.1.3: Bug fix in login auth.

Sync module documentation added to Emoncms guide: https://docs.openenergymonitor.org/emoncms/sync.html. Also available in repo readme https://github.com/emoncms/sync.

hmm. Something isn’t working. I will revert back to emonHub until I hear back from you.

When I try to set up sync, it tells me that the emoncms_sync service is not running.(I am using the APIkey method)

When I go to start the service, it never changes from “Activating”
image

Interestingly I have the same symptoms, dunno if its the same root cause.
Looking in the logs, I’m seeing the below …

Thankyou, looking into it, did you both update via full update? Or selective component update?

I can see the issue, will have a fix shortly.

Apologies I have now fixed this issue, version is now 3.1.4. If you could both try this latest version that would be great, update either via full update or selective component update. If updating via git make sure to restart the emoncms_sync service.

1 Like

I had done the full update. Will now update with the latest version

This doesn’t appear to work.

On the local emonPi2, it appears to be working, with one minor hiccup below.

image

I initially clicked only the feeds I wanted to upload, and the “upload selected” button did not appear. I then clicked “Select all” and then unclicked the ones I did not want uploaded. The upload select button then appeared.

However, when I go into emoncms.org, it has not updated for the past 33 minutes (ever since I made the change).
image
I checked that the APIkeys were correct, and then started to wonder if I needed to sync the inputs as well.
So, back to the local emonPi2 to set sync for inputs, but no inputs are showing to select.

Not sure what the next steps are or if I have missed doing something. Please advise.

thanks,

Hmm, I probably haven’t been clear about an important requirement that local and remote feeds have the precise same start times and intervals and I probably need to add better feedback in the interface about this…

I assume that you created one set of feeds locally and then a few moments later created a second set of feeds on the remote server? Using emonhub and manually setting up the same input processing?

If the completeness of your local feeds are better than the remote ones I would delete the remote feeds and then configure the sync module to sync up from the start… one way to test this safely would be to create a new emoncms.org account and sync to that fresh account just so that you can see what I mean and the process working?

You are correct in your assumptions. When we set up the emonPi2s, we do this in advance of our installations and then set emonCMS.org as we install. This could be days or weeks later.

To make sure I understand the process, please confirm my understanding below.

1 - configure the inputs and feeds on the emonPi2 and disable the emoncms interface in emonhub.
2 - establish sync to the emoncms.org instance

Deleting the feeds for our existing installations could be problematic as we are on metered cellular connections if I understand what you are suggesting correctly. By deleting the existing feeds in emoncms.org and then establishing sync, it would upload all the historical data first and then sync regularly from that point forward—correct? (in one location, this is over 100 MB)

It makes sense for our new deployments, but I have to think about how to update our existing sites.

1 Like

In theory then you can only use this by creating a new feed on the remote server.

Alternatively offer the ability to overwrite the remote server feed with this one perhaps?

Worked a treat for me, thanks @TrystanLea! :beer:
Syncing has never been so good :grinning:

1 Like

Correct.

Correct, if you started recording data on emoncms.org before the emonPi then you can also delete the local feeds and download the emoncms.org feeds, setup input processing locally and then sync upload from then on…

Agreed this will be easier to use on new systems!

Great to hear, thanks @jamespreedy !

Yes something like that would work, one of the other things I want to add is a md5 or similar check to ensure both local and remote are identical and to offer re-upload if not. This would be needed if editing historic data in feeds or if feeds are recalculated using post processing…

1 Like