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.
  • I then get the error: -bash: /backuplocation/teslamate.bck: No such file or directory
  • If i use the md command to create a folder i get this error: -bash: -bash:: command not found
No idea what im doing wrong here?

The "md" command doesn't exist on Unix (that's from Windows), the correct command to create a directory is "mkdir":
Code:
sudo mkdir /backuplocation
sudo docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck

I would recommend however that instead of creating the directory within root that you create the backup location within your home directory - you can add a "~" as a shortcut for that. It will remove the necessity to work as "root". You can also swap out "backuplocation" for a simpler name if you'd like.

Code:
mkdir ~/backuplocation
docker-compose exec -T database pg_dump -U teslamate teslamate > ~/backuplocation/teslamate.bck
 
Last edited:
The "md" command doesn't exist on Unix (that's from Windows), the correct command to create a directory is "mkdir":
Code:
sudo mkdir /backuplocation
sudo docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck

I would recommend however that instead of creating the directory within root that you create the backup location within your home directory - you can add a "~" as a shortcut for that. It will remove the necessity to work as "root". You can also swap out "backuplocation" for a simpler name if you'd like.

Code:
mkdir ~/backuplocation
docker-compose exec -T database pg_dump -U teslamate teslamate > ~/backuplocation/teslamate.bck

Can you tell I don’t use Unix much, tend to remember this stuff as I’m working it out. Thanks for clarifying @dakaix

Apologies @w3zly !
 
  • Like
Reactions: w3zly
Change your Tesla account password. Then login to the Tesla app (you will need to use 2FA). Then login to TeslaMate. Leave the other apps out of it for now. I've always found having multiple apps logged in does seem to eventually cause issues with the car not sleeping (maybe for you this is manifesting as login problems), so it's best to minimise who/what has access to the account, by paring it back to the essentials, and then slowly adding one app every few days so if you start having problems you have a chance of finding the culprit.

Upgrading to Teslamate 1.21.0, with full MFA support, fixed my issue as I am now able to use Tesla MFA with all 3 apps (Tesla, Teslamate and Stats). Thanks for the tips everyone!
 
  • Like
Reactions: Medved_77
So a reboot of the switch in my office has restored connectivity to the pc with TeslaMate on it, but its been without an Internet connection for about four days. Is there a way I can retrieve the history from those 4 days, as they're completely missing from teslamate (inc multiple trips and charges)?
 
So a reboot of the switch in my office has restored connectivity to the pc with TeslaMate on it, but its been without an Internet connection for about four days. Is there a way I can retrieve the history from those 4 days, as they're completely missing from teslamate (inc multiple trips and charges)?

Sadly no - that data will have been lost. Tesla’s unofficial API only returns current/live data and so Teslamate/TeslaFi etc have to continually stream data from Tesla’s servers in order to build up the history.

If you had another instance of Teslamate or even a TeslaFi trial you could have looked at restoring the gap, but without that you’re going to be out of luck I’m afraid!
 
Sadly no - that data will have been lost. Tesla’s unofficial API only returns current/live data and so Teslamate/TeslaFi etc have to continually stream data from Tesla’s servers in order to build up the history.

If you had another instance of Teslamate or even a TeslaFi trial you could have looked at restoring the gap, but without that you’re going to be out of luck I’m afraid!

Thanks - I suspected so. I think I might look into setting up a second instance of TeslaMate to avoid any gaps.
 
The "md" command doesn't exist on Unix (that's from Windows), the correct command to create a directory is "mkdir":
Code:
sudo mkdir /backuplocation
sudo docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck

I would recommend however that instead of creating the directory within root that you create the backup location within your home directory - you can add a "~" as a shortcut for that. It will remove the necessity to work as "root". You can also swap out "backuplocation" for a simpler name if you'd like.

Code:
mkdir ~/backuplocation
docker-compose exec -T database pg_dump -U teslamate teslamate > ~/backuplocation/teslamate.bck
Thanks for clarifying! I've got Dave helping me a little later on so will wait for him first before i start tinkering around, but this will absolutely help when we try and setup the backups :)
 
