You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version 2.2.0: Cannot connect to vehicle Error #140
I tried using the new version 2.2.0 and now I get the following error all the time:
2026/01/07 20:57:37 INFO TeslaBleHttpProxy 2.2.0 is loading ...
2026/01/07 20:57:37 INFO Env: httpListenAddress=:8080
2026/01/07 20:57:37 INFO Env: cacheMaxAge=5
2026/01/07 20:57:37 INFO Env: scanTimeout=5
2026/01/07 20:57:37 INFO Env: vehicleDataCacheTime=30
2026/01/07 20:57:37 INFO BleControl initialized
2026/01/07 20:57:37 INFO TeslaBleHttpProxy is running!
2026/01/07 20:57:57 INFO Connecting to Vehicle ...
2026/01/07 20:58:02 ERRO Cannot connect to vehicle Error="Vehicle is not in range: ble: failed to scan for xxx: context deadline exceeded"
2026/01/07 20:58:17 can't accept: listner timed out
Using version 2.1.3, everything works fine:
2026/01/07 20:56:57 INFO TeslaBleHttpProxy 2.1.3 is loading ...
2026/01/07 20:56:57 INFO Env: httpListenAddress=:8080
2026/01/07 20:56:57 INFO Env: cacheMaxAge=5
2026/01/07 20:56:57 INFO Env: scanTimeout=2
2026/01/07 20:56:57 INFO BleControl initialized
2026/01/07 20:56:57 INFO TeslaBleHttpProxy is running!
2026/01/07 20:57:03 INFO Connecting to Vehicle ...
2026/01/07 20:57:10 INFO Connection to vehicle established
2026/01/07 20:57:10 INFO Executing command Command=vehicle_data Body="map[endpoints:[charge_state climate_state]]"
2026/01/07 20:57:11 INFO Successfully executed Command=vehicle_data Body="map[endpoints:[charge_state climate_state]]"
2026/01/07 20:57:24 can't accept: listner timed out
nope, not working with 2.2.1 when vehicle is asleep. Calling wake_up does not wake up the car.
2026/01/08 17:03:27 INFO TeslaBleHttpProxy 2.2.1 is loading ...
2026/01/08 17:03:27 INFO Env: httpListenAddress=:8080
2026/01/08 17:03:27 INFO Env: cacheMaxAge=5
2026/01/08 17:03:27 INFO Env: scanTimeout=5
2026/01/08 17:03:27 INFO Env: vehicleDataCacheTime=30
2026/01/08 17:03:27 INFO BleControl initialized
2026/01/08 17:03:27 INFO TeslaBleHttpProxy is running!
2026/01/08 17:03:31 INFO Connecting to Vehicle ...
2026/01/08 17:03:33 INFO Connection to vehicle established
2026/01/08 17:03:33 INFO Executing command Command=vehicle_data Body="map[endpoints:[charge_state climate_state]]"
2026/01/08 17:03:34 INFO Successfully executed Command=vehicle_data Body="map[endpoints:[charge_state climate_state]]"
2026/01/08 17:03:52 can't accept: listner timed out
2026/01/08 17:07:29 INFO Connecting to Vehicle ...
2026/01/08 17:07:44 WARN failed to perform handshake with vehicle (B): context deadline exceeded
2026/01/08 17:07:52 WARN Vehicle is not in range: ble: failed to scan for xxx: context deadline exceeded
2026/01/08 17:08:13 ERRO Stop retrying after 3 attempts Error="failed to perform handshake with vehicle (B): context deadline exceeded"
2026/01/08 17:08:13 ERRO Cannot connect to vehicle Error="failed to perform handshake with vehicle (B): context deadline exceeded"
2026/01/08 17:09:24 INFO Connecting to Vehicle ...
2026/01/08 17:09:39 WARN failed to perform handshake with vehicle (B): context deadline exceeded
2026/01/08 17:09:57 WARN failed to perform handshake with vehicle (B): context deadline exceeded
2026/01/08 17:10:18 ERRO Stop retrying after 3 attempts Error="failed to perform handshake with vehicle (B): context deadline exceeded"
2026/01/08 17:10:18 ERRO Cannot connect to vehicle Error="failed to perform handshake with vehicle (B): context deadline exceeded"
Thanks for reporting this. After reviewing the code, this looks like an intermittent BLE connectivity issue rather than a bug.
The scan context logic is working as intended: the scan gets the full scanTimeout duration (5 seconds in your case), independent of the parent context timeout. The "context deadline exceeded" error indicates the scan timed out after the full 5 seconds, which suggests the vehicle's BLE beacon wasn't detected during that window.
Since version 2.2.1 successfully connected for you (at 2026/01/08 17:03:33), this supports it being intermittent.
Important: Please check the BLE Device Limit (Maximum 3 Devices) section in the README. Tesla vehicles only accept a maximum of 3 BLE keys/devices simultaneously. If you have multiple phones, smartwatches, or other devices with active BLE connections to your vehicle, this could cause the intermittent connection failures you're experiencing.
Suggestions:
Close the Tesla app on mobile phones when not needed, especially if you're also wearing a smartwatch with the Tesla app
Try increasing scanTimeout to 10-15 seconds if failures persist
Ensure you're within BLE range when connecting
If you continue to see consistent failures after checking the device limit and using longer timeouts, please share details and we can investigate further.
Closing this as it refers to 2.2.x. Since then the scan/retry logic was reworked (#142, #143) and 2.5.0 serializes all Bluetooth access, so a second connection can no longer interfere with a running one (#174). If you still see "context deadline exceeded" or the car not waking up with 2.5.0, please open a new issue with a debug log and your setup (direct use or evcc, adapter, distance). Thanks!
Activity
wimaha commentedon Jan 8, 2026
Hi, can you please test, if the problem is fixed with 2.2.1?
bicaluv commentedon Jan 8, 2026
nope, not working with 2.2.1 when vehicle is asleep. Calling
wake_updoes not wake up the car.When using 2.1.3, everything works fine.
wimaha commentedon Jan 9, 2026
Thanks for reporting this. After reviewing the code, this looks like an intermittent BLE connectivity issue rather than a bug.
The scan context logic is working as intended: the scan gets the full scanTimeout duration (5 seconds in your case), independent of the parent context timeout. The "context deadline exceeded" error indicates the scan timed out after the full 5 seconds, which suggests the vehicle's BLE beacon wasn't detected during that window.
Since version 2.2.1 successfully connected for you (at 2026/01/08 17:03:33), this supports it being intermittent.
Important: Please check the BLE Device Limit (Maximum 3 Devices) section in the README. Tesla vehicles only accept a maximum of 3 BLE keys/devices simultaneously. If you have multiple phones, smartwatches, or other devices with active BLE connections to your vehicle, this could cause the intermittent connection failures you're experiencing.
Suggestions:
If you continue to see consistent failures after checking the device limit and using longer timeouts, please share details and we can investigate further.
Vacxe commentedon Jan 19, 2026
@wimaha I have the same issue with 2.3.0
bicaluv commentedon Jan 19, 2026
Just to make thinks clear: work on my site.
@Vacxe : are you using the proxy directly or via Evcc?
Vacxe commentedon Jan 19, 2026
Classic 👍
@bicaluv using via EVCC
wimaha commentedon Oct 19, 2026
Closing this as it refers to 2.2.x. Since then the scan/retry logic was reworked (#142, #143) and 2.5.0 serializes all Bluetooth access, so a second connection can no longer interfere with a running one (#174). If you still see "context deadline exceeded" or the car not waking up with 2.5.0, please open a new issue with a debug log and your setup (direct use or evcc, adapter, distance). Thanks!