AllskyTeam / allsky-modules

User modules for allsky
MIT License
17 stars 17 forks source link

Module allsky_publishdata.py failed on MQTT data publication #120

Open PiotrNomad opened 3 months ago

PiotrNomad commented 3 months ago

Describe the bug When trying to publish data to MQTT broker the module throws the exception in allsky.log: ERROR: Module allsky_publishdata.py failed on line 224 - Client.init() missing 1 required positional argument: 'callback_api_version' Nothing beeing published to MQTT.

To Reproduce Steps to reproduce the behaviour:

  1. install BookWorm 32 bit lite on Rasberry pi
  2. install Allsky
  3. install publishdata module
  4. configure MQTT broker
  5. Activate publishdata module
  6. Restrt Allsky
  7. Waith for the 1st picture publication
  8. See error in /var/logs/allsky.log

Expected behaviour No error in log data been published

Allsky Information:

Additional context It seams thst this is typical behavior on BookWorm Rasbian. I had the same issue with my code and solved it by: client = paho.Client(paho.CallbackAPIVersion.VERSION1)

PiotrNomad commented 3 months ago

Some resources: https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html https://stackoverflow.com/questions/77984857/paho-mqtt-unsupported-callback-api-version-error

PiotrNomad commented 3 months ago

When I change theline 254 from: client = paho.Client(client_id="", userdata=None, protocol=paho.MQTTv5) to: client = paho.Client(paho.CallbackAPIVersion.VERSION1, client_id="", userdata=None, protocol=paho.MQTTv5) it works :)

Alex-developer commented 3 months ago

Thanks I'll take a look once I have finished testing the next release of Allsky