Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • Want to remove ads? Register an account and login to see fewer ads, and become a Supporting Member to remove almost all ads.
  • Tesla's Supercharger Team was recently laid off. We discuss what this means for the company on today's TMC Podcast streaming live at 1PM PDT. You can watch on X or on YouTube where you can participate in the live chat.

TeslaMate [megathread]

This site may earn commission on affiliate links.
more

:)

or grep for a particular date
Corresponds to previous post details: TeslaMate [megathread] ]

These are the logs for around that time:
teslamate_1 | 2023-06-18 18:57:01.870 [info] Start of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: 1687114620, heading: 329, latitude: 34.11597, longitude: -118.23605, native_latitude: 34.11597, native_location_supported: 1, native_longitude: -118.23605, native_type: "wgs", power: 1, shift_state: "D", speed: 0, timestamp: 1687114621750}
teslamate_1 | 2023-06-18 18:57:01.871 car_id=2 [info] Driving / Start
teslamate_1 | 2023-06-18 18:57:59.222 [warning] Too many disconnects from streaming API
teslamate_1 | 2023-06-18 18:57:59.222 car_id=2 [info] Creating new connection …
teslamate_1 | 2023-06-18 18:57:59.223 car_id=2 [info] Disconnecting ...
teslamate_1 | 2023-06-18 18:57:59.245 car_id=2 [info] Connecting ...
teslamate_1 | 2023-06-18 19:04:29.680 [warning] Too many disconnects from streaming API
teslamate_1 | 2023-06-18 19:04:29.680 car_id=2 [info] Creating new connection …
teslamate_1 | 2023-06-18 19:04:29.680 car_id=2 [info] Disconnecting ...
teslamate_1 | 2023-06-18 19:04:29.703 car_id=2 [info] Connecting ...

Then aroudn 11:08PM later that night when I drove from point A to a supercahrger, charged for <5 min, then drove from supercharger to Home. The Drives tab does NOT record the drive and only records a random 40minute charge which is charge+drive.

teslamate_1 | 2023-06-18 23:04:49.706 [info] End of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: 1687129487, heading: 122, latitude: XX.XXXX, longitude: -XX.XXXXX, native_latitude: XX.XXXXX, native_location_supported: 1, native_longitude: -XX.XXXXXX, native_type: "wgs", power: 2, shift_state: "P", speed: 0, timestamp: 1687129488668}
teslamate_1 | 2023-06-18 23:04:49.706 car_id=2 [info] Driving / Ended / 59 km – 75 min
teslamate_1 | 2023-06-18 23:04:49.707 car_id=2 [info] Start / :eek:nline
teslamate_1 | 2023-06-18 23:05:20.991 [info] GET https://nominatim.openstreetmap.org/reverse -> 200 (194.551 ms)
teslamate_1 | 2023-06-18 23:05:21.019 car_id=2 [info] Charging / SOC: 31%
teslamate_1 | 2023-06-18 23:05:21.020 car_id=2 [info] Disconnecting ...
teslamate_1 | 2023-06-18 23:20:38.687 car_id=2 [info] Derived efficiency factor: 149.14 Wh/km (28x confirmed)
teslamate_1 | 2023-06-18 23:20:38.687 car_id=2 [info] Charging / Disconnected / 27.10 kWh – 15 min
teslamate_1 | 2023-06-18 23:20:38.690 car_id=2 [info] Start / :eek:nline
teslamate_1 | 2023-06-18 23:20:38.710 car_id=2 [info] Connecting ...
teslamate_1 | 2023-06-18 23:20:50.824 [info] Start of drive initiated by: %TeslaApi.Stream.Data{time: ~U[2023-06-18 23:20:50.748Z], speed: 0, odometer: 23267.1, soc: 68, elevation: 342, est_heading: 122, est_lat: XX.XXXXXX, est_lng: -XX.XXXXXX, power: 5, shift_state: "R", range: 210, est_range: 181, heading: 122}
teslamate_1 | 2023-06-18 23:20:50.824 car_id=2 [info] Driving / Start
teslamate_1 | 2023-06-18 23:41:02.897 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/1493055996468658/vehicle_data -> 408 (9142.588 ms)
teslamate_1 | 2023-06-18 23:41:02.898 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate_1 | 2023-06-18 23:41:02.899 car_id=2 [error] Error / :unknown
teslamate_1 | 2023-06-18 23:42:00.754 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/XXXXXXXXXXXXXXX/vehicle_data -> 408 (9341.284 ms)
teslamate_1 | 2023-06-18 23:42:00.755 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" =


These logs are wrong because: 1) I didn't charge for 15 min 2) I didn't charge 27 kWh (Tesla account shows charged 12 kWh)
 
Looks like timeout errors in the log. You can change the value of the timeout - if you haven't already. Detail in this thread - but search for timeout .
OK this is super weird. I found all the places I do timeout fix / unclosed drive script. Suddenly my personal comp can't access raspberry pi through shell or grafana browser . I can access through my phone and another computer. Tried starting my personal comp. Tried turning on/off power at the source.. any idea why my comp would suddenly stop being able to connect?

I just get this trying to ssh in to pi...

[XXXXX@XXXXX-Laptop ~]$ssh [email protected]
ssh: connect to host 192.168.X.XXXport 22: Connection timed out
EDIT: Hunting for a solution... can ping on mac, can't ping on windows. Can't figure out why my windows comp can no longer ping the pi
 
