Closed tjl694 closed 5 years ago
Can you share the logcat for the app?
Here you go 😊 logcat.txt
It seems from the logcat that you are getting disconnected from the broker frequently. Which broker are you using? And what's the mqtt version?
Also, check if you are getting anything in the broker logs?
Ooooh okay. I'm using adafruit.io as the broker. Not sure as to what MQTT version.
Looking at the broker I could see quite a few connects/disconnects (as well as some dodgy timestamp entries):
Looking at the broker in the app on my phone it was disconnecting an reconnecting repeatedly every 3-5 seconds. I've changed the Client ID in the app broker connection settings and it's stabilised now. Fingers crossed it stays that way! 🤞
Yeah, I believe this might be the reason behind the battery drain. Let me know your observations.
Cheers!
So I set up a Last Will message which, as far as I'm aware sends a message as it disconnects from the server?
Anyway, this has been setup for half an hour and have triggered 366 times 😔 here's a screenshot of the first page of them https://photos.app.goo.gl/R59AiQgyWrnLmDL69
So since Friday my battery usage has been a lot better! Its now using like 2% in 24 hours. Shall close the issue 😊
Following up a response to my Google Play Store review of the app, I'm finding that MQTT Client on my OnePlus 5T is using up a lot of battery (20%+ in 24 hours) and is the main battery user on my phone.
Phone make/model: OnePlus 5T Android Version: 9 OxygenOS Version: 9.0.3 Battery optimisation status of app: Not optimised
I use the app in conjunction with Tasker, both to periodically send and receive messages via MQTT client, which works amazingly, but this is sadly letting it down.
Let me know if there's any other data that could help (and how I can obtain it).
I've tried Force Stopping the app, as well as restarting my phone but neither seem to make any difference.