Newly installed EmonPi shows all inputs as n/a

I bought an EmonPi shield (V1.6) and a EmonTH a couple of years ago, I got them to work back then, but haven’t used them in some years.
I’d like to put them back to work, so I etched the recent SD image (21Jul21) on a new SD card. Connecting and configuring WiFi worked like a charm, but I do not get any inputs (red, n/a), even though voltage and CTs are plugged in. The EmonTH also does not show any values, I don’t even know if it managed to connect.
I noticed that the service “emonhub” in the Admin-tab is red and shows “Activating loaded activating auto-restart”. Starting it manually will not bring the inputs to life, and the service seems to stop again soon after. The emonhub log does not show a single line.
I tried rebooting, re-etching the SD-card and updating of everything, without success.

Server Information

Server Information

Services

  • emonhub :- Activating loaded activating auto-restart

  • emoncms_mqtt :- Active Running

  • feedwriter :- Active Running - sleep 300s 0 feed points pending write

  • service-runner :- Active Running

  • emonPiLCD :- Active Running

  • redis-server :- Active Running

  • mosquitto :- Active Running

  • demandshaper :- Active Running

Emoncms

Server

  • CPU :- 1 Threads(s) | 4 Core(s) | 1 Sockets(s) | Cortex-A7 | 57.60MIPS |
  • OS :- Linux 5.10.17-v7+
  • Host :- emonpi | emonpi | (fe80::db80:3c7a:52c5:4a6a)
  • Date :- 2022-11-13 12:58:42 UTC
  • Uptime :- 12:58:43 up 15:34, 0 users, load average: 1.69, 1.73, 1.73

Memory

  • RAM :- Used: 22.17%
    • Total :- 924.22 MB
    • Used :- 204.89 MB
    • Free :- 719.32 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB

Disk

  • **** :- - / :- Used: 49.40%
    • Total :- 4.07 GB
    • Used :- 2.01 GB
    • Free :- 1.86 GB
    • Read Load :- 168.97 B/s
    • Write Load :- 1.02 KB/s
    • Load Time :- 14 hours 25 mins
  • /var/opt/emoncms :- Used: 0.04%
    • Total :- 9.84 GB
    • Used :- 3.77 MB
    • Free :- 9.34 GB
    • Read Load :- 0 B/s
    • Write Load :- 0.12 B/s
    • Load Time :- 14 hours 25 mins
  • /boot :- Used: 18.90%
    • Total :- 252.05 MB
    • Used :- 47.65 MB
    • Free :- 204.4 MB
    • Read Load :- 0 B/s
    • Write Load :- 0 B/s
    • Load Time :- 14 hours 25 mins
  • /var/log :- Used: 7.77%
    • Total :- 50 MB
    • Used :- 3.88 MB
    • Free :- 46.12 MB
    • Read Load :- n/a
    • Write Load :- n/a
    • Load Time :- n/a

HTTP

  • Server :- Apache/2.4.38 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.29-MariaDB-0+deb10u1
  • Host :- 127.0.0.1 (127.0.0.1)
  • Date :- 2022-11-13 12:58:42 (UTC 00:00‌​)
  • Stats :- Uptime: 56082 Threads: 12 Questions: 13859 Slow queries: 0 Opens: 47 Flush tables: 1 Open tables: 40 Queries per second avg: 0.247

Redis

  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.3.4
  • Host :- localhost:6379
  • Size :- 53 keys (718.31K)
  • Uptime :- 0 days

MQTT Server

  • Version :- Mosquitto 1.5.7
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.3.29-1~deb10u1 (Zend Version 3.3.29)
  • Run user :- User: www-data Group: www-data video Script Owner: pi
  • Modules :- apache2handlercalendar Core ctype curl date dom v20031129exif fileinfo filter ftp gd gettext hash iconv json v1.7.0libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $openssl pcre PDO pdo_mysql Phar posix readline redis v5.3.4Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib

Pi

  • Model :- Raspberry Pi 2 Model B Rev 1.1 - 1GB (Embest)

  • Serial num. :- BB936261

  • CPU Temperature :- 40.62°C

  • GPU Temperature :- 40.1°C

  • emonpiRelease :- emonSD-21Jul21

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0
  • Language :- en-CA,en-US;q=0.7,en;q=0.3

Window

  • Size :- 1519 x 749

Screen

  • Resolution :- 1536 x 864
1 Like

When you copy the system information, please use the Copy Markdown button and then just paste it here. Much easier to view and collapses the text as well (you can edit your post).

It will have done an update on first boot and there was an issue with emonhub (see other threads).

Rerun a full update and you should be fine.

However Trystan is about to release a new image so if there is no urgency, I’d wait a short while until he does to collect any meaningful data, then start with that new image.

1 Like

Will do, thank you! I was wondering how to create collapsible sections.
Looking forward to the update. Thanks to everyone involved!

2 Likes

Same issue as you!

Hi! this part i got resolved by giving /var/log/emonhub/emonhub.log rights to write. used: chmod 775 /var/log/emonhub/emonhub.log and then after emonhub service restart this solved.

