Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct firmware showing in Teslamate, but not in Grafana #648

Closed
espenu opened this issue Apr 25, 2020 · 4 comments
Closed

Correct firmware showing in Teslamate, but not in Grafana #648

espenu opened this issue Apr 25, 2020 · 4 comments
Labels
bug

Comments

@espenu
Copy link

@espenu espenu commented Apr 25, 2020

Describe the bug

Last night I received and update for my car (2020.12.10 e0ccfda3d911), but that version does not show in Grafana. Instead it's showing the previous version that was installed (2020.12.5 e2179e0650f0). It does however show the correct version in Teslamate.

Expected behavior

Grafana firmware version should match what the car has.

Relevant entries from the logs
Logs from starting from around the time where I updated the car.

teslamate_1         | 00:42:58.563 [info] Stream.Timeout / 159
teslamate_1         | 00:43:55.828 [info] Stream.Timeout / 160
teslamate_1         | 00:44:26.928 [info] Stream.Timeout / 161
teslamate_1         | 00:44:48.353 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 00:44:48.353 car_id=1 [error] Error / :timeout
teslamate_1         | 00:44:57.995 [info] Stream.Timeout / 162
teslamate_1         | 00:45:19.309 car_id=1 [info] Start / :offline
teslamate_1         | 00:45:19.313 car_id=1 [info] Disconnecting ...
teslamate_1         | 00:46:30.807 car_id=1 [info] Start / :online
teslamate_1         | 00:46:30.818 car_id=1 [info] Connecting ...
teslamate_1         | 00:49:38.040 car_id=1 [info] Suspending logging
teslamate_1         | 01:19:49.997 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 01:19:49.997 car_id=1 [error] Error / :timeout
teslamate_1         | 01:50:34.243 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 01:50:34.243 car_id=1 [error] Error / :timeout
teslamate_1         | 01:51:15.367 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 01:51:15.367 car_id=1 [error] Error / :timeout
teslamate_1         | 05:52:32.956 [warn] WebSocket disconnected. Reconnecting …
teslamate_1         | 06:34:35.959 [info] tzdata release in place is from a file last modified Wed, 11 Sep 2019 19:35:17 GMT. Release file on server was last modified Fri, 24 Apr 2020 04:15:20 GMT.
teslamate_1         | 06:34:37.683 [info] Tzdata has updated the release from 2019c to 2020a
teslamate_1         | 07:22:50.919 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 07:22:50.919 car_id=1 [error] Error / :timeout
teslamate_1         | 07:53:33.868 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 07:53:33.868 car_id=1 [error] Error / :timeout
teslamate_1         | 08:54:28.174 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 08:54:28.174 car_id=1 [error] Error / :timeout
teslamate_1         | 10:06:48.943 car_id=1 [info] Fetching vehicle state ...
teslamate_1         | 10:07:20.022 [info] Stream.Timeout / 5
teslamate_1         | 10:25:28.840 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 10:25:28.840 car_id=1 [error] Error / :timeout
teslamate_1         | 10:56:12.747 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 10:56:12.747 car_id=1 [error] Error / :timeout
teslamate_1         | 11:57:07.857 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 11:57:07.857 car_id=1 [error] Error / :timeout
teslamate_1         | 12:27:56.709 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 12:27:56.709 car_id=1 [error] Error / :timeout
teslamate_1         | 13:58:51.973 [error] TeslaApi.Error / 504 – %{"error" => "upstream_timeout", "error_description" => "", "response" => nil}
teslamate_1         | 13:58:51.973 car_id=1 [error] Error / :timeout
teslamate_1         | 14:29:28.170 car_id=1 [warn] Preconditioning ...

Data
last lines from database updates table:
12,2019-12-29 09:48:21.752336,2019-12-29 10:05:43.318123,2019.40.2.5 6c8e76e3e807,1
13,2020-01-28 05:07:22.836928,2020-01-28 05:39:50.592594,2020.4.1 4a4ad401858f,1
14,2020-03-23 20:46:07.478,2020-03-23 20:58:15.564,2020.8.2 dc9bc402da23,1
15,2020-04-09 22:00:34.631,2020-04-09 22:25:59.259,2020.12.5 e2179e0650f0,1


**Operating environment**

- TeslaMate Version: 1.19.1
- Type of installation: Teslamate & Grafana in Docker, but database installed manualy on another machine.
- OS: Ubuntu 18.04
@tobiasehlert
Copy link
Contributor

@tobiasehlert tobiasehlert commented Apr 26, 2020

Hi @espenu,

The Grafana view is running following query:
select version from updates where car_id = $car order by start_date desc limit 1

Based on your lines of the database table of updates, your last version of update seems to be missing. Which would lead to why Grafana is missing those details.

Question here would be, why the newest version is missing actually...
Or has that maybe been corrected maybe now?
Have you tried to restart TeslaMate software?

@espenu
Copy link
Author

@espenu espenu commented Apr 27, 2020

The Grafana view is running following query:
select version from updates where car_id = $car order by start_date desc limit 1

Based on your lines of the database table of updates, your last version of update seems to be missing. Which would lead to why Grafana is missing those details.

Question here would be, why the newest version is missing actually...
Or has that maybe been corrected maybe now?
Have you tried to restart TeslaMate software?

Yeah, I noticed it was missing. I updated to 1.19.2 yesterday evening and It's still wrong in Grafana now.
I did however notice that when starting up yesterday after the update I got the following errors from Teslamate:

teslamate_1 | 20:16:27.949 [info] tzdata release in place is from a file last modified Wed, 11 Sep 2019 19:35:17 GMT. Release file on server was last modified Fri, 24 Apr 2020 04:15:20 GMT. teslamate_1 | 20:16:29.727 [info] Tzdata has updated the release from 2019c to 2020a teslamate_1 | 20:16:34.895 [info] Application teslamate exited: TeslaMate.Application.start(:normal, []) returned an error: shutdown: failed to start child: TeslaMate.Vehicles teslamate_1 | ** (EXIT) an exception was raised: teslamate_1 | ** (CaseClauseError) no case clause matching: {:error, :checkout_timeout} teslamate_1 | (teslamate 1.19.2) lib/teslamate/vehicles.ex:78: TeslaMate.Vehicles.list_vehicles!/0 teslamate_1 | (teslamate 1.19.2) lib/teslamate/vehicles.ex:52: TeslaMate.Vehicles.init/1 teslamate_1 | (stdlib 3.12.1) supervisor.erl:295: :supervisor.init/1 teslamate_1 | (stdlib 3.12.1) gen_server.erl:374: :gen_server.init_it/2 teslamate_1 | (stdlib 3.12.1) gen_server.erl:342: :gen_server.init_it/6 teslamate_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3 teslamate_1 | {"Kernel pid terminated",application_controller,"{application_start_failure,teslamate,{{shutdown,{failed_to_start_child,'Elixir.TeslaMate.Vehicles',{{case_clause,{error,checkout_timeout}},[{'Elixir.TeslaMate.Vehicles','list_vehicles!',0,[{file,\"lib/teslamate/vehicles.ex\"},{line,78}]},{'Elixir.TeslaMate.Vehicles',init,1,[{file,\"lib/teslamate/vehicles.ex\"},{line,52}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,295}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,249}]}]}}},{'Elixir.TeslaMate.Application',start,[normal,[]]}}}"} teslamate_1 | Kernel pid terminated (application_controller) ({application_start_failure,teslamate,{{shutdown,{failed_to_start_child,'Elixir.TeslaMate.Vehicles',{{case_clause,{error,checkout_timeout}},[{'Elixir.Tes teslamate_1 | teslamate_1 | Crash dump is being written to: erl_crash.dump...done

I don't know if that could have any causal link with the version issue.
To get it working I could just add another line to the database with the correct version right? But I would of course like to find the root cause of why it's missing in the first place.

@adriankumpf adriankumpf added the bug label Apr 27, 2020
adriankumpf added a commit that referenced this issue Apr 27, 2020
Addresses #648
@adriankumpf
Copy link
Owner

@adriankumpf adriankumpf commented Apr 27, 2020

Normally TeslaMate notices when a firmware update is installed. When you installed the update, there were problems with the Tesla API (hence the timeouts). For these cases there is a fallback mechanism that detects retrospectively if an update was installed while the car was unavailable. This mechanism had a bug which should be fixed on master.

@adriankumpf adriankumpf closed this May 2, 2020
@durzel
Copy link

@durzel durzel commented May 6, 2020

I experienced the same problem last night/this morning. Car woke naturally to start charging at 00:30, and I logged into the app at the same time and noticed there was a software update available (2020.12.11.1). Set the update off and went to bed.

The Tesla app and TeslaMate show the new firmware version, but Grafana shows the old firmware (2020.8.5) everywhere. There is no entry for the new firmware on the "Updates" dashboard either.

I'm on version 1.19.3 of TeslaMate, which I believe is current. I haven't tried restarting TeslaMate/Grafana since 1.19.3 was released, as I didn't think I would have to.

Do you have to go into the car to "finish" the install so that TeslaMate/Grafana will see it properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants