Howto . . . regularly send data from an emonPi to a remote emonCMS?

I have a copy of emonCMS running fine on Linux, with the feeds supplied over IP using the HTTP API key. The host device does not have anything for receiving radio packets from an emonTH though.

I have an emonPi which is currently receiving radio packets from the emonTH.

What I am trying to do is get the emonPi to send on the data from the feed to the remote emonCMS. I thought I was on to something with the synch module, but from what I have seen so far it looks like the synch is a one-time effort. Is there any scheduling function that can be used to get the synch to run every X minutes?

Can I use MQTT to transfer the feed data? I reckon I can, but I don’t know where I need to start making the changes, so any guidance would be appreciated. My current understanding is that I would need to get the emonPi to publish the feed data to a remote MQTT queue on the Linux server. Is it as simple as changing the MQTT configuration (once I find the relevant file) on the emonPi?

Thanks,

David

Modify emonHub on the emonPi so that it sends the emonTH data to the remote as well as the local machine.

1 Like

Thanks for pointing me in the correct direction Brian.

For others who want to achieve something similar - you add in a second interfacer definition like [[emoncmsdemo]] below to emonhub.conf on the old instance of emonCMS, pointing to the new instance of emonCMS.

[interfacers]
###This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
    [snip]

[[MQTT]]
    Type = EmonHubMqttInterfacer
    [[[init_settings]]]
    [snip]

 [[emoncmsorg]]
        Type = EmonHubEmoncmsHTTPInterfacer
        [[[init_settings]]]
        [snip]

[[emoncmsdemo]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = http://192.168.1.6
        apikey = cf.....22
        senddata = 1
        sendstatus = 1
        sendnames = 1
        sendinterval= 30

[Edited for presentation. Moderator (RW)]