New emonSD release: emonSD-30Oct18 (Raspbian Stretch Pi3B+ compatible) šŸŽ‰

This was discussed in great length already, and thereā€™s a link to the discussion in Glynā€™s first post in this thread. Have a read through that discussion - the argument has already been lost :wink:

Iā€™ve not been able to revive a couple of inputs - i.e. those from Robinā€™s Mk2 pv diverter. The standard emontx and emonth nodes have been picked up and are updating, but not these additional ones. The imported backup file has these nodes (basically node ā€˜12ā€™ and ā€˜13ā€™) listed in inputs, but null values. The log file shows an error:

2018-11-14 00:44:16.296|ERROR|phpmqtt_input.php|ErrorException: Undefined index: nodeid in /var/www/emoncms/Modules/input/input_model.php:206

but Iā€™m on the edge of my knowledge hereā€¦do I need to edit the script on the diverter (which I presume is still transmitting the data with the same format) or do I need to try and find these nodes in the php script?

3 posts were split to a new topic: Getting started with energy monitoring using RasPi + CT sensors

Fixed it - basically needed to edit the emonHub config nodes and delete the old ones :smile:

2 Likes

Thanks everyone. I did a full backup for everything in keep in case of trouble, butā€¦

The backup/SDcard2018/import works fine.

The one issue which might be nothing is that I the ā€˜averdudeā€™ I updated.

At the end of the procedure it saidā€¦

=============================================
avrdude-original: safemode: lfuse reads as 0
avrdude-original: safemode: hfuse reads as 0
avrdude-original: safemode: efuse reads as 0
avrdude-original: safemode: Fuses OK (E:00, H:00, L:00)
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

avrdude-original done. Thank you.

strace: |autoreset: Broken pipe

Is that just then drop the connection? In which case nothing to worried aboutā€¦

Thanks for everyone for the adviceā€¦

I think that error just means that the firmware upload tool could not connect to the emonpi board, did you share the details of your system? Is it an emonpi?

Thatā€™s nothing to worry about. The FW updated successfully this strace error happens when avrdude finishes. Itā€™s due to our modified avrdude with ā€œauto resetā€ to auto toggle a GPIO pin on a RasPi to reset the AVR controller.:

I did try and track this message down in the past but didnā€™t manage to fix it. Agree it would be best if the error wasnā€™t there! But nothing to worry about.

1 Like

I have just reboot my emonpi and i am getting:

Canā€™t connect to database, please verify credentials/configuration in settings.php
Error message: Connection refused

in the log file I am seeing

Nov 18 21:48:52 emonpi systemd[1]: Started Emoncms MQTT Input Script.
Nov 18 21:48:52 emonpi mqtt_input[11753]: PHP Fatal error:  Uncaught ErrorException: mysqli::__construct(): (HY00$
Nov 18 21:48:52 emonpi mqtt_input[11753]: Stack trace:
Nov 18 21:48:52 emonpi mqtt_input[11753]: #0 [internal function]: exceptions_error_handler(2, 'mysqli::__const...$
Nov 18 21:48:52 emonpi mqtt_input[11753]: #1 /var/www/emoncms/scripts/phpmqtt_input.php(61): mysqli->__construct($
Nov 18 21:48:52 emonpi mqtt_input[11753]: #2 {main}
Nov 18 21:48:52 emonpi mqtt_input[11753]:   thrown in /var/www/emoncms/scripts/phpmqtt_input.php on line 61
Nov 18 21:48:52 emonpi mqtt_input[11753]: Fatal error: Uncaught ErrorException: mysqli::__construct(): (HY000/200$
Nov 18 21:48:52 emonpi mqtt_input[11753]: Stack trace:
Nov 18 21:48:52 emonpi mqtt_input[11753]: #0 [internal function]: exceptions_error_handler(2, 'mysqli::__const...$
Nov 18 21:48:52 emonpi mqtt_input[11753]: #1 /var/www/emoncms/scripts/phpmqtt_input.php(61): mysqli->__construct($
Nov 18 21:48:52 emonpi mqtt_input[11753]: #2 {main}
Nov 18 21:48:52 emonpi mqtt_input[11753]:   thrown in /var/www/emoncms/scripts/phpmqtt_input.php on line 61

Glyn

Thanks for the info. I may have missed it but how do I get the new card into the pi?

If you are referring to the emonPi, you will need to open up the enclosure and insert the SD card into the RaspberryPi. See this overview video showing the inside of the emonPi:

Glyn,

New Micro SD arrived today (16GB ? iso 8GB). Sorry for this silly question, just want to make sure. I assume I do a backup. Remove the old SD then insert the new SD and then do an ā€œImport Backupā€.

Regards
John

The base emonSD image is 8GB, we have expanded the data partition to fill the 16GB card. One of the main reasons for this is at 16GB cards are now cheaper and easier to source than 8GB! Economics of scale I guess. No harm in having more storage space.

Correct, before you remove the old card update your old emonPi then run an export using the backup module. Once done, download the compressed backup file.

Then once your up and running with the new image perform an import.

See full instructions here:

https://guide.openenergymonitor.org/setup/import

I also have old hardware:

  • Pi Model B gen 1 EmonHub with old RFM12B radio runing emonSD-07Nov16 image
  • EmonTX v3 with old firmware

The emonSD-30Oct18 image didnā€™t boot on the old Pi 1, but I booted it on a Pi 3 where I was able to make the changes to /boot/config.txt suggested (three items to comment out) and it booted okay to login. I reverted emonhub.conf to 9600 baud for the radio, then I got stuck as Iā€™m not able to pick up my feeds. Itā€™s not a big deal ā€“ Iā€™m well overdue to update my hardware, Iā€™ll go back to emonSD-07Nov16 until I figure it out.

2018-12-02 18:35:12,539 INFO MainThread EmonHub emonHub emon-pi variant v2.1.1
2018-12-02 18:35:12,543 INFO MainThread Opening hubā€¦
2018-12-02 18:35:12,579 INFO MainThread Logging level set to DEBUG
2018-12-02 18:35:12,583 INFO MainThread Creating EmonHubJeeInterfacer ā€˜RFM2Piā€™
2018-12-02 18:35:12,649 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2018-12-02 18:35:14,656 WARNING MainThread Device communication error - check settings
2018-12-02 18:35:14,661 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2018-12-02 18:35:15,666 INFO MainThread Setting RFM2Pi group: 210 (210g)
2018-12-02 18:35:16,671 INFO MainThread Setting RFM2Pi quiet: 0 (0q)

Mm it sounds like emonHub cannot communite with your RFM12B. Was the your RFM12B connected?

Could you try and see if you can view serial data directly from the modue using minicom:

sudo service emonhub stop
minicom -D /dev/ttyAMA0 -b9600

To exit minicom use [CTRL + A] then [X] then select yes

Glyn

I can confirm I have emonSD-30Oct18 running well with old hardware:

emonBase

  • RFM12Pi v2.6 with RFM12B
  • Raspberry Pi 1 model B

emonTX v3.2 (RFM12B)

It took me some time to figure out the radio connection. Minicom used as advised would return garbarge. I thought I had a hardware problem, but the Green light on the RFM12B was flashing regularly suggesting it was working. I played around and changed the baud rate on minicom to 38400 and it worked. I went back to my emonhub.conf, and changed the baud from 9600 (where its been for 4yrs!) to 38400, and it came back to life.

I canā€™t really explain. In my messing around, I did reflash the firmware on the RFM12B:

sudo avrdude -v -p atmega328p -c arduino -P /dev/ttyAMA0 -b 38400 -U flash:w:/home/pi/RFM2Pi/firmware/RFM69CW_RF_Demo_ATmega328/RFM12_Demo_ATmega328.cpp.hex:i

anyway, all working :smile:

2018-12-09T00:00:00Z

2 Likes

I noticed no US based download repo. I might be able to host for you if interested.

That would be great, thanks. Please post a link to your mirror and I will add it to the download page.

I have just installed this version on a new SD Card, expanded the card to the full 16Gb and then restored my backup from the old card.

When I click emonpi update, the EmonCMS > Writer status then changes to: Daemon is not running, start it at ~/scripts/feedwriter.

Update log attached.

Thanks

Ian

emonpiupdate.txt (7.8 KB)

Did you enable SSH? If so try

sudo systemctl status feedwriter.service

(and please post output) then

sudo systemctl start feedwriter.service

followed by the status.

I wonder if the backup is taking a setting, the update changes it, but the restore overwrites it. @glyn.hudson @TrystanLea

I note this line in the log

restarting service-runner
service-runner: no process found

use the commands above on service-runner to check itā€™s status.

On the admin page next to the Server Information there is a copy to clipboard button. Please press that then paste the result into a message - no other formatting required.

After Clicking Update:

ā— feedwriter.service - LSB: feedwriter script daemon
Loaded: loaded (/etc/init.d/feedwriter; generated; vendor preset: enabled)
Active: active (exited) since Wed 2019-01-16 20:01:21 UTC; 18min ago
Docs: man:systemd-sysv-generator(8)
CGroup: /system.slice/feedwriter.service
Jan 16 20:01:14 emonpi systemd[1]: Starting LSB: feedwriter script daemonā€¦
Jan 16 20:01:14 emonpi feedwriter[1200]: Log is turned off
Jan 16 20:01:14 emonpi feedwriter[1200]: Starting RPI
Jan 16 20:01:21 emonpi systemd[1]: Started LSB: feedwriter script daemon.

ā— service-runner.service - Emoncms service-runner Input Script
Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runner.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-01-16 20:19:35 UTC; 1min 54s ago
Main PID: 2828 (python)
CGroup: /system.slice/service-runner.service
ā””ā”€2828 /usr/bin/python /var/www/emoncms/scripts/services/service-runner/service-runner.py
Jan 16 20:19:35 emonpi systemd[1]: Started Emoncms service-runner Input Script.
Jan 16 20:19:35 emonpi service-runner[2828]: Starting service-runner
Jan 16 20:19:35 emonpi service-runner[2828]: Connected to redis-server

then After sudo systemctl restart feedwriter.service:

ā— service-runner.service - Emoncms service-runner Input Script
Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runner.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-01-16 20:19:35 UTC; 4min 36s ago
Main PID: 2828 (python)
CGroup: /system.slice/service-runner.service
ā””ā”€2828 /usr/bin/python /var/www/emoncms/scripts/services/service-runner/service-runner.py
Jan 16 20:19:35 emonpi systemd[1]: Started Emoncms service-runner Input Script.
Jan 16 20:19:35 emonpi service-runner[2828]: Starting service-runner
Jan 16 20:19:35 emonpi service-runner[2828]: Connected to redis-server

Server Information
Emoncms Version low-write 9.9.5
Modules Administration : App v1.2.0 : Backup v1.1.6 : EmonHub Config v1.0.0 : Dashboard v1.3.1 : Device v1.2.0 : EventProcesses : Feed : Graph v1.2.1 : Input : Postprocess v1.0.0 : CoreProcess : Schedule : Network Setup v1.0.0 : sync : Time : User : Visualisation : WiFi v1.3.0
Git URL GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data
Git Branch * stable
Buffer loadingā€¦
Writer Daemon is not running, start it at ~/scripts/feedwriter
Server OS Linux 4.14.79-v7+
Host emonpi emonpi (10.101.0.254)
Date 2019-01-16 20:20:17 UTC
Uptime 20:20:17 up 19 min, 1 user, load average: 0.16, 0.15, 0.15
HTTP Server Apache/2.4.25 (Raspbian) HTTP/1.1 CGI/1.1 80
MySQL Version 5.5.5-10.1.23-MariaDB-9+deb9u1
Host 127.0.0.1 (127.0.0.1)
Date 2019-01-16 20:20:17 (UTC 00:00ā€Œā€‹)
Stats Uptime: 1149 Threads: 3 Questions: 1110 Slow queries: 0 Opens: 30 Flush tables: 1 Open tables: 24 Queries per second avg: 0.966
Redis Version 3.2.6
Host localhost:6379 (127.0.0.1)
Size 143 keys (762.49K)
Uptime 0 days
MQTT Server Version Mosquitto 1.4.10
Host localhost:1883 (127.0.0.1)
Pi Model Raspberry Pi 3 Model B Rev 1.2 - 1 GB (Stadium)
SoC Broadcom BCM2835
Serial num. DA17602B
Temperature CPU: 49.93Ā°C - GPU: 49.9ā€™C
Release emonSD-30Oct18
File-system Current: read-write - Set root file-system temporarily to read-write, (default read-only)
Memory RAM Used: 20.78% Total: 976.74 MB Used: 202.92 MB Free: 773.82 MB
Swap Used: 0.00% Total: 100 MB Used: 0 B Free: 100 MB
Disk Mount Stats
/ Used: 47.16% Total: 3.81 GB Used: 1.8 GB Free: 1.84 GB
/boot Used: 51.78% Total: 42.52 MB Used: 22.02 MB Free: 20.5 MB
/home/pi/data Used: 1.19% Total: 10.66 GB Used: 129.98 MB Free: 9.99 GB
PHP Version 7.0.33-0+deb9u1 (Zend Version 3.0.0)
Modules apache2handler : calendar v7.0.33-0+deb9u1 : Core v7.0.33-0+deb9u1 : ctype v7.0.33-0+deb9u1 : curl v7.0.33-0+deb9u1 : date v7.0.33-0+deb9u1 : dom v20031129 : exif v7.0.33-0+deb9u1 : fileinfo v1.0.5 : filter v7.0.33-0+deb9u1 : ftp v7.0.33-0+deb9u1 : gd v7.0.33-0+deb9u1 : gettext v7.0.33-0+deb9u1 : hash v1.0 : iconv v7.0.33-0+deb9u1 : igbinary v2.0.1 : json v1.4.0 : libxml v7.0.33-0+deb9u1 : mbstring v7.0.33-0+deb9u1 : mcrypt v7.0.33-0+deb9u1 : mosquitto v0.4.0 : mysqli v7.0.33-0+deb9u1 : mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ : openssl v7.0.33-0+deb9u1 : pcre v7.0.33-0+deb9u1 : PDO v7.0.33-0+deb9u1 : pdo_mysql v7.0.33-0+deb9u1 : Phar v2.0.2 : posix v7.0.33-0+deb9u1 : readline v7.0.33-0+deb9u1 : redis v4.1.1 : Reflection v7.0.33-0+deb9u1 : session v7.0.33-0+deb9u1 : shmop v7.0.33-0+deb9u1 : SimpleXML v7.0.33-0+deb9u1 : sockets v7.0.33-0+deb9u1 : SPL v7.0.33-0+deb9u1 : standard v7.0.33-0+deb9u1 : sysvmsg v7.0.33-0+deb9u1 : sysvsem v7.0.33-0+deb9u1 : sysvshm v7.0.33-0+deb9u1 : tokenizer v7.0.33-0+deb9u1 : wddx v7.0.33-0+deb9u1 : xml v7.0.33-0+deb9u1 : xmlreader v7.0.33-0+deb9u1 : xmlwriter v7.0.33-0+deb9u1 : xsl v7.0.33-0+deb9u1 : Zend OPcache v7.0.33-0+deb9u1 : zlib v7.0.33-0+deb9u1
Client Information
HTTP Browser Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15
Screen Resolution 1440 x 900
Window Size 1440 x 730