Any idea how I can create a brand new database to start recording afresh from the start of the year? (running teslamate on raspberry pi)

Stupid question, but why would you want to do this? You can already limit the number of records/history shown on Grafana by using the range dropdown in the top right.

You could achieve this by tweaking the docker-compose.yml file, changing the Database name (having done a "docker-compose stop" & "docker-compose up" before/after), but be aware that as soon as you do that you won't get to see the old data in Grafana.
 
Last edited:
My TeslaMate system (on a Pi) has been running just fine for a few weeks. I even added the automated backup to Google Drive on a nightly basis, and all was fine.

However, the scheduled backup seems to have stopped working since the 27th of December.

If I log in and run the backup manually, it works, and if I schedule it for the 'next minute' it also seems to work. However, once I set it back to 3am, then it doesn't seem to want to work.

Any thoughts or advice - I'm not a Unix man and don't really understand cron, but I get the feeling some automated task may not be starting after a reboot maybe?
 
My TeslaMate system (on a Pi) has been running just fine for a few weeks. I even added the automated backup to Google Drive on a nightly basis, and all was fine.

However, the scheduled backup seems to have stopped working since the 27th of December.

If I log in and run the backup manually, it works, and if I schedule it for the 'next minute' it also seems to work. However, once I set it back to 3am, then it doesn't seem to want to work.

Any thoughts or advice - I'm not a Unix man and don't really understand cron, but I get the feeling some automated task may not be starting after a reboot maybe?

I think we had a similar problem with @Roy W. in this thread, worth a bit of back reading (I'll try and find the post a bit later if you don't beat me to it :) )
 
I think we had a similar problem with @Roy W. in this thread, worth a bit of back reading (I'll try and find the post a bit later if you don't beat me to it :) )
I did indeed! In my case deleting the cron job and recreating it seemed to do the trick, although even to this day I get the odd day where I end up with multiple backup files for the same night on Google!

The story starts here: TeslaMate update
 
  • Like
Reactions: DaveW
I've not been hovering around here quite so much lately because Santa bought me a new toy for Christmas - my first 3D printer. If you thought TeslaMate and TeslaFi were rabbit holes, the 3D printer is a positive labrynth of lagomorphic delight :)

My Pi incarnation of TeslaMate is ticking along nicely, with more car updates than drives recently, but there is one little hiccup I'd still like to resolve. While I was on holiday on Skye last year Teslamate stopped logging anything for a few days until I returned home and was able to reboot. Among the drives that were lost was the journey back from Skye. That in itself doesn't bother me, but it does rather spoil the Visited map, because it looks like I flew back from Skye International Airport by air...

Screenshot 2021-01-05 at 10.19.01.png


Is there any (safe and easy :cool:) way I can edit my data to remove the non-existent return journey?
 
Is there any (safe and easy :cool:) way I can edit my data to remove the non-existent return journey?

Not easily, no... Grafana is showing all known trips together and joining the start/end for one continuous line. So because it's a non-existent journey it assumes you flew your M3 home!

What you would have to do is to manually create a trip in the database, and then populate the GPS locations, speed, consumption etc. Perhaps you could make a stab of it using the data from your outbound journey. You'll find the trip summary in the "trip" table of the Teslamate database, and an entry in the "positions" table every 3 seconds of the journey. You could export those for a given date/time range, manually update (particularly the odometer reading) and then insert into the database.

It's not a small task however!
 
  • Helpful
Reactions: Roy W.
Stupid question, but why would you want to do this? You can already limit the number of records/history shown on Grafana by using the range dropdown in the top right.

You could achieve this by tweaking the docker-compose.yml file, changing the Database name (having done a "docker-compose stop" & "docker-compose up" before/after), but be aware that as soon as you do that you won't get to see the old data in Grafana.

Basically because my current DB is messed up and it'd be easier to start again from Jan 21 than sort out all the spurious entries. I tried editing the YML. but the data is still there somehow. As was when I did a re-install. so must be missing something.

Idiot proof instructions on starting again welcome :)