traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
665 stars 736 forks source link

High battery usage caused by wake lock in version v5.19 #398

Open j0s opened 5 years ago

j0s commented 5 years ago

The recently released version v5.19 increased power usage by about a factor ten for me, presumably caused by 636ceaf027b630b93334b99074a67a29d8aba0d5.

Location updates worked reliably for me also in v5.18, without the wake lock. If this is needed for some devices, maybe it could be toggled in the settings?

tananaev commented 5 years ago

What device are you using? And what Android version?

j0s commented 5 years ago

Galaxy S10, android 9, but I also got this behaviour on my wife's OnePlus 3 with some older version of android (7 maybe, don't have that phone with me now).

tananaev commented 5 years ago

OK, so how can we get some proof of it working in the sleep mode? Do you have any logs?

j0s commented 5 years ago

I checked the logs in the traccar server. When the phone is laying unused, it misses an update every now and then. When I move around the phone tends to wake quite reliably.

I would rather have almost all updates arrive as expected and good battery life, than having perfect updates but being out of battery in the middle of the afternoon.

Anyway, thanks for working on this, for my use case it's really useful in combination with home-assistant!

tananaev commented 5 years ago

it misses an update every now and then

This is exactly what we were trying to solve. It basically means that it doesn't work correctly on your device either.

j0s commented 5 years ago

Yes, technically that is true. However, v5.19 does not work at all for us, since it means I'm out of battery in the middle of the afternoon.

tananaev commented 5 years ago

OK, we'll consider making it configurable. In the meanwhile you can use older version if that worked better for you.

j0s commented 5 years ago

OK, thanks for considering this!

Anton-V-K commented 5 years ago

Probably I have the same issue with high power use by Traccar Client which I keep running on my smartphones (Doogee X5 Max and UHANS A101, both with Android 6.0). I often notice Traccar Client hanging on top places in power consumers "rating". Here is an example: Screenshot_20190609-143449 In this case GPS was off (all the time since last charge), so Traccar Client didn't report anything. I think there was no such issue with 5.18, so I'm going to downgrade and see whether it helps.

hardtopnet commented 4 years ago

I'm using version 6.20 and can confirm a huge battery drain on my Pixel 3a with Android 10. I'll revert back to the latest "battery-compliant" version which I think is 5.18 (that's 1,5 years back though...). Any clues or ETA's on a fix for this particular issue ? (can provide logs or further info if required)