synchronize data

You can synchronize data from raspberrypi with http://emoncms.org/ 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 http://emoncms.org/ for safety of not losing data?

or are you stating that you can synchronize data from raspberrypi with http://emoncms.org/ 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. 

THIS IS UNTESTED

You would need to edit this file:

https://github.com/emoncms/raspberrypi/blob/master/raspberrypi_run.php

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;

getcontent("emoncms.org",80,$secondurl);

 

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: http://openenergymonitor.blogspot.co.uk/2012/09/data-portability-version-1-complete.html 

The sync module can be downloaded from here: https://github.com/emoncms/sync 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 ("emoncms.org", 80, $ secondurl);

________________
I would like to send data simultaneously emonTx http://www.emoncms.org/reins5 and raspberrypi this to avoid buying dns
thanks

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 emoncms.org 

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 emoncms.org 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.