-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new version of paho-mqtt breaks mqtt messaging within pywws #116
Comments
I'll put that on my list to fix, alongside the self-cert issue. |
I've got a REALLY simple fix to this paho-mqtt version issue, as well as allowing self-certs. I'll send a pull request once I've tested a few more things. |
I just installed 24.8.0 and I was so hopeful ... but nothing changed. mqtt still broken. :-(
|
I will take a look and see if there are issues. |
Curious. I have that version installed on Python 3.9 with paho-mqtt 2.1, and it works fine for me. Could you please take a look at /home/m/.local/pipx/venvs/pywws/lib/python3.11/site-packages/pywws/service/mqtt.py and check that the first line after 'def def session(self):' is:
Thanks |
So yes I checked the file and mine looks a little different Here is a numbered copy paste from a vi edit ` 240 for line in template.splitlines(): 241 if line:
"mqtt.py" line 246 of 301 --81%-- col 5 ` m@domo: mqtt.py:* Mosquitto (a lightweight broker): http://mosquitto.org/ I do apologise that I am crucifying the formatting, inserting code in the tool seems not to do what I expected. |
I can see there that it is the old version of the file, so needs to be updated. I think @jim-easterbrook wold be better at answering why it didn't get upgraded correctly. |
I just redid the installation and show the output here for clarity
|
Does it work now? |
So when I reinstalled then no it still does not work and this is presumably because the mqtt.py file is as the github shows the code that does not include the V1 API call. |
You are absolutely correct. It seems to have been reverted somehow. I'll have to ask Jim. |
The commit history of The version on my local machine, from which the packages uploaded to PyPI were made, has these lines:
Does |
Ah okay, thanks Jim for replying. So your comment relates to stuff in /usr/local/bin. Indeed I checked and that was the result of an old installation. so it was a ` and then a reinstallation ` pipx install pywws==24.8.0 'pywws' already seems to be installed. Not modifying existing installation in BUT and BUT the issue still remains pywws is unable to talk to mqtt and I check the logs ... still bused |
Somehow the change I submitted was there, then wasn't. I'm not sure why (since Jim did the pull request). I need to get some time to spend on this; I had it working here until I took certs off my MQTT server because of issues with other software! We'll get it sorted. |
Did you make that change manually? Or has the build changed? |
Tim, I just made a quick vi edit, recycled pywws and hey presto, it is working. Like I say very happy, but yes pls push into the codebase. |
Apologies if this is not the right place for this, but I am struggling to get the mqtt service working. I suspect the issue is TLS - I haven't been able to configure it correctly with my MQTT installation (I'm a novice with this, especially with SSL/TLS) and I don't really need it for my purposes. Is there a way to disable TLS in the service configuration? When I leave the relevant parameters blank, pywws.hourly gives me "RuntimeError: "tls_ver" not set in weather.ini" so I suppose not. Many thanks! |
You might reach more MQTT users by asking on the pywws mailing list. |
Thanks! I'll give that a go if there is no way to use the Pywws mqtt service with TLS disabled -- which it sounds like is the case now? Thanks for the project overall as well, of course -- much appreciated! |
I used to have my MQTT broker (Mosquitto) secured but decided to open it because it is within my own network. For mosquito, create a .conf file e.g. /etc/mosquitto/conf.d/insecure.conf with the following:
which will open the broker on the default non-TLS port and not expect usernames/passwords. At the end of the pywws config file I have added the following:
I hope that helps. Tim |
Tim, that's fantastic -- now receiving the mqtt message perfectly! Thank you For anyone else reading this in the future: it seems the key is "auth = False" in the pywws config and dropping the TLS-related fields from the example given in the documentation. |
It seems the new version of paho-mqtt (v2.0.0) breaks the mqtt messaging within pywws.
pywws.service.mqtt:Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details
Work around is to install v1.6.1 of paho-mqtt
sudo pip install paho-mqtt==1.6.1
The text was updated successfully, but these errors were encountered: