teslamate-org / teslamate

A self-hosted data logger for your Tesla 🚘
https://docs.teslamate.org
MIT License
6.08k stars 757 forks source link

Chinese accounts: Drives are seperated to multiple blank records #2239

Closed em91 closed 2 years ago

em91 commented 2 years ago

Is there an existing issue for this?

What happened?

Question 1:

After Decemeber 25, drives are not properly logged any more. Multiple blank records are shown in grafana timeline instead.

Is this Tesla api broblem? I found frequent "start of drive" log when i was still driving:

teslamate_1 | 2021-12-26 20:31:18.285 [info] Start of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: xxx, heading: 344, latitude: xxx, longitude: xxx, native_latitude: xxx, native_location_supported: 1, native_longitude: xxx, native_type: "gcj", power: 1, shift_state: "D", speed: 0, timestamp: xxx}

Question 2:

BTW, charge records is missing too, i found this error in docker log after charge ended:

teslamate_1 | 2021-12-26 20:28:41.572 car_id=1 [info] Charging / Stopped / 0.00 kWh – 0 min teslamate_1 | 2021-12-26 20:28:41.574 car_id=1 [info] Start / :online teslamate_1 | 2021-12-26 20:28:41.579 car_id=1 [info] Connecting ... teslamate_1 | 2021-12-26 20:28:41.580 [error] GenStateMachine :"1" terminating teslamate_1 | ** (MatchError) no match of right hand side value: {:error, {:already_started, #PID<0.8885.1>}} teslamate_1 | (teslamate 1.25.0) lib/teslamate/vehicles/vehicle.ex:708: TeslaMate.Vehicles.Vehicle.handle_event/4 teslamate_1 | (stdlib 3.16.1) gen_statem.erl:1196: :gen_statem.loop_state_callback/11 teslamate_1 | (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Question 3:

Do you have any way to merge these annoying blank records to the original normal drive record..

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output

Driving Log:
teslamate_1  | 2021-12-26 20:31:18.285 [info] Start of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: xxx, heading: 344, latitude: xxx, longitude: xxx, native_latitude: xxx, native_location_supported: 1, native_longitude: xxx, native_type: "gcj", power: 1, shift_state: "D", speed: 0, timestamp: xxx}

Charge Log:
teslamate_1  | 2021-12-26 20:28:41.572 car_id=1 [info] Charging / Stopped / 0.00 kWh – 0 min
teslamate_1  | 2021-12-26 20:28:41.574 car_id=1 [info] Start / :online
teslamate_1  | 2021-12-26 20:28:41.579 car_id=1 [info] Connecting ...
teslamate_1  | 2021-12-26 20:28:41.580 [error] GenStateMachine :"1" terminating
teslamate_1  | ** (MatchError) no match of right hand side value: {:error, {:already_started, #PID<0.8885.1>}}
teslamate_1  |     (teslamate 1.25.0) lib/teslamate/vehicles/vehicle.ex:708: TeslaMate.Vehicles.Vehicle.handle_event/4
teslamate_1  |     (stdlib 3.16.1) gen_statem.erl:1196: :gen_statem.loop_state_callback/11
teslamate_1  |     (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Screenshots

image

Additional data

No response

Type of installation

Docker

Version

v1.25.0

DrMichael commented 2 years ago

You should probably make an update... https://github.com/adriankumpf/teslamate/issues/1996

em91 commented 2 years ago

teslamate_1 | 2021-12-26 22:40:24.016 [info] System Info: Erlang/OTP 24 (jit) teslamate_1 | 2021-12-26 22:40:24.016 [info] Version: 1.25.0

Already latest version, sorry provided wrong version at first (modified)

jjzxmmx commented 2 years ago

I also had the same problem, but I found it from the time I upgraded 2021.44.25.2

aishlai commented 2 years ago

I also had the same problem, but I found it from the time I upgraded 2021.44.25.2 (china user)

madswaord commented 2 years ago

Same issue, but I got 44.25 updated yesterday morning, all trips since updated yesterday are shown correct, but all trips today blank, and road-trip still shown on maps.

截屏2021-12-29 下午12 24 00
sempliciy commented 2 years ago

I also had the same problem, since 26th night(china user)

summergeorge commented 2 years ago

I also had the same problem, since 26th night(china user)

same problem

torobucks commented 2 years ago

No problem after upgrade to the 44.25.(China User)

chenkehxx commented 2 years ago

same problem(China User)

Screen Shot 2021-12-28 at 22 01 31
martin0607 commented 2 years ago

Same issue. After updated to V11(2021.44.25.2), everything is fine except Drives data(No Drives data was recorded). 屏幕截图 2021-12-28 215340

martin0607 commented 2 years ago

reboot didnt work for me:(

wg-cn commented 2 years ago

user

me too

madswaord commented 2 years ago

reboot car computer it's workimage

reboot didnt work for me

yaksazq commented 2 years ago

I also had the same problem, since 27h (china user)

summergeorge commented 2 years ago

reboot didnt work for me (china user)

martin0607 commented 2 years ago

Any one tried update to edge version(maybe 1.26.0)?

wg-cn commented 2 years ago

Any one tried update to edge version(maybe 1.26.0)?

如何升级edge版本?

martin0607 commented 2 years ago

Any one tried update to edge version(maybe 1.26.0)?

如何升级edge版本?

replace 'teslamate/teslamate:latest' with 'teslamate/teslamate:edge' in compose yml

madswaord commented 2 years ago

Any one tried update to edge version(maybe 1.26.0)?

如何升级edge版本?

replace 'teslamate/teslamate:latest' with 'teslamate/teslamate:edge' in compose

yml

i tried to update the edge version, but still blank records, one trip separated to dozens black trips.

截屏2021-12-30 下午3 17 14
summergeorge commented 2 years ago

中国用户解决了这个问题,我的处理方式是:

  1. 关闭Tesla串流接口。(理论上关了就好了) image
  2. 保险起见把原来docker yml 中的extra_hosts去掉。(因为中国的ip地址变了,如果网络环境在国外,必须设置host,建议ping 一下最新的服务器地址。看起来tesla中国的ip地址变化挺频繁的,最好能够把服务器部署在国内网络环境中。) image

看起来已经正常了,明天再开车验证下。 image

summergeorge commented 2 years ago

中国用户解决了这个问题,我的处理方式是:

  1. 关闭Tesla串流接口。(理论上关了就好了) image
  2. 保险起见把原来docker yml 中的extra_hosts去掉。(因为中国的ip地址变了,如果网络环境在国外,必须设置host,建议ping 一下最新的服务器地址。看起来tesla中国的ip地址变化挺频繁的,最好能够把服务器部署在国内网络环境中。) image

看起来已经正常了,明天再开车验证下。 image

顺便说一下,我之前重启过tesla的车机,当时重启是没有解决这个问题的。从关闭串流接口后,好像记录就正常了。

aishlai commented 2 years ago

i found this problem is fixed on 1.26.0-dev, try to use tag on edge

aishlai commented 2 years ago

i tried to update the edge version, but still blank records, one trip separated to dozens black trips.

may be old data can't fix

sempliciy commented 2 years ago

After update the edge version, it's work 微信图片_20211231090816

wg-cn commented 2 years ago

Any one tried update to edge version(maybe 1.26.0)?

如何升级edge版本?

replace 'teslamate/teslamate:latest' with 'teslamate/teslamate:edge' in compose yml

tks, my teslamate work ok after replace to edge version and reboot the carpc.

icetone commented 2 years ago

I use edge verion,and the log output as this: (I am china user) 0

Rainsho commented 2 years ago

Are there any ways to remove the dirty data? It logged i had driven 70000 times in Jan.2022. I'm a little OCD.

jjzxmmx commented 2 years ago

有没有办法去除脏数据?它记录了我在 2022 年 1 月驾驶了 70000 次。我有点强迫症。

This is the answer. #1996 or this Reply

vls commented 2 years ago

I use edge verion,and the log output as this: (I am china user) 0

same here. I'm china user but my Teslamate has been deployed on JP machine. It seems that the Region determine function is not working correctly.

https://github.com/adriankumpf/teslamate/blob/9c9564ecc75fa697f244b2c763c0c756bf251fd6/lib/tesla_api/auth.ex#L44

Maybe need an environment variable the determine Global/CHINA @adriankumpf

adriankumpf commented 2 years ago

I use edge verion,and the log output as this: (I am china user) 0

same here. I'm china user but my Teslamate has been deployed on JP machine. It seems that the Region determine function is not working correctly.

https://github.com/adriankumpf/teslamate/blob/9c9564ecc75fa697f244b2c763c0c756bf251fd6/lib/tesla_api/auth.ex#L44

Maybe need an environment variable the determine Global/CHINA @adriankumpf

The region detection is based on the access token. Can you try to log out and log in again? Did you do any modifications to the docker-comose.yml like adding extra_hosts?

yhq34 commented 2 years ago

I have the same issue, I am currently using teslamate:edge, didn't add extra_hosts to the docker-compose.yml. If I log out and I cannot log in.