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

TeslaMate [megathread]

This site may earn commission on affiliate links.
My teslamate account had logged me out, I tried to log back in again with new tokens and it failed.
I'd read there have been some changes to the API including the length of the API token so I upgraded Teslamate
Now it won't start, the error being

clock_gettime(CLOCK_MONOTONIC, _) failed​

I'm regressed Teslamate to a version that works, but the tokens don't work again.

EDIT: Solved with 1.25.0 (anything higher and it seems to fail with the above, anything lower and the tokens fail)
Raspberry Pi: clock_gettime(CLOCK_MONOTONIC, _) failed: Opera...

teslamate issue 2330 comment 1011362938

You need to either upgrade your Pi OS or backport a service file. Details in those two links. Adrian's comment here: Raspberry Pi: clock_gettime(CLOCK_MONOTONIC, _) failed: Operation not permitted (1) · Issue #2302 · adriankumpf/teslamate
 
My teslamate account had logged me out, I tried to log back in again with new tokens and it failed.
I'd read there have been some changes to the API including the length of the API token so I upgraded Teslamate
Now it won't start, the error being

clock_gettime(CLOCK_MONOTONIC, _) failed​

I'm regressed Teslamate to a version that works, but the tokens don't work again.

EDIT: Solved with 1.25.0 (anything higher and it seems to fail with the above, anything lower and the tokens fail)
That's a well known issue, search in this thread for the upgrade path for your pi.

Edit, sorry didn't see @cwanja post
 
  • Like
Reactions: cwanja
Thanks both. I'm happy with 1.25. Good to know there are fixes if I do upgrade later on but I've not got the time to invest much more time in trying to get a later version working now I have one that does. Apologies for not reading back,

Can someone remind me when I complain in the future that it won't upgrade that I edited the yml file to fix the version! :)
 
My teslamate account had logged me out, I tried to log back in again with new tokens and it failed.
I'd read there have been some changes to the API including the length of the API token so I upgraded Teslamate
Now it won't start, the error being

clock_gettime(CLOCK_MONOTONIC, _) failed​

I'm regressed Teslamate to a version that works, but the tokens don't work again.

EDIT: Solved with 1.25.0 (anything higher and it seems to fail with the above, anything lower and the tokens fail)
I had the same issue fairly recently. Its annoying because it happens during an otherwise innocuous looking upgrade. Fortunately the fix, upgrading Rasbian, wasn't overly complicated, though.

I don't like the new states panel in Grafana either. I restored the old version.
 
I'm running TM on Google GCP and have received the following email about the OAuth flow being blocked soon. It's all over my head so I'm hoping some kind soul will explain what changes need to be made to keep TM running:

Hello Google OAuth Developer,

We are writing to inform you that OAuth out-of-band (OOB) flow will be deprecated on October 3, 2022, to protect users from phishing and app impersonation attacks.

What do I need to know?​

Starting October 3, 2022, we will block OOB requests to Google’s OAuth 2.0 authorization endpoint for existing clients. Apps using OOB in testing mode will not be affected. However, we strongly recommend you to migrate them to safer methods as these apps will be immediately blocked when switching to in production status.

Note: New OOB usage has already been disallowed since February 28, 2022.

Below are key dates for compliance


  • September 5, 2022: A user-facing warning message may be displayed to non-compliant OAuth requests
  • October 3, 2022: The OOB flow is blocked for all clients and users will see the error page.
Please check out our recent blog post about Making Google OAuth interactions safer for more information.

What do I need to do?​

Migrate your app(s) to an appropriate alternative method by following these instructions:

  1. Determine your app(s) client type from your Google Cloud project by following the client links below.
  2. Migrate your app(s) to a more secure alternative method by following the instructions in the blog post above for your client type.
If necessary, you may request a one-time extension for migrating your app until January 31, 2023. Keep in mind that all OOB authorization requests will be blocked on February 1, 2023.
 
there's another thread here about that:


No answers as yet, but someone else is looking into it. It really only impacts your backup as far as I can see.
 
Last edited:
Would love some help, if you all have time. I upgraded Grafana to 8.3.4 and TeslaMate, as well, today. Now it appears my TM-specific tables are gone. E.g., there's no cars table. Does this mean I've lost my data? Or is the DSN pointed at the wrong database? TY!
 
Would love some help, if you all have time. I upgraded Grafana to 8.3.4 and TeslaMate, as well, today. Now it appears my TM-specific tables are gone. E.g., there's no cars table. Does this mean I've lost my data? Or is the DSN pointed at the wrong database? TY!
What are you using to look at the tables? Grafana or logging directly into the DB? Any error messages in the logs?
 
1653595724124.png

Approaching the £10k club :cool:

Query if you want to add this panel:
select convert_km(odometer::numeric, '$length_unit') * 0.17 - (SELECT sum(cost) FROM charging_processes WHERE $__timeFilter(end_date) AND car_id = $car) from positions where car_id = $car order by date desc limit 1;


Change the 0.17 for what you consider the per mile cost for an ICE car. I had a BMW M140i previously which was pretty thirsty.
 
  • Love
Reactions: cwanja
View attachment 809108
Approaching the £10k club :cool:

Query if you want to add this panel:
select convert_km(odometer::numeric, '$length_unit') * 0.17 - (SELECT sum(cost) FROM charging_processes WHERE $__timeFilter(end_date) AND car_id = $car) from positions where car_id = $car order by date desc limit 1;


Change the 0.17 for what you consider the per mile cost for an ICE car. I had a BMW M140i previously which was pretty thirsty.
I've got one like that, but the price of petrol/diesel goes up faster than I can update it :)
 
View attachment 809108
Approaching the £10k club :cool:

Query if you want to add this panel:
select convert_km(odometer::numeric, '$length_unit') * 0.17 - (SELECT sum(cost) FROM charging_processes WHERE $__timeFilter(end_date) AND car_id = $car) from positions where car_id = $car order by date desc limit 1;


Change the 0.17 for what you consider the per mile cost for an ICE car. I had a BMW M140i previously which was pretty thirsty.
This would be an awesome add to the overall application. I will see if I can do a PR. I do not run my instances separate, all docker. So I cannot modify the dashboards, or they are overwritten eventually.
 
This would be an awesome add to the overall application. I will see if I can do a PR. I do not run my instances separate, all docker. So I cannot modify the dashboards, or they are overwritten eventually.
The problem with the static ICE cost is that your charging cost is not static and as it increases the savings reduce when we know the petrol cost has also gone up. In my query I have an annual (ok only done it once:) ) review of the ICE cost and calculate the ICE cost for each year. e.g. I have an ICE_Cost of 15p for 2021 and an ICE_cost of 18p for 2022. My query uses the appropriate year cost in it's calculation.

With respect to modifying dashboards, I just create copies of the existing ones e.g. I have an Overview2 with my panels and queries in it. When TM gets updated they are not overwritten (but remember to take backups!)
 
  • Love
Reactions: cwanja
I have set up a Google GCP instance with 30GB drive. Will this be enough storage for long term TeslaMate use? Yet to get my car.
Cheers
Definitely. You could scale down to save money (maybe, not sure the pricing structure). My backup is currently 60MB, six months of ownership 2400 miles. My previous S, two years of ownership and 24000 miles was 206MB. So you should be good.