-
Notifications
You must be signed in to change notification settings - Fork 450
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
[Bug] saved binary data is incorrect #1806
Comments
Hi! You're encountering an issue where ./mqttx-cli-macos-x64 sub -h 192.168.xxx.xxx -t home/ew10/state --output-mode clean | jq -r '.packet.payload.data | join(",")' | xxd -r -p > ew10.netp This command:
The root cause is likely that the system doesn't recognize |
Interesting. I’d never expected the file extension to make a difference. Specifying format binary should eliminate all guessing done by the tool. I don’t even know if netp is a well known extension. I just picked it because it was used in the device I wanted to monitor. |
Yes, perhaps we will reverse the |
Fixed the original issue in https://github.com/emqx/MQTTX/releases/tag/v1.11.1; thanks. Optimization will continue in the future. |
What did I do
I try to read binary data from a channel and save it with "--file-write".
./mqttx-cli-macos-x64 sub -h 192.168.xxx.xxx --format binary --output-mode clean --file-write ew10.netp -t home/ew10/state >ew10.json
What happened
The output in "ew10.netp" contains extraneous bytes and doesn't match the clean output in "ew10.json", which has the correct data:
Expected
It is expected that the binary output has the bytes that can be found in the clean output.
Environment
More detail
It seems to me that there is a conversion going on and somehow the binary data is interpreted as UTF-8, which fails. Any non-UTF-8-compliant byte sequences would be replaced with
ef bf bd
. This sequence can be found multiple times in the output.Other "ASCII compatible" byte sequences like "00 00 00 04" or "01 01 07" can be found in the output.
The text was updated successfully, but these errors were encountered: