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

Commands via proxy do not accept Fleet API ID #144

Closed
RichieB2B opened this issue Jan 19, 2024 · 3 comments · Fixed by #146
Closed

Commands via proxy do not accept Fleet API ID #144

RichieB2B opened this issue Jan 19, 2024 · 3 comments · Fixed by #146

Comments

@RichieB2B
Copy link

The specs for charge_start specify the vehicle_tag as:

VIN or id field of a vehicle from /api/1/vehicles endpoint.

However using the id field gives this error:

{'response': None, 'error': 'expected 17-character VIN in path (do not user Fleet API ID)', 'error_description': ''}

The proxy is too strict (and has a typo in the error):

if len(vin) != vinLength {
writeJSONError(w, http.StatusNotFound, errors.New("expected 17-character VIN in path (do not user Fleet API ID)"))
return
}

@RichieB2B
Copy link
Author

When I patch proxy.go to accept the Fleet API ID the command fails with:

2024-01-19T23:27:49+01:00 [warn ] [14d97b13b8dea6672c0c68630f7118dc] Session info error: InvalidSignature: session info hmac invalid
2024-01-19T23:27:49+01:00 [debug] [4f00b4e5be7c73153d1c2b81ddf0423a] Retrying transmission after error: Post "https://fleet-api.prd.eu.vn.cloud.tesla.com/api/1/vehicles/929853189081408/signed_command": context canceled

Is this a limitation of the proxy? Or does signed_command require a VIN on the server side? Either way, this should be documented somewhere.

@sethterashima
Copy link
Collaborator

This is a limitation of the proxy. However, the client needs to know the VIN in order to sign and verify messages. If you want to patch your version, the VIN on this line needs to be "real" VIN, not the Owner API Vehicle ID.

@RichieB2B
Copy link
Author

Thanks! It was easy to fix my app to use the VIN. When #146 is merged it is clearly documented and this issue can be closed.

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

Successfully merging a pull request may close this issue.

2 participants