volkszaehler / vzlogger

Logging utility for various meters & sensors
http://wiki.volkszaehler.org/software/controller/vzlogger
GNU General Public License v3.0
145 stars 124 forks source link

Mosquitto/MQTT with major version 2 won't start #502

Open ngoldack opened 3 years ago

ngoldack commented 3 years ago

Hi all, when trying to configure vzlogger with mqtt I approched following error:

[Oct 10 23:42:29][mqtt] MqttClient::MqttClient called
[Oct 10 23:42:29][mqtt] using libmosquitto 2.0.11
[Oct 10 23:42:29][mqtt] Wrong libmosquitto major version! 2 vs. expected 1! Stopped.
[Oct 10 23:42:29][mqtt] ~MqttClient called
[Oct 10 23:42:29][mqtt] mqtt client not configured. stopped.

I'm using a mosquitto broker with the newest version of 2.0.11.

I've inspected the source code and found that in mqtt.cpp it checks for the major version 1. Is it possible to make it work for major version 2?

xwox commented 2 years ago

Hello, Does anyone know a work around?

mbehr1 commented 2 years ago

I think after a quick test/evaluation of the difference of version 1 to version 2 we can simply relax the check. (can take a look on the weekend as well)

Matthias

Am 15.11.2021 um 16:12 schrieb xwox @.***>:

Hello, Does anyone know a work around?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/volkszaehler/vzlogger/issues/502#issuecomment-969007645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY3UC4RQWCE7ZW4HJNO2M3UMEPM3ANCNFSM5FW5JFDA.

mbehr1 commented 2 years ago

So the problem seems that the include file mosquitto.h defines LIBMOSQUITTO_MAJOR as 1 where as the mosquitto_lib_version reports it as 2.

mbehr1 commented 2 years ago

This looks like the include dir / included header version does not the match the version linked to. @xwox, can you add your cmake output (should include "search for libmosquitto returned ...")? Thx.

xwox commented 2 years ago

This looks like the include dir / included header version does not the match the version linked to. @xwox, can you add your cmake output (should include "search for libmosquitto returned ...")? Thx.

I simply changed the make file so the version 2 is also accepted. everything seems to work.

mbehr1 commented 2 years ago

@xwox so this can be closed, or?

Josef69 commented 2 years ago

@ngoldack could you find a solution for your problem? I have jet the same problem and hope you can help me.