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

Open Source Teslalogger on Raspberry / Docker with ScanMyTesla integration

This site may earn commission on affiliate links.
I'm trying to host Teslalogger myself. I have cloned the github repo, copy the config file Teslalogger/bin folder and added the connection string and my tesla account credential.
Everything starts up as it should. It connects to the database, gui works, but I also have trouble getting token.

During startup
#1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)

when I try reconnect in the credential in the web gui I get this :

09.03.2021 22:38:58 : #1: Abort: Reconnect!
09.03.2021 22:38:58 : Start Reconnect!
09.03.2021 22:38:58 : #1: GetAvgConsumption: nothing found!!!
09.03.2021 22:38:58 : #1: No Refresh Token
09.03.2021 22:38:58 : #1: Login with : 'XesXaXXarXXnXenXorX' / 'xxxxxxxxxxxxxxxxxxxxxxxx'
09.03.2021 22:39:28 : #1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)
09.03.2021 22:39:28 : #1: Abort: Tesla_token == NULL
09.03.2021 22:39:28 : #1: *** Exit Loop !!!

Help?
 
I'm trying to host Teslalogger myself. I have cloned the github repo, copy the config file Teslalogger/bin folder and added the connection string and my tesla account credential.
Everything starts up as it should. It connects to the database, gui works, but I also have trouble getting token.

During startup
#1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)

when I try reconnect in the credential in the web gui I get this :

09.03.2021 22:38:58 : #1: Abort: Reconnect!
09.03.2021 22:38:58 : Start Reconnect!
09.03.2021 22:38:58 : #1: GetAvgConsumption: nothing found!!!
09.03.2021 22:38:58 : #1: No Refresh Token
09.03.2021 22:38:58 : #1: Login with : 'XesXaXXarXXnXenXorX' / 'xxxxxxxxxxxxxxxxxxxxxxxx'
09.03.2021 22:39:28 : #1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)
09.03.2021 22:39:28 : #1: Abort: Tesla_token == NULL
09.03.2021 22:39:28 : #1: *** Exit Loop !!!

Help?

Good to know that I'm not the only one. I was starting to doubt myself.
This is the exact error I am getting too.
And I know for sure that I'm using the correct credentials, I have TeslaMate in another GCP micro f1 server working perfectly.

I have sent @bassmaster already my log file, hope he can fingure out what is causing this issue.
 
I'm trying to host Teslalogger myself. I have cloned the github repo, copy the config file Teslalogger/bin folder and added the connection string and my tesla account credential.
Everything starts up as it should. It connects to the database, gui works, but I also have trouble getting token.

During startup
#1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)

when I try reconnect in the credential in the web gui I get this :

09.03.2021 22:38:58 : #1: Abort: Reconnect!
09.03.2021 22:38:58 : Start Reconnect!
09.03.2021 22:38:58 : #1: GetAvgConsumption: nothing found!!!
09.03.2021 22:38:58 : #1: No Refresh Token
09.03.2021 22:38:58 : #1: Login with : 'XesXaXXarXXnXenXorX' / 'xxxxxxxxxxxxxxxxxxxxxxxx'
09.03.2021 22:39:28 : #1: Error in GetTokenAsync: One or more errors occurred. (A task was canceled.)
09.03.2021 22:39:28 : #1: Abort: Tesla_token == NULL
09.03.2021 22:39:28 : #1: *** Exit Loop !!!

Help?
I tried a fresh reinstall and it seams like it works.

18.03.2021 10:29:43 : #1: GetAvgConsumption: nothing found!!!
18.03.2021 10:29:43 : #1: No Refresh Token
18.03.2021 10:29:43 : #1: Login with : 'XhrXsXXanXXoXeaXaiX.XX' / 'xxxxxxxxxxx'
18.03.2021 10:29:44 : #1: Start waiting for MFA code !!!
18.03.2021 10:29:54 : #1: Wait for MFA code !!!
18.03.2021 10:30:04 : #1: Wait for MFA code !!!
18.03.2021 10:30:10 : #1: MFA Code: 784736
18.03.2021 10:30:10 : #1: transaction_id:
......
18.03.2021 10:30:12 : #1: UpdateRefreshToken
18.03.2021 10:30:12 : #1: UpdateRefreshToken OK: 1
18.03.2021 10:30:13 : #1: HttpStatus: OK
18.03.2021 10:30:13 : #1: UpdateTeslaToken
18.03.2021 10:30:13 : #1: update tesla_token OK: 1
18.03.2021 10:30:13 : #1: TOKEN: XtsXdXX90XXcXf4X83XbXX86XXaX15Xb7XeXX04XXcX60X10XfXXe8XX1XdcX01X5XX1
18.03.2021 10:30:14 : #1: display_name: Teslarossa
18.03.2021 10:30:14 : #1: vin: 5YJSA7E21JFXXXXXX
18.03.2021 10:30:14 : #1: WriteCarsettings -> VIN
18.03.2021 10:30:14 : #1: UpdateTeslaToken

I'm gonna retry this with a TeslaAccount without MFA
 
I can confirm either google cloud is blocked by tesla or there is another problem in authentification process.
My account works on different docker and raspberries perfect, but on google cloud not with the same timeout error you guys have.

