esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 35 forks source link

bluetooth_proxy: Debug output of message data for BluetoothGATTWriteRequest is corrupted #4091

Open tbe opened 1 year ago

tbe commented 1 year ago

The problem

While debugging some connection issues with a Home Assistant Bluetooth integration, i found some strange behavior.

The message send by write_gatt_char from the HA site is: '\x0c\x97\xfa\x87\xdc\xe8\xe9\xb3\x81\xe6\xba%\xa7^\x1d\x1f\x11'

But the debug log from the ESP device contains:

[03:00:34][VV][api.service:742]: on_bluetooth_gatt_write_request: BluetoothGATTWriteRequest {
  address: XXXXXX
  handle: 27
  response: NO
  data: '
         \x97\xfa\x87\xdc\xe8鳁\xe6\xba%\xa7^'
}

This message seems to lack some data after '\xa7^'.

Which version of ESPHome has the issue?

2022.12.8

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

2023.1

What platform are you using?

ESP8266

Board

nodemcu

Component causing the issue

bluetooth_proxy

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alistair23 commented 8 months ago

I'm seeing similar behaviour as well

bdraco commented 8 months ago

Your terminal is trying to render the raw output as utf-8 when its not. Try setting your terminal to ascii to see the contents of the message. Than verify if the data is missing or not

alistair23 commented 8 months ago

I'm using the "Logs" from the ESPHome view in HA. I don't see how to change it to ASCII

bdraco commented 8 months ago

You'll need to use a terminal application with the cli