but I have other probem. the inputs are not forwarded to emoncms. i see data coming in, but no inputs are generated.

chmod didn’t fix for me, unforch

I’ve the exact same issue. I got a freshly imaged SD card as shipped from Open Energy Monitor (due to the old one being corrupt) and hit update, and now emonhub hub wont start.

Hello @drc when did you write the SD card and boot it up? Did you do this all today?
I pushed a fix for this yesterday but if that didnt work for a newly built image today I will have to replicate this tomorrow and work out what’s going wrong…

1 Like

Hi Trystan, thanks for the reply. The SD card was shipped already imaged from OEM so I simply put it in the emonpi and plugged it in, I went through the startup section, then to Admin to update it in case it needed it and realised the emonhub wasnt running and couldnt be started for anything more than a few seconds. Since then I’ve tried:

sudo chmod -775 /var/log/emonhub/emonhub.log

and

cd /opt/openenergymonitor/emonhub
sudo ./install.sh

and the emonhub service is auto-starting but wont start. I’ll try a system restart now and see how I go.

Thanks @drc did you run this today? just to be sure Im on the same page…

Yes, within the last 30 minutes.

Thanks. It would be interesting to see what the result of:

journalctl -f -u feedwriter

is when it fails. I will try to replicate the issue to work out whats going wrong.

Hi, I’m not getting any output from the feedwriter unit in journalctl when I try to enable or restart the emonhub but maybe this output from the full journalctl might help-

NO OUTPUT FROM FEED WRITER UNIT:

[email protected]:/var/log/emonhub $ sudo journalctl -f -u feedwriter
– Logs begin at Sun 2022-11-13 19:44:56 GMT. –
Nov 13 19:45:13 emonpi systemd[1]: Started Emoncms feedwriter script.
^C

OUTPUT FROM JOURNALCTL -F:

Nov 13 21:45:43 emonpi systemd[1]: Starting emonHub data multiplexer…
Nov 13 21:45:43 emonpi systemd[1]: Started emonHub data multiplexer.
Nov 13 21:45:44 emonpi emonhub[14243]: usage: emonhub.py [-h] [–config-file CONFIG_FILE] [–logfile LOGFILE]
Nov 13 21:45:44 emonpi emonhub[14243]: [–show-settings] [–version]
Nov 13 21:45:44 emonpi emonhub[14243]: emonhub.py: error: argument --logfile: can’t open ‘/var/log/emonhub/emonhub.log’: [Errno 13] Permission denied: ‘/var/log/emonhub/emonhub.log’
Nov 13 21:45:44 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 13 21:45:44 emonpi systemd[1]: emonhub.service: Failed with result ‘exit-code’.
Nov 13 21:45:49 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
Nov 13 21:45:49 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 1109.
Nov 13 21:45:49 emonpi systemd[1]: Stopped emonHub data multiplexer.
Nov 13 21:45:49 emonpi systemd[1]: Starting emonHub data multiplexer…
Nov 13 21:45:49 emonpi systemd[1]: Started emonHub data multiplexer.
Nov 13 21:45:50 emonpi emonhub[14250]: usage: emonhub.py [-h] [–config-file CONFIG_FILE] [–logfile LOGFILE]
Nov 13 21:45:50 emonpi emonhub[14250]: [–show-settings] [–version]
Nov 13 21:45:50 emonpi emonhub[14250]: emonhub.py: error: argument --logfile: can’t open ‘/var/log/emonhub/emonhub.log’: [Errno 13] Permission denied: ‘/var/log/emonhub/emonhub.log’
Nov 13 21:45:51 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 13 21:45:51 emonpi systemd[1]: emonhub.service: Failed with result ‘exit-code’.
^C

LOG FILE PERMISSIONS:

[email protected]:/var/log/emonhub $ ls -l /var/log/emonhub/emonhub.log
-rwxrwxr-x 1 root root 0 Nov 13 19:17 /var/log/emonhub/emonhub.log
[email protected]:/var/log/emonhub $

exact same output for me, really strange, mine was also a prebuilt/shipped card.

I have to edit this post as “new users” can only post 3 times, ffs.

Fixed this giving a 777 to /var/log/emonhub/emonhub.log

Yielding: -rwxrwxrwx 1 emonhub emonhub 60K Nov 14 10:54 emonhub.log

I guess the emonhub.service isn’t running as emonhub or a user in the group emonhub.

I’ve just booted up a new image and replicated the issue. I realise I made a mistake in the update script and did not pass a parameter the emonhub update script was expecting. I’ve now fixed this and pushed up the fix as an available update.

Could you both @drc @John_Woods try running an full update there to confirm that it works for you?

sure do I need to change permissions back first?

No the script should sort it all out

Script fixes it all, thank you!

1 Like

Thanks, good to hear

I’ve pushed your privileges up a notch, so you should be OK now. But if you saw the amount of spam and the like that we had to deal with under the old forum software, you’d fully understand the reason for these checks. As it is now, we can devote more time to helping genuine users like you - the snag is it takes Discourse (the software) a while to have confidence in you.

2 Likes