If I use a token from my raspberry on google cloud, everythig works fine. I'll check tomorrow if google cloud is really blocked by tesla.
 
  • Like
Reactions: sp33dm3
I can confirm either google cloud is blocked by tesla or there is another problem in authentification process.
My account works on different docker and raspberries perfect, but on google cloud not with the same timeout error you guys have.

If I use a token from my raspberry on google cloud, everythig works fine. I'll check tomorrow if google cloud is really blocked by tesla.

Thanks a lot for testing this issue Christian, we really appreciate it.
Thank god I'm not stupid :cool:

I'm quite sure it is not a block on Google cloud, because I also have TeslaMate running on another micro f1 server (same set-up as the one with TeslaLogger)
and TeslaMate runs very well.
Also I tried to run TeslaLogger on the same server as I have TeslaMate running, which starts but gives same authentication error.
 
Thanks a lot for testing this issue Christian, we really appreciate it.
Thank god I'm not stupid :cool:

I'm quite sure it is not a block on Google cloud, because I also have TeslaMate running on another micro f1 server (same set-up as the one with TeslaLogger)
and TeslaMate runs very well.
Also I tried to run TeslaLogger on the same server as I have TeslaMate running, which starts but gives same authentication error.

It seems like some connections are routed to a different load balancer and this one is blocking several user-agents... please update to the latest teslalogger and give it another try.
 
Hi @bassmaster ,

I now have both TeslaMate and TeslaLogger running on 1 GCP micro f1 server and both are working great (thanks to your fix).
Of course I want to make comparisons between the two and honestly TeslaLogger looks more appealing.
However there is 1 major disadvantage of TeslaLogger, it is not secure at all.
It runs on HTTP and the password is not encrypted.

Because I really believe that you can get a lot more users by running TeslaLogger on the GCP micro f1 server (they don't have to buy a Raspberry, and
this solution is absolutely free) if you can make TeslaLogger secure.

Would you be willing to make the adjustments to make it secure ?
 
Please update your Teslalogger.
I have updated and now it works. Thanks!! :)

For my next problem...
I try to import from teslamate...

I have trouble running the teslamate-import.exe. I`m on linux. I have install latest dotnet:

dotnet --list-sdks
5.0.201 [/usr/share/dotnet/sdk]

dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

I'm not sure how I should start the import program, but I have tried to start it from the bin folder like this:

dotnet run Teslamate-Import.exe --project ../Teslamate-Import.csproj

I then get this:
/usr/share/dotnet/sdk/5.0.201/Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at Install the .NET Framework developer pack or redistributable [/home/nopain/dev/TeslaLogger/Teslamate-Import/Teslamate-Import.csproj]


Can I install and run targetFramework="net461" on linux?
 
I have updated and now it works. Thanks!! :)

For my next problem...
I try to import from teslamate...

I have trouble running the teslamate-import.exe. I`m on linux. I have install latest dotnet:

dotnet --list-sdks
5.0.201 [/usr/share/dotnet/sdk]

dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

I'm not sure how I should start the import program, but I have tried to start it from the bin folder like this:

dotnet run Teslamate-Import.exe --project ../Teslamate-Import.csproj

I then get this:
/usr/share/dotnet/sdk/5.0.201/Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at Install the .NET Framework developer pack or redistributable [/home/nopain/dev/TeslaLogger/Teslamate-Import/Teslamate-Import.csproj]


Can I install and run targetFramework="net461" on linux?
It's not dotnet, TeslaLogger and all importers run with mono
 
Hi @bassmaster ,
Would you be willing to make the adjustments to make it secure ?
We could add some sort of proxy in docker-compose to achieve this. I think you can do it by yourself if you create a .htpasswd file in apaches webfolder. For encryption you might do the same as you did for TeslaMate.

BTW: make sure you add like 1 GB of virtual RAM to your Google micro server. I had a couple of outofmemory exceptions on this stack.
 
We could add some sort of proxy in docker-compose to achieve this. I think you can do it by yourself if you create a .htpasswd file in apaches webfolder. For encryption you might do the same as you did for TeslaMate.

BTW: make sure you add like 1 GB of virtual RAM to your Google micro server. I had a couple of outofmemory exceptions on this stack.

Actually I'm quite the n00b when it comes to Linux and docker containers.
To set up TeslaMate, I just simply followed this guide : How to setup and run TeslaMate for free on Google Cloud - TeslaEV.co.uk

Luckily this guide also explains how to set up a 1 GB swap file.
 
Not experienced with unix, but in the log there is something looks a bit strange, if it is or not I don't know. But it seems that a 'kworker' task is timing out again and again - 'task kworker/3:1:5002 blocked for more than 845 seconds'

Could that be something? Maybe more a question for ubuntu than TeslaLogger?
 
Not experienced with unix, but in the log there is something looks a bit strange, if it is or not I don't know. But it seems that a 'kworker' task is timing out again and again - 'task kworker/3:1:5002 blocked for more than 845 seconds'

Could that be something? Maybe more a question for ubuntu than TeslaLogger?
It seems like mono has a memory leak with HttpHandler in last Teslalogger version and we found a workaround. Make sure you update Teslalogger to the latest version. If you still have problems, let me know.