Community
OpenEnergyMonitor

Community

Pause emoncms database updates?

(Derek Mansbridge) #1

Hi
Installed emoncms on my Raspberry Pi / HDD the long way…
(https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/readme.md)
…stopping short of installing emonhub. All is fine.
Now looking to (re)write the import / export scripts since there are hardcoded paths which don’t match this installation.
I note there is no feedwriter service (I assume this comes with emonhub) so the “sudo service feedwriter stop / restart” commands are irrelevant.
However, I have data arriving from http api messages directly from Arduino devices and from node-red (node-red-node-emoncms) on both local and remote Raspberry Pi’s. How can I pause updates to the feeds in the MySQL database during the backup (and restore?) process?
Thanks in advance.

0 Likes

(Brian Orpin) #2

Firstly, you cannot pause without losing data in this scenario. The Backup Module stops the feedwriter service, so incoming data will be stored in Redis until the service is restarted. There is no reason not to run feedwriter, even in your circumstance, even though the reduction of disk writes is not the driving factor. There has been some work around the service so it is very useful.

Have you installed the backup Module? It uses the $homedir property set in settings.php. Other than finding a good place to put it on my system, it did just work after modifying the config.

When did you do the install? I ask as there have been some changes to how service-runner and feedwriter services are setup.

1 Like

(Derek Mansbridge) #3

Hi Brian, thanks for your reply. Tried a few things (always dangerous!) and still have problems.
Yes - I had installed the Backup Module (same link that you posted) and have now enabled ‘$homedir’ property in ‘settings.php’ to ‘/home/pi’.
Completed the emoncms install (the link in my original post) by following the instructions at ‘Install Emonhub’. Changed cmdline.text to ‘dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait’. I assumed ‘root=/dev/sda2’ was correct (sda1 is ‘part /boot’).
All installs have been in the last couple of weeks (emoncms version 9.9.8).
Two immediate problems:

  1. No sign of ‘feedwriter’. Server information panel on the ‘Administration’ page shows:
    emonhub Active Running
    service-runner Active Running
    redis-server Active Running
    mosquitto Active Running

  2. The ‘Create Backup’ button on the ‘Backup’ page does nothing (nothing displayed in the panel below the button) - although the ‘Import Backup’ does!

Sorry to be a pain - any help much appreciated!

0 Likes

(Brian Orpin) #4

You probably need to manually install it. Instructions here - this is included with the emoncms repo so the files are already on your system.

Yes it fails silently in some circumstances. Depending on where you installed it to, did you need to edit the paths in the config.cfg file?

Try just running emoncms-export.sh from the command line and see what it does.

0 Likes

(Derek Mansbridge) #5

Both suggestions worked. Many thanks for your help.

0 Likes