GPS Stream widget consumes a lot of battery on iOS

I’m using Blynk v2.18.0(1) on an iPhone 6s iOS v11.3.1 to control an ESP32 using WiFi. I have a challenge regarding the GPS Stream widget and power/battery consumption. I’m sending data on a virtual port to the ESP32 and chosen accuracy «hundred meters». In my mind I hope lower accuracy reduces power consumption? If I turns off location referencing in the iOS settings, Blynk doesn’t use much power. Turning it on increases the power consumption a lot.

I’m using Blynk v2.18.0(1) on an iPhone 6s iOS v11.3.1 to control an ESP32 using WiFi. I have a challenge regarding the GPS Stream widget and power/battery consumption. I’m sending data on a virtual port to the ESP32 and chosen accuracy «hundred meters». In my mind I hope lower accuracy reduces power consumption? If I turns off location referencing in the iOS settings, Blynk doesn’t use much power. Turning it on increases the power consumption a lot. I’ve also tested with location referencing turned on only when Blynk is in use. Then I got a constant warning on my iPhone that Blynk is using your position now. It seems to me that Blynk is using the GPS a lot regardless of the accuracy setting, and regardless the app is in foreground or not. The way the GPS Stream widget is implemented makes it almost useless in my project. It drains a full iPhone battery to 10% in just 8 hours. The Battery Usage shows 39% even if the app has been used just some minutes in foreground snd been running for 7.8 hours in background. Do you plan to improve the GPS Streaming widget? I like Blynk a lot, but the GPS Stream widget sucks as it is implemented right now.

1 Like

@termo thanks, we will take a look.

@termo Thanks for the feedback.
In the upcoming 2.19.0 update we’ve added a fix to ignore unneeded location updates.
If you would like to test beta version, pm me your Apple ID.

Hi, I’m using Blynk 2.23 and having the same issue with extremely high consumption of my iPhone battery. If I turn off Blynk the battery drain stops.
@Eugene Was there any findings with the above comments?
Thanks

@talb85 Yes, it was fixed. What accuracy you have set in widget settings?

Hi @Eugene - thanks for getting back to me.

I have it set at ‘Three Kilometres’ today and my battery is down to 46% with little use of my phone. (My usual battery without this function operating leaves me at around 70-80% on average per day.)

I have been experimenting with the different accuracy settings to establish the difference, and although ‘Three Kilometres’ has improved my battery drain, it is clear this is still having a considerable negative impact on my battery. For example/reference, the most accurate setting did reduce my battery to below 30% for an average day.

I am using the iPhone 8 plus with the latest iPhone software. If you are familiar with the iOS software, i have included some of my battery stats for your review.

thanks for your help on this.

Well, it is obvious that having enabled background GPS updates will impact your battery, even with “Three Kilometers” accuracy. In System Settings you can setup the Blynk app to get GPS updates only “While Using the App” if it suits your needs.

ok thanks. My problem is I’m trying to develop a way for triggering leaving/arriving at home to trigger certain functions. Such as enabling notification that my garage door is still up, when im not at home. And i can’t really rely on opening up the Blynk app to update my position.

The GPS function does just what i need, and i love what you guys are doing with Blynk software but the battery drain makes the GPS functionality unusable.

would you have any other suggestions.

thanks for your time.

Review the sketch you running on your device to minimize app networking. When the Blynk app is waked up in background (because of GPS updates), it passes not just virtual writes of those GPS updates, all the active projects in the app continue operate, so minimizing overall app networking may help.

So how do I do that? as the gps part of the code is currently in the Blynk.write function straight out of the example.
Do u mean put the gps code inside a blynk timer function instead?

No, I meant to look into all the stuff you have besides GPS in all your active projects. Like remove redundant (i.e. sending same values over and over) virtualWrite or setProperty etc.