synchronize data

You can synchronize data from raspberrypi with for safety of not losing data.

ukmoose's picture

Re: synchronize data

Are you asking a question?

 i.e. Can you synchronize data from raspberrypi with for safety of not losing data?

or are you stating that you can synchronize data from raspberrypi with for safety of not losing data.


If you are asking a question, the answer is yes, you could send all data to both sites at the same time. 


You would need to edit this file:

after line 100:  getcontent("localhost",80,$url);

add the following new lines

$secondapikey = "ADD YOUR EMONCMS KEY HERE";

$secondurl = "/emoncms/input/post?apikey=".$secondapikey."&node=".$values[1]."&csv=".$msubs;



it's a bit of a fudge but it should work.  

If you are that worried about losing your data, you really should look at taking your own regular backups of the mysql database.  If you do a Google search you should find out how.


reins5's picture

Re: synchronize data

it is a question

TrystanLea's picture

Re: synchronize data

Hello reins5, do you mean downloading data from emoncms to the raspberry pi? if yes, have a read of this: 

The sync module can be downloaded from here: and will now appear in the top menu bar when you copy it in your raspberry pi emoncms modules directory.

reins5's picture

Re: synchronize data

can you be more clear with the code, I'm no expert.
Can you give me an example?

$ secondapikey = "ADD YOUR EMONCMS KEY HERE";

$ secondurl = "/ emoncms / input / post? apikey =". $ secondapikey. "& node =". $ values ​​[1]. "& csv =". $ msubs;

getContent ("", 80, $ secondurl);

I would like to send data simultaneously emonTx and raspberrypi this to avoid buying dns

ukmoose's picture

Re: synchronize data

I don't understand your "give me an example" all you need to do is copy the lines.

Log onto 

Goto Input.  

If you have no inputs setup you will see something like this CHAR apikey[] = "b935b4d97856a55445ea3a96eb17f789"  this is the api key you need but your key will be different (I made this one up)


Take this key and add it to the first line  e.g.

$ secondapikey = " b935b4d97856a55445ea3a96eb17f789";

copy the other two lines as I typed them, with no spaces.




reins5's picture

Re: synchronize data

My system is composed of an emonTx, an emonBase, an emonGLCD and a Rasperry Pi. I would like to use the Rasperry Pi as a server offline and then synchronize the db with the db on the as soon as I connect my modem/router. Is it possible and how?

I have another question about the two CT sensors of the emonTx: can it be possible to place them into a junction box or this can lead to false readings?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.