Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaLog.com - Your hosted Tesla Data Logger - Announcement / Support threads

This site may earn commission on affiliate links.
Ok right, you had a problem. I moved capture to some car to a different server because it was overloaded. Your car got on an instance that shouldn't have had car on it. 10 car were affected.

It would have been resolved tonight also once I moved it to the new data logger. But I've started that server so those 10 car get logging working again now.

I do have monitoring that give me warning if cars are not logged, but not when there is just 10 (as there is a lot of car that are not logged for different reason).

Will try to think of a different way to check for this scenario (though it will be different with the new logger).
 
Ok right, you had a problem. I moved capture to some car to a different server because it was overloaded. Your car got on an instance that shouldn't have had car on it. 10 car were affected.

It would have been resolved tonight also once I moved it to the new data logger. But I've started that server so those 10 car get logging working again now.

I do have monitoring that give me warning if cars are not logged, but not when there is just 10 (as there is a lot of car that are not logged for different reason).

Will try to think of a different way to check for this scenario (though it will be different with the new logger).

Looks like everything is back up and running for me now. Thanks for the help (and for a great tool)!
 
Trips are logged, just not syncronized on TeslaLog website ! My sync script is running slower than all the new entry (especially right now with all the car on the road).

I currently have over 2million entry in queue to be processed. So that about 5 hours worth of position recording.

So the trip are being recorded, but not put on teslalog site just yet.

I got idea on how to make the sync process faster, but I can't do it right now.

I'll let you know when I get to work on it later today and when I expect the backlog to be processed.

UPDATE: Small tweak allowed me to go faster, so queue is being emptied slowly.
 
Last edited:
Would it be possible to give instructions or a little tool for all of us to generate our own tokens, so we don't have to send our Tesla passwords to your server?
I see no universal way that is easy yet really protect you more...

The best solution would be that if a local .html file can be loaded in your browser with permissions to do cross-site. But that still not going to work by default from what I've tried.

I want to do an android application for it, so that the password is stored on your phone only, and it will refresh every few month or when needed the key only to my server. BUT if you don't trust using my server as passthough, then an local android application won't help since compiled code and you won't know if there something wrong happening behind it.

I could show simple Curl commands that will do the trick also. If your on windows, you could get a copy of it here : cURL - Download But again, that binary could be compromised...

I have no perfect solutions for you to generate a token.

But I can make a web form so you can submit a token you have found on your end.

It all depend on how paranoiac you are ;) The only one that can really improve security of your password here is Tesla itself.
 
Maybe you covered this before -- but why can't javascript do the tasks needed to generate a token?
When your trying to connect to a different domain from javascript, browser maker decided to put in place a restriction.

So the browser will first query a certain url and ask what domain is allowed to query this address. If the browser get no response or the original domain is not in the list, the browser reject the query.

There is some way around this, but none that allow to do the specific query tesla server require.
 
I use a mac so I have curl. So yes, I'd be interested in the curl commands. Thanks.
Here is the curl command to get a token from Tesla Server :
Code:
curl -H "Content-Type: application/json" -d '{"grant_type" : "password", "client_id" : "PUT_TESLA_CLIENT_ID_HERE", "client_secret" : "PUT_TESLA_CLIENT_SECRET", "email" : "Your Tesla Email", "password" : "Your Tesla Password"}' https://owner-api.teslamotors.com/oauth/token
You need to find that client_id and client_secret on your own ! (Google is your friend)

You can then get that output on screen and change this url to push your token to teslalog.com : (You can't really use curl here since it require you to be already logged in (You could actually, but I'm not going to help you there ;))

Code:
https://teslalog.com/api.php?req=tesla_token_add&expire=7776000&tesla_email=yourteslaemail.com&key=mykeyhere

PS. All trips are now up to date since a few hours ago...
 
Last edited:
  • Like
Reactions: hiroshiy
When your trying to connect to a different domain from javascript, browser maker decided to put in place a restriction.

So the browser will first query a certain url and ask what domain is allowed to query this address. If the browser get no response or the original domain is not in the list, the browser reject the query.

There is some way around this, but none that allow to do the specific query tesla server require.

Right... Cross site scripting. But what if the JavaScript is run locally, or say, for example, a Cordova/Phonegap app? Or node.js?
 
Right... Cross site scripting. But what if the JavaScript is run locally, or say, for example, a Cordova/Phonegap app? Or node.js?
I haven't tried it, but what I read seem to suggest local run javascript have similar restriction unless you change browser settings. An Cordova app could be an option, but it remain that it would have to be a already compiled binary so people still need to trust the publisher.

I've done my first cordova app for android last month which was to interface with the bluetooth from my android phone to talk to my car CAN Bus logging system I'm building. It probably going to be what I'll use for my first mobile application for TeslaLog as well.
 
Here is the curl command to get a token from Tesla Server :
Code:
curl -H "Content-Type: application/json" -d '{"grant_type" : "password", "client_id" : "PUT_TESLA_CLIENT_ID_HERE", "client_secret" : "PUT_TESLA_CLIENT_SECRET", "email" : "Your Tesla Email", "password" : "Your Tesla Password"}' https://owner-api.teslamotors.com/oauth/token
You need to find that client_id and client_secret on your own ! (Google is your friend)

You can then get that output on screen and change this url to push your token to teslalog.com : (You can't really use curl here since it require you to be already logged in (You could actually, but I'm not going to help you there ;))

Code:
https://teslalog.com/api.php?req=tesla_token_add&expire=7776000&tesla_email=yourteslaemail.com&key=mykeyhere

PS. All trips are now up to date since a few hours ago...
Thanks, Marc. I've changed my Tesla password and sent a new token to teslalog using these instructions. For anyone else doing this, there's a link to the the tesla client_id and client_secret here: https://raw.githubusercontent.com/timdorr/model-s-api/master/apiary.apib.