Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Strange issues on own built emoncms running on raspberry pi zero w

Hello

I am trying to debug 2 issues I am having with the emoncms I am running on the raspberry pi w

I had to do a manual built because the raspbian which emonpi sd build is based on won’t load the wifi driver, so you are kind of stuck without wifi and obviously without ethernet

so the build seems to work fine, I even implemented the low-write
EXCEPT for 2 issues:
create backup” button does nothing
run process” button from post processor module does nothing
occasionally if I keep pressing “run process” button I get a error: "uncaught typeerror: cannot read property process of undefined
url: ip/emoncms/Modules/postprocess/view.js
Line 171, column 34

If I create backup from shell emoncms-export.sh it works, creates the backup and I can see it and download it form the backup module

If I manually run sudo php /home/pi/postprocess/postprocess_run.php then the module data gets processed and i can see the data generated.

I get nothing in logs

So basically it’s one or two issues where pressing the button does noting.
Is there any debug mode I could enable to see why this happens?
Or any other advice?

Thanks

The backup and post process are separate Modules that need to be installed independently.

What instructions did you follow? - whatever you followed needs to be updated so if you could let us know it would be very useful.

Firstly you also need to install service-runner. You will find the files are already there and also the newer emoncms-mqtt service (instructions in same place.

We are in the process of reworking the install and update process to make it easier for circumstances like yours.

@borpin actually meant service-runner :wink:

1 Like

I did - corrected.

In the interests of avoiding duplication and/or confusion are you aware Dan is also getting assistance via github that maybe related

his last post suggests there is a service-runner process running, but is it the right service-runner?

1 Like

No I wasn’t. Thanks.

I have a crontab entry:

          • /home/pi/emonpi/service-runner >> /var/log/service-runner.log 2>&1

when I reboot I get some log entries in /var/log/service-runner

Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
starting service-runner
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused

I tried killing the process and restarting manually. Log seems to be fine when I do that
Terminated
starting service-runner

Am I running the right service-runner?

About mqtt: houston, we may have a problem!

Mar 28 20:14:43 emonpi mqtt_input[948]: PHP Warning: Module ‘redis’ already loaded in Unknown on line 0

[email protected]:~# service --status-all
 [ - ]  alsa-utils
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  avahi-daemon
 [ - ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ + ]  dhcpcd
 [ + ]  dphys-swapfile
 [ + ]  emonhub
 [ + ]  fake-hwclock
 [ + ]  feedwriter
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  mosquitto
 [ + ]  mysql
 [ + ]  networking
 [ - ]  nfs-common
 [ + ]  ntp
 [ - ]  paxctld
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  procps
 [ + ]  raspi-config
 [ + ]  redis-server
 [ ? ]  rng-tools
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  triggerhappy
 [ + ]  udev
 [ + ]  ufw

does this mean I am running no mqtt?

it seems I am running, the old version

[email protected]:/etc/systemd/system# systemctl status mqtt_input
● mqtt_input.service - Emoncms MQTT Input Script
   Loaded: loaded (/var/www/emoncms/scripts/mqtt_input.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-03-28 20:14:21 EET; 18h ago
     Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
 Main PID: 948 (php)
   CGroup: /system.slice/mqtt_input.service
           └─948 /usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php

Mar 28 20:14:21 emonpi systemd[1]: Started Emoncms MQTT Input Script.
Mar 28 20:14:43 emonpi mqtt_input[948]: PHP Warning:  Module 'mosquitto' already loaded in Unknown on line 0
Mar 28 20:14:43 emonpi mqtt_input[948]: PHP Warning:  Module 'redis' already loaded in Unknown on line 0

ok, so I think the problem is fixed or close to.

I installed the new services
I got an error about redis not running, so I reinstalled it (or might it have not been installed in the first place?)
After I installed the new services: emoncms_mqtt, Feedwriter, Service Runner now backup works, buttons from post processor work

not sure if post processor runs automatically to update, but that should be easy fix

thanks all for help and pointing me to the right direction!

1 Like