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

clients with packet identifier set to zero being rejected #2681

Open
davoau opened this issue Nov 5, 2022 · 2 comments
Open

clients with packet identifier set to zero being rejected #2681

davoau opened this issue Nov 5, 2022 · 2 comments

Comments

@davoau
Copy link

davoau commented Nov 5, 2022

I have recently upgraded from mosquitto version 1.5.7 to 2.0.11 - went from piOS buster to bullseye.
I stopped getting mqtt messages from my SolaX inverter, with the mosquitto log file showing the following entries.

1667545518:` New connection from 10.0.1.8:46313 on port 2901.
1667545520: New client connected from 10.0.1.8:46313 as SWHXXXXXX (p2, c1, k600, u'SWHXXXXXX').
1667545523: Client SWHXXXXXX disconnected due to protocol error.
1667545749: New connection from 10.0.1.8:41214 on port 2901.
1667545750: New client connected from 10.0.1.8:41214 as SWHXXXXXX (p2, c1, k600, u'SWHXXXXXX').
1667545753: Client SWHXXXXXX disconnected due to protocol error.
1667546052: New connection from 10.0.1.8:29870 on port 2901.
1667546052: New client connected from 10.0.1.8:29870 as SWHXXXXXX (p2, c1, k600, u'SWHXXXXXX').
1667546055: Client SWHXXXXXX disconnected due to protocol error.
1667546277: New connection from 10.0.1.8:37995 on port 2901.
1667546277: New client connected from 10.0.1.8:37995 as SWHXXXXXX (p2, c1, k600, u'SWHXXXXXX').
1667546281: Client SWHXXXXXX disconnected due to protocol error.

After spending a few days trying to work out what the issue is and alot of google searching I have found that it is due to the Solax inverter setting the packet identifier to zero.

I have managed to get it to work with by commenting out the following in handle_publish.c and compiling my own binary.

		/* if(mid == 0){
			db__msg_store_free(msg);
			return MOSQ_ERR_PROTOCOL;
		} */

I am wondering if it is possible to put an option in mosquitto.conf to not reject packet identifiers set to zero, as my invert wifi dongle with never get a firmware update and there must be others out there that are using mqtt clients with this issue.

Thanks
David

@nzmichaelh
Copy link

Hi David. FWIW, I had the same problem and locally patched Mosquitto. See https://juju.nz/michaelh/post/2021/solax/

@davoau
Copy link
Author

davoau commented Mar 21, 2023

Hi, What options/build dependences did you use.. I have just done a new install of piOS and home assistant over he weekend (I had forgot all about this problems until I got you comment) and complied it. The new mosquitto binary is 1.8MB against the originals 297k on the piOS 2023.03 - new build is version 2.0.15, original is 2.0.12.
It is working fine but just curious to know why the binary file is so big now, and if I can get it smaller.
Thanks
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants