TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

Tesla - Apple Watch support

Discussion in 'Model S: User Interface' started by R²B, Apr 25, 2015.

  1. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    Here's a demo of my fully functional Tesla app for the Apple Watch that I submitted to the App Store. Let me know if this is worth your $10.
    [video]https://youtu.be/j-Sqki-J8ZM[/video]
     
  2. LuckyLuke

    LuckyLuke Model S P90DL

    Joined:
    Dec 14, 2011
    Messages:
    2,200
    Location:
    Eindhoven, The Netherlands
  3. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,395
    Location:
    Toronto
    I am there - let us know when it is available on the store. By the way - can you change units to metric?
     
  4. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    Yup. And I'll make it easier for you. I'll have the app read the user preferences from your car and display metric if that's how you set it in your car.
     
  5. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,395
    Location:
    Toronto
    Wonderful - some of the other 3rd party apps don't have this functionality. Any idea how long it will take to get approved? Apple should expedite an app like this since it is a great way to showcase the Apple Watch.
     
  6. majorlance

    majorlance Member

    Joined:
    Sep 22, 2014
    Messages:
    204
    Location:
    Bethesda, MD
    My watch arrives in June... great watch app. $10 is a no brainer.
     
  7. Earthdog

    Earthdog Member

    Joined:
    Oct 28, 2013
    Messages:
    100
    Location:
    United States
    Yes I will pay $10.00
     
  8. JohnQ

    JohnQ Active Member

    Joined:
    Jan 1, 2012
    Messages:
    1,594
    Location:
    Redding, CT
    Nice implementation. Any issues with a commercial product hitting Tesla's servers for communication with the car? In theory they could shut down the access ...
     
  9. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    Around 9 days is their usual approval time. But it might be slightly longer, since a lot of people are probably pushing Apple Watch apps into the stores right now. I'll post a link to it on this thread when it's in the store. It'll definitely be in the store before June, though.
     
  10. GasDoc

    GasDoc Member

    Joined:
    Nov 15, 2012
    Messages:
    807
    Location:
    SF Bay Area
    Count me in!
     
  11. jbcarioca

    jbcarioca Active Member

    Joined:
    Feb 3, 2015
    Messages:
    3,969
    Yes, too. Reading my set preferences will be even better. When can I spend my $10?
    My Apple Watch theoretically will arrive around May 13-27. I want this app the first day.

     
  12. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    They'd have to shut down access to their iOS app as well if you catch my drift. :wink:
     
  13. befcomet

    befcomet Member

    Joined:
    Mar 22, 2015
    Messages:
    26
    Location:
    Cleveland, OH
    Does your app support multiple vehicles?
     
  14. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    Yes. When you log into the main app, it'll ask you to pick from a list of vehicles which one you want to be controlled by the watch. If you look at the video, it says "Mobile phone charger" on top. That's the name of the vehicle I chose to command.
     
  15. JPP

    JPP Active Member

    Joined:
    Feb 4, 2013
    Messages:
    2,655
    Location:
    SF Bay Area, CA
    rego...did you just port the existing open source beta from Eleks? Looks great. I'm in...will Apple string you along for approval, and do you expect any issues/problems with TM?
     
  16. AllenWong

    AllenWong Member

    Joined:
    Dec 9, 2014
    Messages:
    738
    Location:
    Orlando, FL
    To answer your last two questions: I'm not sure. I've dealt with Apple for years now, so I know what they expect. Basically, I have to make sure that people know that this isn't an official Tesla app and I can't use any of Tesla's logos/trademarks. I expect some issues with TM when they come out with their own Apple Watch app. But in the mean time, I don't see why this is bad for them. I'll filling a gap for users that they haven't yet fulfilled. I'm doing them a favor, because I expect only a dozen people to buy this app (so I'd probably earn like $100 only after taxes and Apple's 30% fee). I spent over 100 hours on it already, so that comes down to less than $1 per hour of work if my estimated revenue is correct (and I'm rarely wrong about it).

    To answer your first question: No. Their source code is very buggy, and was probably coded as a PR stunt. You can really tell once you start using it. First of all, they're using the old API that doesn't work anymore. And even if you fix their API calls, it works great for like... 30 seconds and then it crashes. I already explained my dealings with their code in my YouTube comments where people thought that all I did was port their code. The TL;DR is that their code was mostly hacked together to work for the 42mm device for a few seconds at a time and wouldn't work in the real world. But here's the huge wall of text if you're interested in reading it in detail:

    My app looks like Eleks' app, because my app's design was influenced by theirs along with a few other designs such as TRON and FALLOUT's pipboy2000. That's because when I researched on how to create this app, things like their app and timdorr.apiary.io and few other projects that uses Java, Ruby or Node.js to access the Tesla servers all came up in my research. I don't remember every website I looked at, but those were the ones off the top of my head. There were probably 30 different websites that I used to learn how to create this app and access the Tesla servers. They all gave me an idea of how the app should look and work, and I gave it my own touch to make the designs, in my opinion, better.

    Of course, now you're probably wondering, "Oh, so all you did was just opened it in xcode and hit that play button." Nope. Look at Eleks' code. You'll see that it's actually running off a mock API server put up by timdorr.apiary.io and not the actual Tesla API. That mock server was supposed to mimic Tesla's servers and Eleks' code even has a setting in their source code that lets you plug in the actual Tesla API server. Go ahead and change the setting to point to the real server. CRASH. What happened? If you do the research, you'll find that Tesla changed their API server address. Okay, now try to plug in the new Tesla API server link. CRASH. What happened now? If you do the research, you'll find that Tesla also changed the API calls and responses. They also changed the login method from simple cookie authentication to an O-Auth system. Okay, fix the code to handle the new API calls and responses. CRASH. What now? The O-Auth system requires that you have a client id and client secret key to be able to get O-Auth tokens from it? Where do you get that? There's no published answer to this question. No developer dares post up a client secret key. That's like publishing someone's personal password. This is the roadblock where scriptkiddies will get stumped on and give up. You have to extract and decrypt the client id and secret key from Tesla's official apps. It's not super hard to do, but it's also not something where you can just simple copy from somewhere.


    Okay, IF you manage to figure out the client id and secret key, you now have to code the O-Auth system into Eleks' code. You do that, and then... you guessed it: CRASH. What happened now? If you run Eleks' code on their mock servers, it works just fine. That's because the mock servers are always happy to give you a proper error-free response. So Eleks' code oddly blasts the mock servers with the same API calls a dozen times just to display one screen. Why's that? It's poorly coded. If you did this to Tesla's actual API servers, they detect that too many API calls were made in a short period of time and they start blocking your calls. This crashes Eleks' code of course, because they don't handle the errors properly. There also several dozen other major bugs in their code that just makes their Apple Watch not work in the real world. It'll run for maybe a minute and then crash on you later. I could never get it run for more than half an hour.


    They also make no attempt at caching the API responses. So not only are they hammering the API server, they also don't bother saving the results. Once you swipe to the next screen, they start hammering the servers again, even though they had all the information they needed already just a second ago. Or if you put the watch down to turn off the display and look at it again, it starts hammering the servers again. Do this enough times and you'd probably issue the same API calls 100 times per minute. It wasn't surprising that Tesla's servers for blocking my IP address from making more API calls after Eleks' code hammered it so much. Of course Eleks' developers didn't care, because they only had to make their code work for that short video. They control when they swipe the screen. They didn't have an actual Apple Watch, otherwise they'd see that their code doesn't work in real world conditions. I immediately stopped using their code after that and had to go fetch myself a new IP address to unblock myself.


    So as you can see, Eleks' code is mostly useless to me. This is where I gave up on it and started my own project. Their code is just a huge pile of mess. They probably didn't care, because all they had to do was hack together some code to create their trailer video that makes it look like everything will actually work. If you look at the github project, you'll see that it hasn't been touched since February, when their trailer video was completed. They did nothing since then to make it actually work on Tesla's new API servers. It's clear to me from their code that their intention wasn't to create an app that runs well. It just had to run long enough to create the video, but not actually work in the real world. It was all a PR stunt to make their company look good. Tesla actually switched over to their new servers back in December, when firmware version 6.0 came out, so they didn't have an excuse to not switch over the new API protocol instead of using the outdated API that Tim Dorr outlined on timdorr.apiary.io. They probably didn't do it, because they weren't able to get that client id and secret key that I mentioned earlier. Plus, they didn't have to, because they only wanted a proof of concept video and not a real working app.


    They did have one good thing, though. Their design complied with Apple's design guideline specs. When I designed my Tesla Apple Watch app, I kept their design in mind. Their design wasn't perfect, though. It looks fine on a 42mm watch, but certain elements are cropped off in a 38mm watch. This further proves that Eleks' code was never intended to work in the real world. It just had to work for one model of the Apple Watch to make the trailer video and screenshots and not have to work on the other half of Apple Watches. So I still had to create my own designs, because some things didn't make sense. Ultimately, I created my own graphics as well, because I don't like simply copying other people's graphics. It's copyright infringement if I do. They look similar, but if you compare the two carefully, you'll see that they're actually different.


    Sorry for the long explanation. But without it, it'd look like all I did was "just opened it in xcode and hit that play button." If you guys still don't believe me, all I can say, okay, then go do that. Show me your Apple Watch app built using Eleks' code that will actually command a real Tesla and doesn't crash after half an hour. I'd like to see someone try without putting in the dozens and dozens of hours of work that I did trying to fix their code and eventually just giving up on it and making my own.
     
  17. johndiciaccio

    johndiciaccio Member

    Joined:
    Apr 26, 2015
    Messages:
    7
    Location:
    Pasadena,CA
    Looks great. Count me in as well!
     
  18. araxara

    araxara S-P85#3,218 X-90D#3,299

    Joined:
    May 11, 2012
    Messages:
    882
    Location:
    Tucson, AZ
    Thanks for the thoughtful reply. I can attest to what you have said. I tried originally to get the Eleks code running and ran into the same issues. I gave up at the time because I didn't have an Apple Watch. Now that I have an Apple Watch, and you have done all the heavy lifting, I will not bother with their code and buy your app.

    Since you are required to install an iOS app to have the Apple Watch work properly, have you thought of duplicating the app's functionality on the iOS device? Something similar to the Tesla app? I would especially like to see more functionality and only having to run one app. Touch ID would also be good for authentication.
     
  19. R²B

    R²B All Star

    Joined:
    Aug 24, 2014
    Messages:
    340
    Location:
    Waddell, AZ
    You really charging $10 for this?
     
  20. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,395
    Location:
    Toronto
    Thanks for the detailed reply. I think you may have underestimated your sales volume.
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC