Skip to content

Cannot reconnect BLE after car is back at home #122

Closed

Description

@kerbje

After the car left, the BLE loses connection. So far so good.
But when it returns, it seems that the first connection fails and then it keep getting a Command Disallowed.

After I restart the docker container, it connects to the car right away

Running in Docker on a RPI3+, DietPi using a TP-Link UB500 Adapter as BT dongle.
Car: MY RWD 2024
Car software: 2025.20.3

Might be related to #117

`2025/06/24 15:15:37 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

2025/06/24 15:15:37 INFO Successfully executed Command=vehicle_data Body=map[endpoints:[charge_state]]

2025/06/24 16:51:02 INFO Connecting to Vehicle ...

2025/06/24 16:51:12 ERRO Cannot connect to vehicle Error="Vehicle is not in range: ble: failed to scan for XXX: hci: no response to command, hci connection failed"

2025/06/24 16:51:13 INFO Connecting to Vehicle ...

2025/06/24 16:51:13 WARN failed to connect to vehicle (A): ble: failed to scan for XXX: Command Disallowed

2025/06/24 16:51:16 WARN failed to connect to vehicle (A): ble: failed to scan for XXX: received scan response xxx with no associated Advertising Data packet

2025/06/24 16:51:22 ERRO Stop retrying after 3 attempts Error="failed to connect to vehicle (A): ble: failed to scan for XXX: received scan response xxx with no associated Advertising Data packet"

2025/06/24 16:51:22 ERRO Cannot connect to vehicle Error="failed to connect to vehicle (A): ble: failed to scan for XXX: received scan response xxx with no associated Advertising Data packet"

2025/06/24 16:51:32 INFO Connecting to Vehicle ...

2025/06/24 16:51:32 WARN failed to connect to vehicle (A): ble: failed to scan for XXX: received scan response xxx with no associated Advertising Data packet

2025/06/24 16:51:35 WARN failed to connect to vehicle (A): ble: failed to scan for XXX: Command Disallowed

2025/06/24 16:51:41 ERRO Stop retrying after 3 attempts Error="failed to connect to vehicle (A): ble: failed to scan for XXX: Command Disallowed"

2025/06/24 16:51:41 ERRO Cannot connect to vehicle Error="failed to connect to vehicle (A): ble: failed to scan for XXX: Command Disallowed"

.
. After a restart of the docker container
.

2025/06/24 16:57:59 INFO TeslaBleHttpProxy 2.1.2 is loading ...

2025/06/24 16:57:59 INFO Env: httpListenAddress=:8080

2025/06/24 16:57:59 INFO Env: cacheMaxAge=5

2025/06/24 16:57:59 INFO Env: scanTimeout=2

2025/06/24 16:57:59 INFO BleControl initialized

2025/06/24 16:57:59 INFO TeslaBleHttpProxy is running!

2025/06/24 16:58:02 INFO Connecting to Vehicle ...

2025/06/24 16:58:03 INFO Connection to vehicle established

2025/06/24 16:58:03 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

2025/06/24 16:58:04 INFO Successfully executed Command=vehicle_data Body=map[endpoints:[charge_state]]`

Activity

  1. kerbje commented on Jun 26, 2025

    @kerbje
    Author

    Same situation without the car leaving place. Cloudy day, so wasn't charging for quite some time. At one point it got the command to start charging again and the same thing happend. A restart of the container fixed it.

    2025/06/25 14:25:42 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 14:25:42 INFO Successfully executed Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 15:14:05 INFO Connecting to Vehicle ...

    2025/06/25 15:14:15 ERRO Cannot connect to vehicle Error="Vehicle is not in range: ble: failed to scan for VIN_XXX: hci: no response to command, hci connection failed"

    2025/06/25 15:14:16 INFO Connecting to Vehicle ...

    2025/06/25 15:14:16 WARN failed to connect to vehicle (A): ble: failed to scan for VIN_XXX: Command Disallowed

    2025/06/25 15:14:19 WARN failed to connect to vehicle (A): ble: failed to scan for VIN_XXX: Command Disallowed

    2025/06/25 15:14:25 ERRO Stop retrying after 3 attempts Error="failed to connect to vehicle (A): ble: failed to scan for VIN_XXX: Command Disallowed"

    2025/06/25 15:14:25 ERRO Cannot connect to vehicle Error="failed to connect to vehicle (A): ble: failed to scan for VIN_XXX: Command Disallowed"

    2025/06/25 15:54:34 INFO TeslaBleHttpProxy 2.1.2 is loading ...

    2025/06/25 15:54:34 INFO Env: httpListenAddress=:8080

    2025/06/25 15:54:34 INFO Env: cacheMaxAge=5

    2025/06/25 15:54:34 INFO Env: scanTimeout=2

    2025/06/25 15:54:34 INFO BleControl initialized

    2025/06/25 15:54:34 INFO TeslaBleHttpProxy is running!

    2025/06/25 15:55:08 INFO Connecting to Vehicle ...

    2025/06/25 15:55:15 INFO Connection to vehicle established

    2025/06/25 15:55:15 INFO Executing command Command=charge_stop Body=map[]

    2025/06/25 15:55:15 INFO The car has already stopped charging

    2025/06/25 15:55:15 INFO Successfully executed Command=charge_stop Body=map[]

    2025/06/25 15:55:29 can't accept: listner timed out

    2025/06/25 15:56:33 INFO Connecting to Vehicle ...

    2025/06/25 15:56:35 INFO Connection to vehicle established

    2025/06/25 15:56:35 INFO Executing command Command=set_charging_amps Body=map[charging_amps:2]

    2025/06/25 15:56:35 INFO Successfully executed Command=set_charging_amps Body=map[charging_amps:2]

    2025/06/25 15:56:35 INFO Executing command Command=charge_start Body=map[]

    2025/06/25 15:56:35 INFO Successfully executed Command=charge_start Body=map[]

    2025/06/25 15:57:03 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 15:57:04 WARN Failed to get vehicle data: context canceled

    2025/06/25 15:57:04 INFO Retrying in 3 seconds

    2025/06/25 15:57:06 INFO Retrying command Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 15:57:06 INFO Connecting to Vehicle ...

    2025/06/25 15:57:08 INFO Connection to vehicle established

    2025/06/25 15:57:08 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 15:57:09 INFO Successfully executed Command=vehicle_data Body=map[endpoints:[charge_state]]

    2025/06/25 15:57:09 INFO Executing command Command=vehicle_data Body=map[endpoints:[charge_state]]

  2. wimaha commented on Jan 6, 2026

    @wimaha
    Owner

    Any new findings?

  3. ggolec commented on Jun 7, 2026

    @ggolec

    I get the same. it can be reproduced also when do not insert charging plug on first time correctly. If car throws "Check charger plug again" then got similar errors and car is not detected as tesla but like guest car.
    I tried on tplink UB500 and some noname dongles.
    So far worked for me on builtin BT on raspbery pi 2 model B but I had to replace it.
    Is there any difference in BT handling between those?

  4. wimaha commented on Oct 19, 2026

    @wimaha
    Owner

    Closing as a duplicate of #155: "Command Disallowed" / "hci: no response" after some time is the go-ble adapter hang tracked there. 2.5.0 makes sure only one Bluetooth connection runs at a time (#174), which may help. Please try 2.5.0 and report in #155 if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions