Publish to mqtt from a http input process not working

Hi,
I set up a new emoncms on a Raspberry Pi, and I copied my old database to it.
Now I have a problem. Inputs which comes from a http post are not processed by “publish to mqtt” in the process list.

Only mqtt-inputs are published to the mqtt brooker.

My question now, is there something changed over the time in emoncms that it is not more provided? In my old emoncms version it was working.

What I would like to add:
When I use for example the command on the same Inputs ID it is working.
mosquitto_pub -u ‘emonpi’ -P ‘emonpimqtt2016’ -t ‘emon/2/T_Carport’ -m ‘21.8’

The error seems, that the “publish to myqtt” trigger in the processlist is not activated by posting it from a http post.

Nice greetings
Torsten

Hello @torsten099 While I havent tested this recently, it looks like it should still work from the code. Do you have MQTT enabled in settings.ini?

Hi Trystan,
yes it’s enabled and working. But it’s only working on Inputs which are not posted from an fulljson http request.

Yesterday I installed the current emoncms on my laptop. I wanted to know if there is the same issue, but no it is working properly on my laptop. When I have time I will setup a new Raspberry installation, and hope it is then fixed.

Today I found a solution. Here are the commands that fixed it for the Raspberry Pi 5.

sudo apt-get install -y libmosquitto-dev
git clone https://github.com/openenergymonitor/Mosquitto-PHP
cd Mosquitto-PHP/
phpize
./configure
make
sudo make install
PHP_VER=$(php -v | head -n 1 | cut -d " " -f 2 | cut -f1-2 -d"." )
printf "extension=mosquitto.so" | sudo tee /etc/php/$PHP_VER/mods-available/mosquitto.ini 1>&2
sudo phpenmod mosquitto
sudo reboot

I can not explain why, but maybe some other’s can it also help.

Bye.

@TrystanLea - can you comment?

Hello @torsten099 those are the steps from EmonScripts/install/mosquitto.sh at master · openenergymonitor/EmonScripts · GitHub for installing the MQTT dependencies. It sounds like the Mosquitto PHP client was not installed?