Local Ubuntu Emoncms and Redis

I noticed that too. But I haven’t specified a version. This is what apt and/or pecl have installed.
I just ran an apt update and there no new redis-server for Ubuntu 16.04 on the repositories.

Yes - created a crontab in my user home directory.

Now I have installed redis 3.1.6 All Pauls check reports redis 3.1.6 is up and running and on top I did a reboot of the VM.
Unfortunately no progress on the sync tool:

I pushed the two missing download buttoms, the feeds appear in the feed list, but no data

Was that before or after the rollback? It still shows redis-4.0.2.

If you uninstalled and reinstalled it might have removed the file and enabled symlinks (steps 3 and 4 from my post above) and needs them re doing perhaps?

Perhaps the php.ini file needs to be edited for your particular environment? I cannot say as I do not use synology or VMs.

It’s not just the OS but a combination of the OS and the Architecture eg there might be a different version for a ARM device running Stretch to a amd64 device running Stretch etc

Sorry i have little or no experience with the sync module, I will see what @Trystan comes up with before I wade into that unknown :slight_smile:

@Lykke Could you try setting $homedir in your emoncms settings.php file to reflect your system and try again? If that does not work could you try running sync/sync_run.php directly

sudo php sync_run.php

It might be a path issue.

No luck with activating $homedir in settings.php

Running sync_run.php produces this output, guess you are onto something:

lykke@lykke-Standard-PC-i440FX-PIIX-1996:~/sync$ php sync_run.php
SYNC: Starting
PHP Warning: chdir(): No such file or directory (errno 2) in /home/lykke/sync/sync_run.php on line 8
PHP Warning: require(process_settings.php): failed to open stream: No such file or directory in /home/lykke/sync/sync_run.php on line 9
PHP Fatal error: require(): Failed opening required ‘process_settings.php’ (include_path=‘.:/usr/share/php’) in /home/lykke/sync/sync_run.php on line 9

I’ve changed /var/www/emoncms to /var/www/html/emoncms and set the $homedir to my home folder. That helped, but:

lykke@lykke-Standard-PC-i440FX-PIIX-1996:~/sync$ php sync_run.php
SYNC: Starting
SYNC: Home dir: /home/lykke
SYNC: Connected to Redis
{“action”:“download”,“local_id”:4,“remote_server”:“https://emoncms.org”,“remote_id”:xxxxx,“remote_apikey”:“yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy”}
Cannot open local metadata file
{“action”:“download”,“local_id”:3,“remote_server”:“https://emoncms.org”,“remote_id”:xxxxxx,“remote_apikey”:“zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz”}
Cannot open local metadata file

Looks like your almost there :slight_smile: In your last step can you try: sudo php sync_run.php

Fault 40 :slight_smile: Cleared that problem, but feeds are still not downloading…

lykke@lykke-Standard-PC-i440FX-PIIX-1996:~/sync$ sudo php sync_run.php
[sudo] password for lykke:
SYNC: Starting
SYNC: Home dir: /home/lykke
SYNC: Connected to Redis
lykke@lykke-Standard-PC-i440FX-PIIX-1996:~/sync$

Edit: Tried it again. If I push the “download” button in emoncms and then manually start the sync script, data is downloaded.

Great to hear that you have data downloading working now.

It would be great if you can get service-runner to work so that you dont have to run sync_run.php manually. Do you see anything in:

tail -f /var/log/service-runner.log

lykke@lykke-Standard-PC-i440FX-PIIX-1996:~/emonpi$ tail -f /var/log/service-runner.log
STARTING: /home/lykke/sync/emoncms-sync.sh > /home/lykke/data/emoncms-sync.log
sudo: no tty present and no askpass program specified
/home/lykke/emonpi/service-runner: line 25: /home/lykke/data/emoncms-sync.log: No such file or directory
touch: cannot touch ‘/home/lykke/data/emoncms-sync.log’: No such file or directory
COMPLETE: /home/lykke/sync/emoncms-sync.sh > /home/lykke/data/emoncms-sync.log

I created /home/lykke/data/ so it had a place to put the log file, assume it should be in /var/log/, but I’m not sure how to do that. This error persists: " no tty present and no askpass program specified"

Managed to get sync up and running without errors - problem seemed to be that the sync program wasn’t able to supply the required password. Probably a bit of a hack, but I ended up doing this:

Placing a file with mode 0440 in /etc/sudoers.d/myuser with following content:

myuser ALL=(ALL) NOPASSWD: ALL
Should fix the issue.

Do not forget to:

chmod 0440 /etc/sudoers.d/myuser

Great to hear, does that solve the service runner issue? Does the download work now without manually running sync_run?

As far as I can tell, everything now works as intended. Push the “Download” button and it will fetch the data, no need for manually running sync_run.

1 Like

I realise the sudoers modification is already in place on the pi of course :slight_smile:

sudo nano /etc/sudoers

Line is just below line #includedir /etc/sudoers.d

pi ALL=(ALL) NOPASSWD: ALL

I’ve added a note to the installation guide: sync/readme.md at master · emoncms/sync · GitHub