Hi @glyn.hudson
I can now confirm I am using v1.4.8 of mosquitto. However I tried the updates to lightwaverf but it hasn’t fixed it yet.
I followed your instructions to clone, which worked:
git clone GitHub - openenergymonitor/lightwaverf-pi: a port of the arduino lightwaverf library to the raspberry pi
Cloning into ‘lightwaverf-pi’…
remote: Counting objects: 142, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 142 (delta 0), reused 0 (delta 0), pack-reused 139
Receiving objects: 100% (142/142), 30.81 KiB | 0 bytes/s, done.
Resolving deltas: 100% (67/67), done.
Checking connectivity… done.
although the compile threw out a few warning messages:
pi@emonpi:~/lightwaverf-pi $ make
gcc -fPIC -O3 -g -Wall -Werror -c -o lightwaverf.o lightwaverf.c
gcc -shared -Wl,-soname,liblightwaverf.so.0 lightwaverf.o -o liblightwaverf.so.0.1
ldconfig -v -n .
.:
liblightwaverf.so.0 → liblightwaverf.so.0.1 (changed)
ln -s liblightwaverf.so.0 liblightwaverf.so
gcc send.c -o send -L. -llightwaverf -lwiringPi
gcc receive.c -o receive -L. -llightwaverf -lwiringPi
gcc send2.c -o send2 -L. -llightwaverf -lwiringPi
gcc mqttsend.c -o mqttsend -L. -llightwaverf -lwiringPi -lpaho-mqtt3c
gcc lwrfmqtt.c -o lwrfmqtt -L. -llightwaverf -lwiringPi -lpaho-mqtt3c
lwrfmqtt.c:20:0: warning: “TRUE” redefined
#define TRUE 1
^
In file included from lightwaverf.h:9:0,
from lwrfmqtt.c:5:
/usr/include/wiringPi.h:31:0: note: this is the location of the previous definitiondefine TRUE (1==1)
^
lwrfmqtt.c:21:0: warning: “FALSE” redefined
#define FALSE 0
^
In file included from lightwaverf.h:9:0,
from lwrfmqtt.c:5:
/usr/include/wiringPi.h:32:0: note: this is the location of the previous definitiondefine FALSE (!TRUE)
^
pi@emonpi:~/lightwaverf-pi $ sudo make install
install -m 0644 liblightwaverf.so.0.1 /usr/local/lib
ldconfig
ln -f -s /usr/local/lib/liblightwaverf.so.0 /usr/local/lib/liblightwaverf.so
install -m 0644 *.h /usr/local/include
install -m 0755 lwrfmqtt /usr/local/bin
install -m 0755 lwrfd /etc/init.d
I then rebooted, and checked the log, but sorry to say it still looks like a problem:
grep -i mqtt /var/log/syslog
May 26 21:12:40 emonpi systemd[1]: Starting LSB: LightwaveRF MQTT daemon startup…
May 26 21:12:40 emonpi systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker…
May 26 21:12:40 emonpi lwrfd[439]: Starting LightwaveRF MQTT daemon: lwrfd.
May 26 21:12:40 emonpi lwrfd[488]: Failed to connect to MQTT, return code -1
May 26 21:12:40 emonpi systemd[1]: Started LSB: LightwaveRF MQTT daemon startup.
May 26 21:12:40 emonpi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
It looks as though the loop to check if it is connected and sleep for 10 isn’t working? Could this be related to the compiler warning messages about TRUE being redefined, and affecting the connected = TRUE; on line 186?
I restarted the lwrfd service manually and it worked correctly. Can you take another look?