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

Binary data from BLE device's notification gets wrong encoding #111

Open
kopierschnitte opened this issue Jul 9, 2023 · 2 comments
Open

Comments

@kopierschnitte
Copy link

I was struggeling about wrong binary values returned from one of my BLE endpoints. Somehow, they've been converted or encoded in a wrong way. This was an issue long time ago: #42

connection.services[serviceUUID][characteristicUUID].notifyCallback(data.toString("binary"));

If I remove the "binary" argument of the conversion, the values are correct. At least for my use case.
Maybe someone is facing similar problems ;-)

@gfwilliams
Copy link
Member

Thanks for the update! Please could you let us know what the values were that you were having trouble with, and maybe what you saw on MQTT?

@kopierschnitte
Copy link
Author

That's a little bit complicated: The device (pool chemical sensor) sent back 12 bytes (as expected) and the values were simply wrong.
I saw nothing special in the logs, even with DEBUG enabled.
I guess that the data got somehow treatend as UTF8?

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

3 participants
@gfwilliams @kopierschnitte and others