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

Bluetooth-Connection to BMS stops working #671

Open
abc2006 opened this issue Jan 25, 2025 · 0 comments
Open

Bluetooth-Connection to BMS stops working #671

abc2006 opened this issue Jan 25, 2025 · 0 comments

Comments

@abc2006
Copy link

abc2006 commented Jan 25, 2025

Hi, my post is possibly related to #659 or #608. Please note that I am not a native English speaker, so my statements may not be 100% accurately translated. (Translation provided by ChatGPT)

I am using two ESP32s to connect two JK-BMS:

JK-BMS <-> Bluetooth <-> ESP32 <-> WiFi <-> MQTT Server (Mosquitto, not related to HomeAssistant or anything else)

This setup is duplicated, see the configurations jk00[12]-esp32-ble-v14.yaml.orig:

jk002-esp32-ble-v14.yaml.orig.txt
jk001-esp32-ble-v14.yaml.orig.txt

Sometimes, one or both of the connections stop working, so I don't receive any new values in my MQTT server. A power cycle of the ESP32 fixes it, and then it works again.

Today, I did some research and found the following message:

[W][component:237]: Component esp32_ble took a long time for an operation (965 ms).
[W][component:238]: Components should block for at most 30 ms.

To reduce the load, I changed the configurations and removed any unused datapoints (e.g., I have 16 cells, so I removed the voltage and resistance datapoints for cells 17 to 24). As a result, the "long time" dropped to around 700 ms:

jk002-esp32-ble-v14.yaml.txt
jk001-esp32-ble-v14.yaml.txt

[W][component:237]: Component esp32_ble took a long time for an operation (696 ms).
[W][component:238]: Components should block for at most 30 ms.

I also pulled the updates from GitHub and updated the Python files on my computer, before recompiling and updating with the new configurations.

Just now, I was watching the log outputs a bit, and I saw this message:

[14:24:58][D][jk_bms_ble:599]: Temperature sensor 4: 0.0 °C
[14:24:58][D][jk_bms_ble:600]: Temperature sensor 5: 0.0 °C
[14:24:58][D][jk_bms_ble:601]: Time enter sleep: 0 s
[14:24:58][D][jk_bms_ble:602]: PCL Module State: OFF
[14:24:58][W][component:237]: Component esp32_ble took a long time for an operation (695 ms).
[14:24:58][W][component:238]: Components should block for at most 30 ms.
[14:24:59][D][esphome.ota:117]: Starting update from 192.168.243.253...
[14:24:59][W][component:157]: Component esphome.ota set Warning flag: unspecified
[14:24:59][D][switch:016]: 'jk-bms-001 enable bluetooth connection' Turning OFF.
[14:24:59][I][ble_client:043]: [C8:47:8C:E8:3E:CE] Disabling BLE client.
[14:24:59][I][esp32_ble_client:084]: [0] [C8:47:8C:E8:3E:CE] Disconnecting.
[14:24:59][D][switch:055]: 'jk-bms-001 enable bluetooth connection': Sending state OFF
[14:24:59][D][main:2757]: BLE connection suspended for OTA update
[14:24:59][W][esphome.ota:129]: Magic bytes do not match! 0x47-0x45-0x54-0x20-0x2F
[14:24:59][E][component:164]: Component esphome.ota set Error flag: unspecified
[14:24:59][D][esp-idf:000][BTU_TASK]: W (5637211) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16
[14:24:59][D][esp-idf:000][BTC_TASK]: E (5637222) BT_APPL: BTA_GATTC_DeregisterForNotifications registration not found bd_addr:c8:47:8c:e8:3e:ce
[14:25:16][W][component:170]: Component mqtt cleared Warning flag
[14:25:16][I][mqtt:291]: MQTT Connected!
[14:25:18][I][app:062]: setup() finished successfully!
[14:25:18][I][app:100]: ESPHome version 2024.12.4 compiled on Jan 25 2025, 12:50:41
[14:25:18][I][app:102]: Project syssi.esphome-jk-bms version 2.1.0
[14:25:18][C][wifi:600]: WiFi:

However, I didn't start an update, I was just watching the OTA log output. Is this error known? If so, what can I do? If not, how can I provide more information? I will keep an eye on it to see if this error occurs more frequently.

This is my Hardware and software-versions:

Processing jk-bms-001 (board: wemos_d1_mini32; framework: espidf; platform: https://github.com/pioarduino/platform-espressif32.git#51.03.07)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50105.0 (5.1.5) 
 - tool-cmake @ 3.21.3 
 - tool-esptoolpy @ 4.8.1 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 12.2.0+20230208

Thanks for your help,
Stephan

@abc2006 abc2006 changed the title [W][component:237]: Component esp32_ble took a long time for an operation (1972 ms) Connection to BMS stops working Jan 25, 2025
@abc2006 abc2006 changed the title Connection to BMS stops working Bluetooth-Connection to BMS stops working Jan 25, 2025
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

1 participant