shmuelzon / esp32-ble2mqtt

A BLE to MQTT bridge running on an ESP32
MIT License
672 stars 108 forks source link

Previous characteristic value on unreadable #143

Open GrumpyMeow opened 2 years ago

GrumpyMeow commented 2 years ago

Please make sure you're using the ESP-IDF version specified in the README file, any other version is not supported.

Describe the bug I’ve configured b2m to connect to various ble devices. Of my OcleanX toothbrush I notice that the “battery level” value is published under multiple characteristics. I suspect this caused by that b2m is unable to read the value and it reuses the last-successfully read value (the battery level).

If I look in nRF Connect i see that this app is also unable to read the value and reports “0x” (hex with no value).

I suspect some error handling doesn’t clear the value-buffer

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Configuration and logs If applicable, add your configuration file (without passwords) and logs (preferably of DEBUG level) to help understand your problem.

Additional context Add any other context about the problem here.

shmuelzon commented 2 years ago

Hey,

The project only publishes characteristic values when the read command succeeds so I don't think it's a caching. The published topics on MQTT are retained by default. Maybe that's what you're seeing? You can try to run the project with debug logs to get a better understanding of what it does.

Good day