dmslabsbr / hoymiles

Hoymiles ADD-ON for Home Assistant
119 stars 30 forks source link

MQTT not working after update #174

Closed martinhoess closed 1 month ago

martinhoess commented 1 month ago

Did the update from 1.1.7 to 1.4.0 and now my entities are missing

image

connection from "outside" works fine image

Restoring to 1.1.7 and everything works fine

Cosik commented 1 month ago

Sorry need full debug logs. I also get confirmation that stable version is working ok.

martinhoess commented 1 month ago

_addon_44349f66_hoymiles_solardata_stable_logs.txt

doesn't look like it contains much more (usefull) information

Cosik commented 1 month ago

Please try to fully remove addon and install again. It looks like your Broker has problem with generated client_id.

martinhoess commented 1 month ago

Nope, same problem after a complete new install

image

If it helps, the MQTT is running within the Node Red addon (https://flows.nodered.org/node/node-red-contrib-aedes). But as I said, 1.1.7 worked without any problems

image image

martinhoess commented 1 month ago

How long is the generated client identifier? https://github.com/moscajs/aedes/blob/1a191b0dfdfbf17b99120cd1a438de0deb019a88/lib/handlers/connect.js#L60

image

Cosik commented 1 month ago

you have your client_id in log file. It is UUID form python

martinhoess commented 1 month ago

you have your client_id in log file. It is UUID form python

which is 36 char long ... so it's longer than 23 has the creation of the client id changed since version 1.1.7?

Cosik commented 1 month ago

yes

martinhoess commented 1 month ago

How do we move forward here?

I'll stick with 1.1.7 for now

https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#:~:text=The%20first%20UTF,2%3A%20Identifier%20Rejected.

Cosik commented 1 month ago

Hi, I restored uuid generation, but using broker which has such restriction is not a good idea. Also using default user name and password

martinhoess commented 1 month ago

Hi, I restored uuid generation

thank you.

but using broker which has such restriction is not a good idea

As I understand it, this is part of the MQTT V3.1 Protocol Specification. This means that any broker who does not follow it has not implemented the protocol according to the specification 🤷‍♂️ With 3.1.x it is even more restricted (only alphanumerical chars are allowed) so the dash in the UUID would also not be allowed (And yes I have seen the "MAY" part) image

Also using default user name and password

It is within one maschine / one docker environment ... I'm the only person on my network, if someone else should ever be in my network then I have bigger problems than a standard user/pass of an MQTT broker 😉

Cosik commented 1 month ago

to be honest I don't know why you are referring to mqtt v3. There is no official information that addon is using this version of protocol. Never the less modern brokers support mqtt v5 which is backward compatible, client ids are not limited. In the future addon will force to use mqtt v5

martinhoess commented 1 month ago

to be honest I don't know why you are referring to mqtt v3. There is no official information that addon is using this version of protocol. Never the less modern brokers support mqtt v5 which is backward compatible, client ids are not limited. In the future addon will force to use mqtt v5

because it does not really matter, MQTT v5 is more or less the same. https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901059

martinhoess commented 1 month ago

With 1.4.1 it works again, problem solved (for now)