Hi,
i have some raspberry pi with emonCMS and now the first of them only with emonView running at different locations in place of our customers, where we a doing consulting in energy efficiency. Mostly the are connected via UMTS routers with prepaid cards and flat rate, which are running over the edge.
I now need to clone or sync the Inputs and feeds of this systems to a main server in one derection. I like to have a enonCMS installation at the customer to. I tried to handle this situation with "Backup" from usefullscripts, but that is not the Goldeneye, cause it does not work for multiple backups from multiple emonCMS installations, cause of Feed Numbers are not unique in this case.
I now tried to to use The emonView installation with pushing the inputs on multiple enonCms installations by the emonhub service. This works fine, but when there is a break in communication, we have missing data and no normal way to pull or push them a second time to the emonCMS installations.
1. I think it could be useful to have feed numbers starting by 1 for each user in emonCMS, so they are unique by userid and feednumber as primary key. I think this is not a so big change in code and could be very useful. same on all other keys, that are unique by itself, but not in this case.
2. it would be great by having userid as a generated unique key like apikey instead of the usernr. So it would be possible to identify identicle Users over multiple installations. A work around ist to copy and change the api keys by hand and use them as unique.
3. it would be nice to use property or installation instead of user in naming in this case. our work around for that is to use user as property.
Maybe, i hope I am starting here an interesting discussion about that.
PS. Tomorrow i have to change this Text by pc. Its not so easy to Write in Englisch with a ipad with German Language installed. Apple becomes more like microsoft ;-( in The UX. (done that ;-)
greetings from good old Germany, Marc
Re: Syncing between emonCMS installations
Hmm, it looks like syncing is not interesting the community.
has nobody more the 1 emoncms servers running ???
Re: Syncing between emonCMS installations
Depending on how long the network is down, how much data you are pushing you should be able to post to 2 emoncms servers local and remote without any data loss, emonHub has a default buffer size of 1000 frames but this can be set in the conf. I currently run with a buffer size of 20-30K frames on a read-only raspian (ie no caching) and can go over 48hrs without a network connection.
I have not tried to extend this further so I don't know the limits but considering that is a Pi B+ with 512MB RAM if you were using a new Pi 2 B and had another half a gig available you could probably run for many weeks without a network connection and the data would be uploaded as soon as the network came up.
Beware this isn't intended as a back-up solution and in fact the data is volatile, if the Pi powers down before the network comes up the data is lost. The back up ultimately would be the remote server but this buffer should prevent any data loss due to network issues. try setting "buffer_size = 100000" for example in the remote servers [[[init_settings]]] in emonhub.conf.
Also if you want to have more control over apikeys you can. The users apikeys are randomly generated when a user is created via the "register" form. You could create a user using mySQL instead and insert your own user name password and apikeys. I am working on a install script for emoncms and that creates the first user (admin) based on the details supplied when the installer is started.
Paul