teslamotors / vehicle-command

Apache License 2.0
445 stars 102 forks source link

iOS app #3

Open prodriguezdlt opened 1 year ago

prodriguezdlt commented 1 year ago

Is it possible to create an iOS app with this and still execute BLE commands?

Darko commented 1 year ago

There shouldn't be anything stopping you from doing this. Although, currently Tesla requires you to provide which URLs are going to be using the API, and you'll likely need to proxy the requests through a server of your own.

prodriguezdlt commented 1 year ago

There shouldn't be anything stopping you from doing this. Although, currently Tesla requires you to provide which URLs are going to be using the API, and you'll likely need to proxy the requests through a server of your own.

How would i create an ios app with this golang framework? is it even posible to use golang on an xcode project, talking about the bluetooth commands? Thanks in advance

sethterashima commented 1 year ago

Gomobile generates bindings to turn a Go package into an iOS/Android library. You'd need to implement the Connector interface using native BLE functions, and then use that connector when calling NewVehicle (example). The first two bytes of each BLE message encode the remaining length of that message (example).

I'll look into pulling the Tesla-specific logic out of the BLE connector package so it can be re-used by third-party apps more easily.

JSpiner commented 1 year ago

I'm trying to develop unofficial sdk in multiple languages/platforms. Currently, the fleet API is implemented with python, and I'm trying to develop the ble API with kotlin(for Android). If you are interested in iOS native development, please contribute.

https://github.com/JSpiner/TeslaSdk

prodriguezdlt commented 1 year ago

I'm trying to develop unofficial sdk in multiple languages/platforms. Currently, the fleet API is implemented with python, and I'm trying to develop the ble API with kotlin(for Android). If you are interested in iOS native development, please contribute.

https://github.com/JSpiner/TeslaSdk

I would totally pay you some money to implement BLE over iOS native, we can exchange emails or discord user if you d like o/

georgevicbell commented 1 year ago

I'm confused how this would work...sharing the private key via an app would be problematic...

itsMeDavidV commented 11 months ago

Gomobile generates bindings to turn a Go package into an iOS/Android library.

@sethterashima running into issues with this, specifically because Gomobile skips a lot of methods for lack of supported param/return types.

Some examples of this in pkg/account after conversion:

// skipped method Account.Get with unsupported parameter or return types

// skipped method Account.GetVehicle with unsupported parameter or return types

// skipped method Account.Post with unsupported parameter or return types

// skipped method Account.SendVehicleFleetAPICommand with unsupported parameter or return types

// skipped method Account.UpdateKey with unsupported parameter or return types
georgevicbell commented 11 months ago

Was thinking it might be good to have a quick way to spin up an AWS lambda for this or something...low cost and doesn't require shipping the secrets...

sheng168 commented 9 months ago

I've written enough Swift code to add key, perform handshake and lock/unlock using BLE only

prodriguezdlt commented 9 months ago

I've written enough Swift code to add key, perform handshake and lock/unlock using BLE only

Will you be willing to share it man? cheers o/

sheng168 commented 8 months ago

Possibly, what are you trying to do? I've been busy trying to get it release to the App Store. It's basically the same code running in both iOS and watchOS. However watchOS has very low connection limits that are causing problems.

prodriguezdlt commented 8 months ago

Possibly, what are you trying to do? I've been busy trying to get it release to the App Store. It's basically the same code running in both iOS and watchOS. However watchOS has very low connection limits that are causing problems.

I have a custom private app that integrates some of my intelligent home devices and i want to integrate some of the stuff for my tesla, so i basically want a demo ios app that connects to my tesla, i can unlatch doors and do regular stuff but with BLE functionality, and then i would just basically integrate that code into my custom app.

sheng168 commented 8 months ago

What kind of api would you like to see? Would you be willing to help build it?