I’m a bit at loss.
I’ve installed Emoncms on a local Ubuntu 18.04 server.
Redis is up, mqtt up and working, apache also.
I can enter the gui on my local server.
I can add input through url’s and see the inputs. SO all seems fine.
BUT, somehow I failt to get emoncms_mqtt working. It works shortly, and I do get data into inputs through the MQTT broker, but the emoncms_mqtt fails after 10 second running.
If I run the emoncms_mqtt.php script, I can see where it fails, but I don’t get why it fails… (see below).
Anyone an idea what could be at hand?
stan@local:~# /usr/bin/php /var/www/html/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php
PHP Fatal error: Uncaught Error: Call to a member function hgetall() on boolean in /var/www/html/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php:155
Stack trace:
#0 {main}
thrown in /var/www/html/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php on line 155
Fatal error: Uncaught Error: Call to a member function hgetall() on boolean in /var/www/html/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php:155
Stack trace:
#0 {main}
thrown in /var/www/html/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php on line 155
I am beginning to wonder if it is because it is trying to access a key that might not exist - I cannot test until tonight what happens. However, I cannot believe that this has not appeared before but…
Once you have installed phpredis by pecl - if the error still exists, add in a ‘publish to mqtt’ element in an input process (do not use ‘emon’ as the base topic) and see if the error goes away.
I followed your suggestions (purged the ubuntu version, reinstalled redis )
Phpinfo gives this:
Redis Support: enabled
Redis Version: 4.3.0
Available serializers: php, igbinary
Unfortunately, it still fails after about 10 seconds…
So how about the “add in a ‘publish to mqtt’ element in an input process”. I would like to test that, but could you please give a hint of where/how to do that? In Emoncms or CLI, or send a MQTT from another computer?
Ah, while looking there I notice that some options are grayed out “(needs REDIS)” behind them.
So I do get the feeling that emoncms is not using REDIS somehow??
And now I feel a bit stupid… I had it enabled at first, but that didn’t work… So I disabled it, followed your settings/install advice, but forgot to reenable it.
So now it works! I’m very happy!
Many many thanks! Wonderful to be helped here so quickly and gently!