Last edited:
OK this is super weird. I found all the places I do timeout fix / unclosed drive script. Suddenly my personal comp can't access raspberry pi through shell or grafana browser . I can access through my phone and another computer. Tried starting my personal comp. Tried turning on/off power at the source.. any idea why my comp would suddenly stop being able to connect?

I just get this trying to ssh in to pi...


EDIT: Hunting for a solution... can ping on mac, can't ping on windows. Can't figure out why my windows comp can no longer ping the pi
Well, can't edit previous post. Been googling for the day and all i can figure out is my windows is blocking access SOMEHOW but i can't figure out how.... if anyone's had to go through this, tips appreciated
 
Try rebooting your router.
This morning it's magically fixed.... did nothing despite trying everything last night wtf. Well, now I am able to get back into pi!

Just to summarize our discussion:

I set `DATABASE_TIMEOUT=240000` under environment section of YML under the teslamate section. Is this the right section? Or should it go under database?

Close drives script: Found the discussion from the other poster but didn't find a link to it -- I assume it's this one? close multiple drives at once · adriankumpf/teslamate · Discussion #2364
I only have 141 unclosed drives (based on no end_date value filled in)!
 
Spot on.

That's the right section.

That link has my script to close multiple drives. Closing an individual drive is quite slow, so it might take an hour or so to close all of your open drives. Just make sure your connection to the Pi stays open during that time e.g. don't let your computer sleep.
 
  • Like
Reactions: acatwith12
Good morning. A couple months I had to factory reset my car. When it came back up it showed that it was at Palo Alto for a couple seconds. I found the drive and using this guide, I deleted the bad location data. I refreshed and the drive and it now looked correct but when I go back to the visited page there's still something there. I then try deleting the whole drive with "DELETE FROM drives WHERE id = 3820;" but it still shows up. I was able to scroll over to the times in question (attached). I tried searching all of the surrounding drive data but can't find the times in question anywhere. Is there something I'm missing? Can I just delete everything from the day?
 

Attachments

  • Screenshot 2023-07-03 074302.png
    Screenshot 2023-07-03 074302.png
    1.5 MB · Views: 40
  • Screenshot 2023-07-04 094121.png
    Screenshot 2023-07-04 094121.png
    215.3 KB · Views: 38
Visited dashboard gets its data from the positions table. You'll have to delete the rows from the positions table where the drive_id is equal to 3820
I've tried delete from positions where id =3820; and it returns DELETE 0. Maybe there's something in a different drive as well? I have also tried using this link but I cannot get it to find the correct longitudes. I know the timeframe is between 2023-02-28 16:34:12 and 2023-02-28 16:37:54 but I cannot figure out the correct code to delete everything in between a timeframe.
 
I wonder if you have an unclosed drive?

SELECT
id,
start_date,
start_address_id,
end_address_id

FROM drives
WHERE
end_date is null
ORDER BY 1

go back a couple of pages in this thread and you should see instructions for closing.

If you have none, then it should be simple enough to check the dates from the drives dashboard to see if there are any others during that timeframe.
 
Thank you for the suggestion. I tried that and it returned absolutely nothing (attached). I clicked on all of the drives and it wasn't anywhere to be found in drive details. It's not until I go to drive details for 3821 and keep hitting the left arrow up top next to the timestamp that I can eventually see it between 16:34:12 and 16:37:54.
 

Attachments

  • Screenshot 2023-07-05 181120.png
    Screenshot 2023-07-05 181120.png
    43.9 KB · Views: 26
You're absolutely right. I didn't put the semi-colon at the end. I now see some unfinished drives (none being 3820) but I cannot figure out how to run the terminate a drive or charge command shown here. I think I am way in over my head and will just have to leave it.

I had previously found the errant drive and ran the commands found here deleting what I thought was all of the bad data. Palo Alto still showed up on the map so I figured I could run "DELETE FROM drives WHERE id = 3820;" and "DELETE FROM positions WHERE id = 3820;" to just get rid of the whole drive but that still didn't get rid of it. When I go to 3821 and keep hitting the back arrow in the top right I can eventually find the exact timestamps that are causing it (attached) but I do not know how to run a command to remove everything from 2023-02-28 16:34:12 to 2023-02-28 16:37:54.
 

Attachments

  • Screenshot 2023-07-04 094121.png
    Screenshot 2023-07-04 094121.png
    215.3 KB · Views: 32
I figured I could run "DELETE FROM drives WHERE id = 3820;" and "DELETE FROM positions WHERE id = 3820;" to just get rid of the whole drive but that still didn't get rid of it.
You need to delete from positions where drive_id = 3820

id is the number of the row in the positions table and has no bearing on the drive number.


How many unclosed drives have you got? I can talk you through deleting them in a chat.
 
Ahhhh that's really good to know. I just tried that and it returned DELETE 0 so maybe I had already tried it or something.

I believe there is 36 unclosed drives with the last one being from 2022-07-29. Lately I have been having this problem where when I get a graph from SELECT I will get to the end and every time I press enter or space again (END) just keeps going further down and not to the next "teslamate=#" prompt. I tend to just close cmd and start again. Help with closing them would be much appreciated.
 
Hey guys,

Im trying to move my teslamate setup in docker on MAC to docker on windows.

I setup a backup and copied the backup file to windows system and when I try to restore the backup, nothing happens.

@DaveW I saw a some pages back you helped a fellow TMC member and was hoping you had some time this week to help me out as well.

Best,
Shrey