VPN on demand and higher battery drain when in motion

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
hawkeye217
OpenVpn Newbie
Posts: 7
Joined: Wed Jul 24, 2019 12:32 pm

VPN on demand and higher battery drain when in motion

Post by hawkeye217 » Thu Nov 19, 2020 4:32 pm

I've set up a VPN on demand profile through a .mobileconfig on iOS 14.2 (OpenVPN app version 3.2.2) and all is working well. I've had the same setup also work well on previous versions of iOS and on other phones. But I've always had one notable issue that I have not been able to work around.

iOS tends to "phone home" to Apple's servers a lot, especially when I am in motion. I notice that when I'm out cycling, my battery tends to drain more than it should. I've traced this to my VPN on demand profile connecting through cellular data to presumably send location data back to Apple's servers - from my PiHole logs, I see domains like gs-loc.apple.com and some akamai.net servers being contacted every 5 minutes or so.

I don't mind the location data being sent (presumably for things like Find My iPhone), but the extra overhead of connecting to my VPN server through the on-demand profile every time drains the battery more than it should. Looking at the battery details under iOS settings shows OpenVPN as one of the highest culprits after coming back from a longer bike ride.

Has anyone else experienced this before and does anyone have any ideas on how to get around it? I've already set up some of the OnDemandRules in the mobileconfig file to disconnect the VPN when connected to my home's wifi, but I am not sure how to prevent the VPN from even connecting in the first place when trying to resolve those specific Apple domains that continually show up in my Pihole logs.

Any suggestions from anyone would be appreciated! Thanks!

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: VPN on demand and higher battery drain when in motion

Post by TinCanTech » Thu Nov 19, 2020 8:51 pm

hawkeye217 wrote:
Thu Nov 19, 2020 4:32 pm
iOS tends to "phone home" to Apple's servers a lot, especially when I am in motion. I notice that when I'm out cycling, my battery tends to drain more than it should. I've traced this to my VPN on demand profile connecting through cellular data to presumably send location data back to Apple's servers - from my PiHole logs, I see domains like gs-loc.apple.com and some akamai.net servers being contacted every 5 minutes or so.

I don't mind the location data being sent (presumably for things like Find My iPhone), but the extra overhead of connecting to my VPN server through the on-demand profile every time drains the battery more than it should. Looking at the battery details under iOS settings shows OpenVPN as one of the highest culprits after coming back from a longer bike ride.
Where do we start ...

Just out of curiosity, why don't you turn your phone off when you are riding your bike ?

hawkeye217
OpenVpn Newbie
Posts: 7
Joined: Wed Jul 24, 2019 12:32 pm

Re: VPN on demand and higher battery drain when in motion

Post by hawkeye217 » Thu Nov 19, 2020 10:29 pm

TinCanTech wrote:
Thu Nov 19, 2020 8:51 pm

Just out of curiosity, why don't you turn your phone off when you are riding your bike ?
I use a fitness app to record ride data.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: VPN on demand and higher battery drain when in motion

Post by TinCanTech » Thu Nov 19, 2020 11:07 pm

hawkeye217 wrote:
Thu Nov 19, 2020 10:29 pm
I use a fitness app to record ride data.
I think your phone is doing enough and most likely that is the best you will get out of your battery.

hawkeye217
OpenVpn Newbie
Posts: 7
Joined: Wed Jul 24, 2019 12:32 pm

Re: VPN on demand and higher battery drain when in motion

Post by hawkeye217 » Thu Nov 19, 2020 11:59 pm

TinCanTech wrote:
Thu Nov 19, 2020 11:07 pm
hawkeye217 wrote:
Thu Nov 19, 2020 10:29 pm
I use a fitness app to record ride data.
I think your phone is doing enough and most likely that is the best you will get out of your battery.
Regardless of what my phone is doing, my question remains the same as my OP. Is it possible to configure OpenVPN or VPN on demand to not attempt to connect the VPN at all for certain domains?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: VPN on demand and higher battery drain when in motion

Post by TinCanTech » Fri Nov 20, 2020 1:40 am

hawkeye217 wrote:
Thu Nov 19, 2020 11:59 pm
Is it possible to configure OpenVPN or VPN on demand to not attempt to connect the VPN at all for certain domains?
No. That would be a function of your device.
hawkeye217 wrote:
Thu Nov 19, 2020 11:59 pm
my question remains the same as my OP
hawkeye217 wrote:
Thu Nov 19, 2020 11:59 pm
VPN on demand and higher battery drain when in motion
You have a mobile wireless device on the move ..

Have you ever marched up a 1 in 4 incline with an open field radio ?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: VPN on demand and higher battery drain when in motion

Post by TinCanTech » Fri Nov 20, 2020 4:41 am

TinCanTech wrote:
Fri Nov 20, 2020 1:40 am
Have you ever marched up a 1 in 4 incline
Should this be: "an one in four" ?

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: VPN on demand and higher battery drain when in motion

Post by 300000 » Fri Nov 20, 2020 11:30 pm

so if Apple didnot phone home when you in motion openvpn use more battery or not? if you think that way you need to find out how normal openvpn do nothing and dont consume battery but when Apple phone home it use a lot? it that you say because of openvpn use more batery?

arrmo
OpenVpn Newbie
Posts: 6
Joined: Tue Jun 04, 2013 2:59 am

Re: VPN on demand and higher battery drain when in motion

Post by arrmo » Fri May 07, 2021 11:39 am

Sorry to post on this, but not sure how / where else to ask :(. Fighting to get a mobileconfig file working - also with iOS 14. Any chance you can share your working file (with any secret / private information crossed out of course, but left in to see the fields)?

Thanks!!!

Post Reply