Skip to content
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

Mosquitto update? #1543

Open
mstormi opened this issue Jun 28, 2021 · 18 comments
Open

Mosquitto update? #1543

mstormi opened this issue Jun 28, 2021 · 18 comments
Labels
analysis required Waiting for additional analysis optional component Not part of the base system question Further information is requested

Comments

@mstormi
Copy link
Contributor

mstormi commented Jun 28, 2021

We have v1.5.7, this is in debian/RaspiOS main repo.
But MQTTv5 requires the new v2.0+

See https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/.
Let's change to install from this dedicated repo.

We should also add a BATS test to avoid the following pitfall.

Attention: take care of breaking changes, latest mosquitto broke HA, see also
https://www.heise.de/news/Smarthome-mit-Home-Assistant-Vorsicht-bei-Update-des-MQTT-Brokers-6120728.html

@ecdye
Copy link
Contributor

ecdye commented Jun 29, 2021

I think we should wait for now, as OH probably has not updated the binding for MQTT for the updated version and as such it would be counterproductive to switch it now. I did not check to see if has been updated, it may have been but I would guess it has not.

I would still keep this issue open though because once OH does update the binding it will be a good idea to do so.

@mstormi
Copy link
Contributor Author

mstormi commented Jun 29, 2021

I'd think we should move to the mosquitto repo first.
For me - running mentioned 1.5.7 - this resulted in a new version being available but it was said to be "held back" and wasn't installed

@mstormi
Copy link
Contributor Author

mstormi commented Jun 29, 2021

I'd think independent of OH we should move to the mosquitto repo first.
For me - running mentioned 1.5.7 - this resulted in a new version being available but it was said to be "held back" and wasn't installed

@ecdye
Copy link
Contributor

ecdye commented Jun 29, 2021

Why go against openHAB, we want to provide the optimal user experience for openHAB so doing this would be contrary to one of our founding goals.

@mstormi
Copy link
Contributor Author

mstormi commented Jun 29, 2021

?? why is this against OH ? I just mean to upgrade to latest mosquitto (which is supposed to be downwards compatible, of course we would need to test)

@ecdye
Copy link
Contributor

ecdye commented Jun 30, 2021

If the latest upgrade is not compatible with OH it doesn't make sense to upgrade it unless I'm misunderstanding.

@mstormi
Copy link
Contributor Author

mstormi commented Jun 30, 2021

Of course. But I don't think it's incompatible, and I'm saying we need to test this before we merge.
This is a multi-step enhancement. First would be to change repo. As I wrote the current mosquitto repo gives us 1.5.7, too, which is right what our current Debian repo gives us.

@ecdye
Copy link
Contributor

ecdye commented Jun 30, 2021

Ahh, ok then. That makes more sense. If you want to create an initial PR I'll be more than happy to help review and test the changes.

I'm just a little wary of potentially breaking stuff that already works. As the old adage goes "Don't fix what ain't broke".

@ecdye ecdye changed the title mosquitto update ? Mosquitto update? Jun 30, 2021
@ecdye ecdye added optional component Not part of the base system analysis required Waiting for additional analysis question Further information is requested labels Jun 30, 2021
@mstormi
Copy link
Contributor Author

mstormi commented Aug 16, 2021

The 2.0 release notes say it brings a number of breaking changes.
https://mosquitto.org/documentation/migrating-to-2-0/

So let's stay with 1.5.7+ for the time being.
Eventually, offer the user to install 2.0 as an option.

@Larsen-Locke
Copy link
Contributor

I saw that the mqtt-binding in openhab now can be configured to use version 5.
Is there a plan to update openhabian, too?
My problem is that in zigbee2mqtt there are options that require version 5 (e.g. retain). Those can be configured within the web config page (not nice but I cannot control that). If you cannot switch to version 5 zigbee2mqtt will fail to start during the next reboot.

@mstormi
Copy link
Contributor Author

mstormi commented Sep 18, 2022

Is there a plan to update openhabian, too?

None that I know of.
Happy to take a PR.

Should you our anyone be willing to look into this, please provide an installation routine that also works unattended, providing a default mosquitto config.
So it's probably easiest to start from scratch here.

@Larsen-Locke
Copy link
Contributor

Larsen-Locke commented Sep 22, 2022

I would prefer to extend the current install routine. Maybe something like:

  1. Check if already installed
  2. if installation found ask to uninstall, else exit (what to do if unattended?)
  3. ask which Mosquitto version to install (1.x, 2.x) (to be safe if people still need old version)
  4. check Debian version and get matching mosquitto.list
  5. install

the rest would stay the same except a default password for unattended mode.
What do you think?

@mstormi
Copy link
Contributor Author

mstormi commented Sep 23, 2022

I won't prescribe how to implement but we want everything in openHABian to work a) unattended and b) interactive.
Any 3rd party SW needs an a) install and b) an uninstall routine. Calling that from a menu or script branch will then be easy. Plus when needed such as here c) a (config) setup routine. It ideally detects and adapts to the version installed.
I think the Mosquitto routine is well older than this concept hence my suggestion to start from scratch. Compare e.g. how tailscale or FIND are implemented.

If unattended, there cannot exist any prior installation.

On versions, we need separate menu items to select 1.x or 2.x and eventually a selector variable for unattended installations but staying with 1.x there should be fine for the time being.

@mstormi
Copy link
Contributor Author

mstormi commented Feb 6, 2023

@Larsen-Locke any plan on this ?

@Larsen-Locke
Copy link
Contributor

@Larsen-Locke any plan on this ?

not really, because I was not sure how to do this without the risk of causing trouble: As far as I understood the recent debian versions don't support mosquitto 2, so you have to import keys and then start the installation that fits to the debian version (buster, stretch etc.). The current bullseye lite supports mosquitto 2 so the installation works directly.
Because of all those versions I'm scared that people might end up with broken installations and demand support that I cannot provide.

@mstormi
Copy link
Contributor Author

mstormi commented Feb 7, 2023

Makes sense. Let's keep watching for now.

@miloit
Copy link

miloit commented Jun 5, 2023

Any work in progress?

@Larsen-Locke
Copy link
Contributor

Larsen-Locke commented Jun 5, 2023

well, not from my side.
During a fresh install of openhab (bullseye) the latest version of mosquitto (currently 2.0.11) will be installed.
There is no uninstall or update-function in openhabian cause then all versions of debian would have to be considered.
If you want/have to update mosquitto on an old openhab-installation then "apt remove mosquitto mosquitto-clients" has to be done first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis required Waiting for additional analysis optional component Not part of the base system question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants