Pukka
(Paul)
1
Hi all,
I have been running the later version for the emonpi low-write 9.8.25, some of the inputs stopped working today
2017-12-04 09:08:24.215|WARN|phpmqtt_input.php|Starting MQTT Input script
2017-12-04 09:08:25.480|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-12-04 09:08:25.481|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-12-04 09:08:25.482|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-12-04 09:08:25.482|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-12-04 09:08:28.510|WARN|phpmqtt_input.php|Starting MQTT Input script
2017-12-04 09:08:29.644|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-12-04 09:08:29.644|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-12-04 09:08:29.645|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-12-04 09:08:29.645|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-12-10 08:51:06.452|ERROR|phpmqtt_input.php|exception 'Mosquitto\Exception' with message 'The client is not currently connected.' in /var/www/emoncms/scripts/phpmqtt_input.php:112
Stack trace:
#0 /var/www/emoncms/scripts/phpmqtt_input.php(112): Mosquitto\Client->loop()
#1 {main}
2017-12-10 08:51:07.257|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-12-12 07:09:49.215|ERROR|phpmqtt_input.php|exception 'Mosquitto\Exception' in /var/www/emoncms/scripts/phpmqtt_input.php:112
Stack trace:
#0 /var/www/emoncms/scripts/phpmqtt_input.php(112): Mosquitto\Client->loop()
#1 {main}
2017-12-12 07:09:51.433|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-12-12 07:19:14.784|ERROR|phpmqtt_input.php|exception 'RedisException' with message 'read error on connection' in /var/www/emoncms/Modules/process/process_processlist.php:657
Stack trace:
#0 /var/www/emoncms/Modules/process/process_processlist.php(657): Redis->exists('process:whaccum...')
#1 [internal function]: Process_ProcessList->wh_accumulator('17', 1513062619, 2487, NULL, Object(Process))
#2 /var/www/emoncms/Modules/process/process_model.php(60): call_user_func_array(Array, Array)
#3 /var/www/emoncms/Modules/process/process_model.php(103): Process->__call('wh_accumulator', Array)
#4 /var/www/emoncms/Modules/process/process_model.php(103): Process->wh_accumulator('17', 1513062619, 2487, NULL)
#5 /var/www/emoncms/scripts/phpmqtt_input.php(270): Process->input(1513062619, '2487', '1:16,2:1,34:17')
#6 [internal function]: message(Object(Mosquitto\Message))
#7 /var/www/emoncms/scripts/phpmqtt_input.php(112): Mosquitto\Client->loop()
#8 {main}
[attached is the log file emoncms(1).txt (2.4 KB)]
I logged in via SSH
sudo systemctl restart mqtt_input
did not make any difference
but
sudo service emonhub restart
kick it back in to life. I did try restarting from the web interface
Paul
[Title was ambiguous - expanded to clarify. Moderator (RW)]
pb66
(Paul)
2
Hi Paul, Can you tells us about the inputs that stopped. Would I be right in thinking they were all RFM networked? (eg emonTH emonTx etc)
Can you supply the emonhub.log if it reoccurs?
Thanks for supplying the emoncms.log, whilst I do not think any of those errors are the cause of this issue, Iâm sure the info will be useful.
Pukka
(Paul)
3
Hi Paul
Where do i find the emoncms.log (it would be great if they was a button on the web interface that would zip up all of the log files and allow you to download them)
The interfaces that stopped Emonpi, emonth5, BMWi3, 2 x node-red (modbus) 1x node-red (weather).
Interfaces still working were openevse and IotaWatt
pb66
(Paul)
4
You have already shown us the emoncms.log, which is accessible/downloadable via the emoncms=>admin page, the emonhub.log is accessible and downloadable via the emoncms=>emonhub page (on an emonSD).
I assume you are running the latest emonSD on and emonPi? You say emoncms is the latest, have you updated via the âupdate emonpiâ button in emoncms=>admin?
At this point I have no idea how restarting emonHub could impact the â2 x node-red (modbus) 1x node-red (weather).â inputs directly, I assume they are posting direct to emoncms and not through emonHub, are they posting via MQTT or HTTP?
Pukka
(Paul)
5
I will keep my eye on it and grab the log files next time they is a problem
The node-red is posting via MQTT the same as the inbuilt weather flow
The update was installed via the âupdate emonpiâ on admin, also click the database update&check
Pukka
(Paul)
6
It has crashed again.
Screenshot and log files attached.
emoncms(2).txt (7.5 KB)
emonhub.txt (773.8 KB)
sudo systemctl status mqtt_input -n50 -l
â mqtt_input.service - Emoncms MQTT Input Script
Loaded: loaded (/etc/systemd/system/mqtt_input.service; enabled)
Active: active (running) since Tue 2017-12-19 21:31:16 GMT; 4 days ago
Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
Main PID: 3275 (php)
CGroup: /system.slice/mqtt_input.service
ââ3275 /usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php
Dec 24 01:44:26 emonpi mqtt_input[3275]: PHP Fatal error: Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/input/input_model.php on line 605
Dec 24 01:44:26 emonpi mqtt_input[3275]: Fatal error: Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/input/input_model.php on line 605
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
I will leave it in a broken state for a few hours if you would like a remote session to have a look, just send me a PM
Paul
Try and update to 9.8.27:
This release includes a significant fix to mqtt input script. The issue was the MYSQL connection was timing out after the mqtt input script had been working for a while. This has now been fixed.
Pukka
(Paul)
8
I have upgraded and will report back in a few days.
Pukka
(Paul)
9
just been to look and it looks like the MQTT service stopped 2 days ago
Pukka
(Paul)
10
I am still having a problem with the a service stopping or crashing, i have upgraded to the latest version low-write 9.8.27
If i look under administration it reports âDaemon is not running, start it at ~/scripts/feedwriterâ
emoncms log looks like
2018-01-20 19:17:01.688|ERROR|phpmqtt_input.php|exception âErrorExceptionâ with message âInvalid argument supplied for foreach()â in /var/www/emoncms/Modules/input/input_model.php:197
Stack trace:
#0 /var/www/emoncms/Modules/input/input_model.php(197): exceptions_error_handler(2, âInvalid argumenâŚâ, â/var/www/emoncmâŚâ, 197, Array)
#1 /var/www/emoncms/Modules/input/input_model.php(182): Input->redis_get_inputs(1)
#2 /var/www/emoncms/scripts/phpmqtt_input.php(220): Input->get_inputs(1)
#3 [internal function]: message(Object(Mosquitto\Message))
#4 /var/www/emoncms/scripts/phpmqtt_input.php(116): Mosquitto\Client->loop()
#5 {main}
2018-01-20 19:17:01.690|ERROR|phpmqtt_input.php|exception âErrorExceptionâ with message âInvalid argument supplied for foreach()â in /var/www/emoncms/Modules/input/input_model.php:200
Stack trace:
#0 /var/www/emoncms/Modules/input/input_model.php(200): exceptions_error_handler(2, âInvalid argumenâŚâ, â/var/www/emoncmâŚâ, 200, Array)
#1 /var/www/emoncms/Modules/input/input_model.php(182): Input->redis_get_inputs(1)
#2 /var/www/emoncms/scripts/phpmqtt_input.php(220): Input->get_inputs(1)
#3 [internal function]: message(Object(Mosquitto\Message))
#4 /var/www/emoncms/scripts/phpmqtt_input.php(116): Mosquitto\Client->loop()
#5 {main}
2018-01-20 19:17:01.702|ERROR|phpmqtt_input.php|exception âErrorExceptionâ with message âInvalid argument supplied for foreach()â in /var/www/emoncms/Modules/input/input_model.php:197
Stack trace:
#0 /var/www/emoncms/Modules/input/input_model.php(197): exceptions_error_handler(2, âInvalid argumenâŚâ, â/var/www/emoncmâŚâ, 197, Array)
#1 /var/www/emoncms/Modules/input/input_model.php(182): Input->redis_get_inputs(1)
#2 /var/www/emoncms/scripts/phpmqtt_input.php(220): Input->get_inputs(1)
#3 [internal function]: message(Object(Mosquitto\Message))
#4 /var/www/emoncms/scripts/phpmqtt_input.php(116): Mosquitto\Client->loop()
#5 {main}
Anything to try?
It looks like the feedwriter scrip has stopped this can be restarted with
sudo service feedwriter restart
This question is why is stopped in the first place. This error is interesting, Iâve not seen this before:
What version emonSD are you running?
What are you running on the emonPi? What inputs are you posting? Anything non standard?
If you update to the latest version V9.8.28 (via emonPi update) you will be able to copy all the info admin info page. Please paste the full output here:
See the copy to clipboard button
Pukka
(Paul)
12
Hi Glyn,
I am running 2.8.27
I did try running âsudo service feedwriter restartâ and the buffer counted down but the data was still missing.
Input wise i have 2 node-red running modbus every 5 seconds, BMW input, OpenEVSE, EmonPi, Iotawatt, weather.
I have clicked the emonpi update button but it has not download the latest version
Paul
Thatâs strange, emonPi update should update to 9.8.28. Please post your emonpiupdate log
Pukka
(Paul)
14
Log File Attached emonpiupdate.txt (6.9 KB)
Thanks. From the logfile is seems that default.emonpi.settings.php and settings.php have been user modified. The change to default.emonpi.settings.php is causing emonPi update to not be able to pull in any new changes.
Ifâs possible to keep your custom settings in settings.php and just restore default.emonpi.settings.php to itâs default state. This file is is only used to store the default settings for reference, its not actually used by the application. You can reset default.emonpi.settings.php back to itâs default state by running
rpi-rw
cd /var/www/emoncms
git checkout default.emonpi.settings.php
git pull
The final git pull command should now pull in the latest changes and update you to 9.8.28. This wonât necessarily fix the issue you have reported but should enable us to debug on a common platform. Once updated to 9.8.28 please use the new copy to clipboard function to copy your Emoncms system info to clipboard and paste into the forum. It should look something like this:
It looks like Iâm having the same issue. Trystan recommended I update to 9.8.28 as Glyn suggested. So, letâs run this and see what happens.
Paul, Are you having a failure between 2 and 6 days the same as I am?
Also, Can you send me a few excerpts of your raw input?
Thanks
Bernie Carter
Pukka
(Paul)
18
Hi @Bernie_Carter
Yes that sounds correct. It looks like itâs something to do with the MQTT /nodered service, as anything that is posting to that stops. But other services like openevse and iotawatt till post ok.
I am away at the moment so I am unable to post any log files
Paul
@Pukka
That is possible, I will review my logs again and see, but I didnât notice anything out of line the first run through. Just a reference to a broken pipe.
Iâve had a ton of issues with nodered right from the start. In fact this is my 3 try at keeping it going. The first two ran into all kinds of programming issues, and had to be wiped to clear all.
Itâs also possible that your issue is unrelated to mine, they just have similar outcomes.
Bernie Carter
Pukka
(Paul)
20
It has just crashed again, does anyone want to login and have a look at it? I will leave it broken over night.
Paul