-
Notifications
You must be signed in to change notification settings - Fork 29
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
Error when clearing MqttByteBuffer #44
Comments
I'm working on the same codebase as @devaronius, some more context on this: I/flutter ( 6506): 2023-01-31 13:17:07.947117 -- MqttServerConnection::_onData - Message Received Started <<< I/flutter ( 6506): 2023-01-31 13:17:18.140232 -- MqttConnectionHandlerBase::sendMessage - sending message started >>> -> MQTTMessage of type MqttMessageType.pingRequest |
So is the message type really coming in as reserved1 or is the incoming message correct and the client is decoding it incorrectly/? |
I did some more investigating and it seems like it's caused by a leading space in the received data, when decoding the bytes received myself it seems like the data coming through is formatted as such: " 2W ,[Topic] [payload]", the app sending data is also using the mqtt5_client package of 3.3.5, and the " 2W " does not seem to be coming from our end, does it ring any bells on your side? |
Can't say I've seen this before, then again I'm not sure I've had an issue where the sending and receiving client are both the mqtt5_client. I'll have a look at the message stream from your piccy above. Is it always the same topic and payload? How are you constructing the payload? An obvious test is to use a different sending mqtt client but I appreciate this may be difficult. |
The topic includes an identifier but otherwise is always the same and the payload is formatted as json. |
Yep, its the leading zero in the incoming stream, if you remove this the message correctly decodes into a publish ack, so we are occasionally still corrupting the incoming byte stream. I'll find out why. |
Where exactly in the code did you dump the above list? |
I got those from the same breakpoint as the previous one, so readFrom in MqttHeader; line 82 |
OK, I've created an issue44 branch for this and added some updates and more logging, could you update your pubspec to point to my test branch, i.e. update the mqtt5_client dependency to - Thanks |
The message is now coming through however there seems to be quite a delay followed by some duplicated messages coming through. Also encountered a different issue yesterday but haven't been able to reproduce today with the Mqqt5 package logging on Please let me know if there's any more data needed Thanks |
Your log shows a lot of exceptions at its start, then it seems to settle down, are you expecting this? The performance hit is almost certainly the extra logging, I'll remove this when we don't need it. |
OK, I've updated the branch with another potential fix if you could give it a try, thanks. |
Works like a charm now on the issue44 branch, thanks so much |
OK thanks, I'll remove the excess logging, push this into master and re release the package. |
Version 3.3.6 released. |
Hi, When I communicate with my broker and send a payload with my message, I sometimes get the following error.
Do you happen to know how I could resolve this one?
The text was updated successfully, but these errors were encountered: