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 2.0.11/2.0.18 Bridge => disconnected due to malformed packet on retained packet #3073

Open
hb9eue opened this issue Jun 23, 2024 · 4 comments

Comments

@hb9eue
Copy link

hb9eue commented Jun 23, 2024

Hi

I'm aware 2.0.11 is not the latest version, but I found no indication that this is a known and fixed issue with newer versions.

I'm bridging my local mosquitto broker with the meshtastic broker. This worked fine for several months but as the user number has grown significantly suddnely it stopped working and I get disconnected because of malformed packets:

connection_messages true
log_type all

connection Meshtastic
address mqtt.meshtastic.org:1883
topic # both 0 meshtastic/msh/ msh/
remote_username meshdev
remote_password large4cats
#try_private false
cleansession true
#bridge_protocol_version mqttv50
#bridge_max_packet_size 1000

But my broker disconnects the bridge while getting the initial retained messages:

1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/Bir/D1/2/stat/!da52924c', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/Bir/D1/2/stat/!aba8f51a', ... (6 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/Bir/Alft/2/stat/!da52924c', ... (6 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/Bir/Alft/2/stat/!aba8f51a', ... (6 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/Bir/BU/2/stat/!da529480', ... (6 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/D1/2/stat/!da528f34', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/D1/2/stat/!da529480', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/IN/KS/2/stat/!da5773a4', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/PARCmesh/2/stat/!da622644', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/PARCmesh/2/stat/paho46760577251754', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/PARCmesh/2/stat/paho54871366988095', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/PARCmesh/2/stat/paho55462593669862', ... (7 bytes))
1719124778: Received PUBLISH from local.pine64.Meshtastic (d0, q0, r1, m0, 'meshtastic/msh/TRIG/2/stat/!c34472b5', ... (7 bytes))
1719124778: Client local.pine64.Meshtastic disconnected due to malformed packet.

Sometimes, when I delete the last topic which was published this seems to solve the issue, only to fail on another one.

When I look at the transactions via wireshark, I don't see any obvious problems. It's hard to tell, as all topics are transmitted in one huge transaction.

I wonder if this could be due to a limitation of the receive buffer or similar.

I attempted to switch to protocol 50 but that did not resolve the issue.

Maybe somebody could get me more insight on how to further pin down the cause of that issue?

-Benoit-

@hb9eue
Copy link
Author

hb9eue commented Jun 23, 2024

I suppose it has to do with the number of retained messages received upon connection. If I subscribe to a more specific topic, limiting the number of retained messages received upon connection, I don't get disconnects in the very same topic I got disconnected before.

@ckrey
Copy link

ckrey commented Jun 28, 2024

subscribe using mosquitto_sub -t 'msh/#' -h mqtt.meshtastic.org -u meshdev -d encounters a similar problem as the bridge: It detects an error and reconnects every few seconds

There seems to be a problem with high volume incoming data

  • other MQTT clients (hivemq matt-cli, mqttx) work well with meshastic
  • mqtt.meshtastic.org does not support MQTTv5

@hb9eue
Copy link
Author

hb9eue commented Jun 29, 2024

The 'high volume' on connection is due to the large number of retained topics and expected.

@hb9eue hb9eue changed the title mosquitto 2.0.11 Bridge => disconnected due to malformed packet on retained packet mosquitto 2.0.11/2.0.18 Bridge => disconnected due to malformed packet on retained packet Jun 29, 2024
@hb9eue
Copy link
Author

hb9eue commented Jun 29, 2024

Installed 2.0.18 from https://repo.mosquitto.org/ issue persists.

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