-
Notifications
You must be signed in to change notification settings - Fork 90
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
send ATT request failed: io: read/write on closed pipe every 30 seconds #253
Comments
If you have other BLE devices (phone keys, keyfobs) connecting to the vehicle, it's possible that vehicle BLE endpoint is dropping one connection to accommodate another. Are you using |
Hi, I've uploaded my code here: https://github.com/LubosD/hass-tesla-vc I was far away from the car with my phone key, so that can't be it. |
I was able to run that code without issue (with the mtqq stuff gutted out). It's possible the issue is within the BLE stack itself; unfortunately, the relevant Go packages are not very well maintained. Are you able to reproduce with a different BLE device? What OS/hardware are you using? |
I'm using a "Raspberry Pi 4 Model B Rev 1.5". I ran
|
I'll try to repo on a Pi 4 next week, but it's looking like a BLE library/driver/hardware issue. Unfortunately I don't have the bandwidth to run those down. |
@sethterashima - what BLE hardware are you testing on and runs without issue? I also have a Pi 4 does the same thing, and so do several BT4 and BT5 dongles. Usually you get:
With the telsa-control tool, but only every 2nd, 3rd call. |
I've been doing my testing on a Pi 3B and a Macbook. I was able to reproduce using a BLE dongle. |
I get the same errors from time to time and that is why my script tries each command several times (6 times max). Usually after 1 or 2 retries it gets success. I found out that using an rpi5 with 5Ghz wifi connection make the connection better compared with rpi3/4 on 2.4Ghz wifi where both BLE and wifi share the same band. |
It does appear to be range related. If I jury-rig RPi4 very close to the car, it's a lot more reliable - only fails in 1 in 10 calls. There is no way you can have a RPi with your command EC key stationed outside the house though, might as well leave the keycard sitting on top. Im so close to done with all of this. Restricted API, no way to buy more calls, flakey BLE support. Shouldn't be this hard... WTF Tesla. |
Work in progress: #269 Improvement on an Ubuntu box with with a BLE dongle, but needs more work and validation in different environments. Please feel free to comment on the PR on whether you see an improvement or not and, if not, what hardware and vehicle model+year you're using. |
Thanks @sethterashima will comment on the PR, but for this thread: seems significantly improved. |
Tested today the new code with several adapters I have. It works a bit faster for BT 5.0 adapter but it broke the BT4.x support. That is due to using the Extended Adv features that were introduced starting with BT 5.0. vehicle-command/pkg/connector/ble/device_linux.go var scanParams = cmd.LESetScanParameters{ Here are the possible values: |
Are there any details on how to keep the BLE connection open for long time?
I tried Ping()ing the vehicle every 5 seconds, but it seems the connection is always lost after 30 seconds:
The text was updated successfully, but these errors were encountered: