network check (ping) in deep sleep

mc73

Well-Known Member
Licensed User
Longtime User
today I've noticed a very interesting update of the popular app 'wifi fixer' which is claimed to continue pinging the router even if device is in sleep. any ideas how we can do this?
 

mc73

Well-Known Member
Licensed User
Longtime User
You can use a partial wakelock to make sure your service is running.
Thank you. I am aware of this function, still, then, what's the meaning of 'deep' sleep if we can still have our sevices running? Just in doubt, but I will very soon get to check in a 24h testing and of course I will post my findings here :)
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Thank you. I am aware of this function, still, then, what's the meaning of 'deep' sleep if we can still have our sevices running? Just in doubt, but I will very soon get to check in a 24h testing and of course I will post my findings here :)
Sure do post you findings :)
The problem i have as well is testing in deep sleep, what does that mean? i dont really know but to me it seems like a state which allows you to turn off wifi, cpu etc off (but radio in standby otherwise you will miss calls?), but it seems device dependent too.
My device seems to go in deep sleep after a couple of hours (maybe its the kernel that sets this), and I often experience crashes of my app when it wakes up.
From what I have read so far, if you use the Alarm Manager/Broadcast Receiver to schedule your service to run, when your device is in deep sleep, it will wake up for a moment and then go back to sleep unless you set a Partial Wakelock, which will then keep the device awake until you turn off the wakelock.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Yes, this is the info I got too. What I will do, is to set a timer in my service, it will write to the storage every, say 1 minute, some data, containing also the precise hour-minute-second. This way - hopefully - we'll know if the service is running uninterrupted during deep sleep, since if we see gaps in data writing, probably it will mean we have interruptions.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Hello, it's been a while since I've opened this thread, but today I had a bit of time for experimenting with partialLock. Putting a very unstable (concerning its wifi behavior) device into a partialLock, and inserting a 60sec interval timer in a module, just to ping the router, I got pleasantly surprised by the result: 6 hours of lock, with the device set to 'deep' sleep (no clicks, no nothing), with just one missed ping!
Attached the log which includes the connection trials every minute (well that was an approximation), just in case anyone find this interesting.
 

Attachments

  • tmr.txt
    12.8 KB · Views: 385
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Sure it is. I do this at service_destroy since my server requires constant connectivity ability. Now, to be honest, I didn't notice much of an overload in battery consumption, but surely it must have some negative effect.
 
Upvote 0
Top