-
Notifications
You must be signed in to change notification settings - Fork 36
Error reading char at handle 26, status=5 #42
Comments
Looking at the documentation for BLE error codes:
Seems to be some sort of authentication failure. Any idea why? I pressed the pairing button, maybe I could also try completely resetting the desk |
hey did you get a fix for this? |
I didn't! If you have any additional information though, please let me know! |
I was thinking maybe the desk is asking for a code but esphome does not support codes yet |
mmmh, that could be a reason but I wouldn't think so, this is working for so many other people |
esp 32 and my table is a new idasen |
Okay, I bought mine in september 2020 🤔 |
Got the same errors in the log unfortunately. Was working with 1.2.3 until a few days ago but now neither 3.0.0. nur 1.2.3 is working. |
hmm so its nothing new then, where did u get your esp 32 i got mine off amazon it may be the ble chip (which i doubt) |
@j5lien can you please look into this? |
Happens to me, too. Workaround:
Sensors are not updating, though... |
I have the same issue :(
I don't think this is the case, since when pairing the desk to my phone it didn't ask for any pairing code |
In my case workaround doesn't help. Actually, it helps for a moment, and then I get the same error. |
In the end, I tried this yesterday, and it worked! I've used v1.2.2, because v1.2.3 did not work for me. Saw this workaround originally here and followed its steps. It is working since yesterday, both moving the desk and reading the sensors To do the initial pairing with the desk used the following config: esphome:
name: ********* <- put the desired name here
platform: ESP32
board: esp32dev
libraries:
- "ESP32 BLE Arduino"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: ***************************************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "*********"
password: "**************"
captive_portal:
external_components:
- source: github://j5lien/esphome-idasen-desk-controller@v1.2.2
idasen_desk_controller:
mac_address: "**:**:**:**:**:**"
cover:
- platform: idasen_desk_controller
name: "Desk" Once paired successfully, used the following config: esphome:
name: ********* <- put the desired name here
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: ***************************************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: *********************
password: *********************
captive_portal:
external_components:
- source: github://j5lien/esphome-idasen-desk-controller@v3.0.0
esp32_ble_tracker:
globals:
# To store the Desk Connection Status
- id: ble_client_connected
type: bool
initial_value: 'false'
ble_client:
- mac_address: "**:**:**:**:**:**"
id: idasen_desk
on_connect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = true;
- delay: 5s
# Update desk height and speed sensors after bluetooth is connected
- lambda: |-
id(desk_height).update();
id(desk_speed).update();
on_disconnect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = false;
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Desk"
sensor:
# Desk Height Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_height
name: 'Desk Height'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:arrow-up-down'
unit_of_measurement: 'cm'
accuracy_decimals: 1
update_interval: never
notify: true
lambda: |-
uint16_t raw_height = ((uint16_t)x[1] << 8) | x[0];
unsigned short height_mm = raw_height / 10;
return (float) height_mm / 10;
# Desk Speed Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_speed
name: 'Desk Speed'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:speedometer'
unit_of_measurement: 'cm/min' # I'm not sure this unit is correct
accuracy_decimals: 0
update_interval: never
notify: true
lambda: |-
uint16_t raw_speed = ((uint16_t)x[3] << 8) | x[2];
return raw_speed / 100;
binary_sensor:
# Desk Bluetooth Connection Status
- platform: template
name: 'Desk Connection'
id: desk_connection
lambda: 'return id(ble_client_connected);'
# Desk Moving Status
- platform: template
name: 'Desk Moving'
id: desk_moving
lambda: 'return id(desk_speed).state > 0;'
|
Thanks for sharing. I'll try this approach. |
Reading sensors works, for now, however moving is not :( |
And it got disconnected after 2 days and doesn't connect anymore...
🤞 for @ammmze PR mentioned above |
@leukanos at least you progressed 3 handles! 😁 I think I'll try the pull request out with my installation (guide) |
I did pretty much what andrethrill said in the comment below me. Things work, but the sensors don't :/ I'm using Adafruit ESP32 feather board if that's any help. The controls don't work for down (up and stop do), but the automation does (because it's behaving like a curtain). |
👍🏻 Let us know how it goes. Hopefully it gets things rolling. While I got mine paired and from the logs it looks pretty good, I did notice some quirks in home assistant. Often I would be manually raising and lowering the desk and the speed and other statuses would get stuck showing it in motion (i.e. having a positive speed value greater than 0), however in the esphome logs I did see 0 as the last speed. So I wonder if esphome is throttling the messages to esphome and dropping some of them. Regardless, I think it's a separate issue that we can dig into more once we are successful in the pairing process. Edit: Ah...yea...looks like the reason why home assistant doesn't always see the final state is because there's not enough buffer space to store all the messages that get produced when moving the desk up/down.
|
I’m also seeing this issue. I just got a new desk, partly because I wanted to automate it with this project 😄 Is there anything I can do to test/debug? It isn’t clear from reading the thread if there are any leads to follow up on. Otherwise I’ll do my own investigation |
Unfortunately we have not found a fix yet. But please send your progress here so others don’t have the same issue |
small update from me:
|
See below for what I'm running currently. This is running on ESPHome 2022.3.2. I have 2
esphome:
name: office-desk-controller-frontier
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Office-Desk-Controller-Frontier"
password: !secret ap_password
captive_portal:
external_components:
- source: github://ammmze/esphome-idasen-desk-controller@make-it-work
- source: github://pr#3320
components:
# list all components modified by this Pull Request here
- ble_client
- esp32_ble_tracker
globals:
# To store the Desk Connection Status
- id: ble_client_connected
type: bool
initial_value: 'false'
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
on_connect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = true;
- delay: 5s
# Update desk height and speed sensors after bluetooth is connected
- lambda: |-
id(desk_height).update();
id(desk_speed).update();
on_disconnect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = false;
idasen_desk_controller:
# Reference to the ble client component id
# -----------
# Required
ble_client_id: idasen_desk
# Fallback to use only up and down commands (less precise)
# -----------
# Optional
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Office Desk"
sensor:
# Desk Height Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_height
name: 'Office Desk Height'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:arrow-up-down'
unit_of_measurement: 'cm'
accuracy_decimals: 1
update_interval: never
notify: true
# filters:
# - debounce: 0.5s
lambda: |-
uint16_t raw_height = ((uint16_t)x[1] << 8) | x[0];
unsigned short height_mm = raw_height / 10;
return (float) height_mm / 10;
# Desk Speed Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_speed
name: 'Office Desk Speed'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:speedometer'
unit_of_measurement: 'cm/min' # I'm not sure this unit is correct
accuracy_decimals: 0
update_interval: never
notify: true
# filters:
# - debounce: 0.5s
lambda: |-
uint16_t raw_speed = ((uint16_t)x[3] << 8) | x[2];
return raw_speed / 100;
binary_sensor:
# Desk Bluetooth Connection Status
- platform: template
name: 'Office Desk Connection'
id: desk_connection
lambda: 'return id(ble_client_connected);'
# Desk Moving Status
- platform: template
name: 'Office Desk Moving'
id: desk_moving
lambda: 'return id(desk_speed).state > 0;'
|
well thanks to you this is the first time HA moved my desk |
@ammmze Neat! I also tried this config out and it seems to partially work. I can now move the desk up and down with Home Assistant. However, the sensors don't seem to be updating. I don't need them for now, it isn't quite as nice but I can work with a cover percentage in Home Assistant so I just removed them for now. My more minimal config therefore look like... external_components:
- source: github://ammmze/esphome-idasen-desk-controller@make-it-work
- source: github://pr#3320
components:
- ble_client
- esp32_ble_tracker
substitutions:
nicename: Study
devicename: study
esphome:
name: ${devicename}
platform: ESP32
board: esp32dev
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
ota:
password: "***************************************"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Study Desk" |
@d0ugal the first time I loaded it in the sensors did not update but then I unplugged it and plugged it back in (the esp) and it’s working |
Good point, the height did seem to update once after restart. It didn't seem to update after that but I'll do some experimentation. |
@d0ugal Did you ever get a chance to do some experimenting? I'm getting the same thing where the sensors are updated when the ESP first boots up but never again. Update: Slightly frustratingly the sensors seem to have started updating for me now and I'm not really sure why. The main thing I did before they started working was pair the desk to my computer using Bluetility (it's a mac app but I'm sure sure there are similar ones for other platforms) and subscribed to height changes there. Then I turned off bluetooth for my computer and my phone which I've previously connected to the desk and restarted the ESP holding down the pairing button on the physical desk control. I've restarted the ESP and unplugged and replugged in my desk many times at that point so I'm assuming it was something to do with the pairing and unpairing that did it rather than just the restarting but honestly I don't really have any idea what happened 🤷♀️ |
@callumgare I had some problems until 4.0.0 was released. Since then it has worked fine and I don't get the issue anymore. My full config is now the following; external_components:
- source: github://j5lien/esphome-idasen-desk-controller@v4.0.0
substitutions:
name: study-desk
esphome:
name: ${name}
platform: ESP32
board: esp32dev
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Study Desk"
# These just include some common things like wifi details that I share between devices. Nothing speicifc to the desk.
<<: !include .common.yaml
<<: !include .atom-identify.yaml |
Thanks for that @d0ugal! |
Hi, I'm having a weird problem, preventing me to use this at all. As far as I know, @sud33p has the same issue.
I wanted to set up an ESP32 with for my Idasen desk with this config:
However, I keep getting the same error:
This error is repeating over and over again, until I press the pairing button on my desk. Then this happens:
Looks promising at first, but then the error pops up, it disconnects again and the loop with the first log I showed continues.
Any idea what could be causing this?
If you need any more information, please let me know!
Thank you.
The text was updated successfully, but these errors were encountered: