PyTeslaBLE icon indicating copy to clipboard operation
PyTeslaBLE copied to clipboard

RuntimeError: The requested operation is not supported.

Open gopkg-dev opened this issue 2 years ago • 5 comments
trafficstars

` Enter choice: 8 Connecting to vehicle... Tap your keycard on the center console 2023-06-02 20:51:42.716 Python[45762:1776268] Characteristic does not support write without response. Traceback (most recent call last): File "/Users/karen/PycharmProjects/pythonProject/main.py", line 28, in vehicle.whitelist() File "/Users/karen/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/pyteslable/TeslaBLE.py", line 233, in whitelist self.__peripheral.write_command( RuntimeError: The requested operation is not supported.

Process finished with exit code 1 `

gopkg-dev avatar Jun 02 '23 12:06 gopkg-dev

What platform are you using?

Some people on macOS reported that they needed to change write_command to write_request in the library:

https://github.com/kaedenbrinkman/PyTeslaBLE/issues/3#issuecomment-1269301150

Let me know if this works for you, I'll try to test it myself this weekend and will update the library if it works.

kaedenbrinkman avatar Jun 02 '23 16:06 kaedenbrinkman

@kaedenbrinkman

Thank you for your help.

There are no error messages, but when I place the card in the car and after click the confirm button, the program appears to be stuck and does not respond.

Scanning for vehicles...
Please select a vehicle:
0: iPhone 13 Pro Max [.....]
1: Apple Watch [.....]
2: Sxxxxxxxxxxxx [.....]
3: [.....]
4: [.....]
5: [.....]
6: Sxxxxxxxxxxxx [.....]
7:  [.....]
Enter choice: 6
Connecting to vehicle...
Tap your keycard on the center console
Sent whitelist request

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

It has remained in this state ever since.

gopkg-dev avatar Jun 03 '23 00:06 gopkg-dev

Could you check that your version of macOS is on SimpleBLE's supported platforms list?

kaedenbrinkman avatar Jun 03 '23 07:06 kaedenbrinkman

macOS Ventura 13.4

It looks like it is supported.

gopkg-dev avatar Jun 03 '23 08:06 gopkg-dev

@kaedenbrinkman I can confirm the same issue. I'm on macOS 13.4.1, and have ran the example provided. It gets stuck on Sent whitelist request.

I can also confirm it did send the request to the car, as I did "confirm" the key creation on the car's display. Here's some debugging logs.

➜  test /opt/homebrew/bin/python3 /Users/edi/Desktop/test/ble.py
Connecting to vehicle...
Tap your keycard on the center console
Sent whitelist request
commandStatus {
  operationStatus: OPERATIONSTATUS_WAIT
  signedMessageStatus {
  }
}

Waiting for keycard to be tapped...
authenticationRequest {
  requestedLevel: AUTHENTICATION_LEVEL_DRIVE
}

libc++abi: terminating due to uncaught exception of type pybind11::error_already_set: Exception: Car's ephermeral key not yet loaded!

At:
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(365): signedToMsg
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(515): authenticationRequestMsg
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(305): authenticationRequest
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(434): handle_notify
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(302): handle_notify
  /opt/homebrew/lib/python3.11/site-packages/pyteslable/TeslaBLE.py(225): <lambda>

[1]    45571 abort      /opt/homebrew/bin/python3 /Users/edi/Desktop/test/ble.py

edi avatar Aug 10 '23 20:08 edi