WORKAROUND of no-push-notification in deep sleep - Android Q&A, Help & Troubleshooting

I'VE FOUND A WORKAROUND of this no-push-notif during deep sleep problem.
Earlier, I tried holding partial wakelock so the device never sleep, this of course works alright, but drains battery very rapidly (5% / 30mins).
This is NOT ACCEPTABLE.
So, I tried something else :
automatically waking up the device regularly every 30mins, with the help of Tasker (which doesn't turn on the screen at all).
The result is :
7 hours after screen off and a good night sleep, in the morning I sent myself a BBMsg and it arrived perfectly in about 5 secs.
Battery consumption is totally acceptable : only 4% drop during 7 hours (dual sim ON, data ON).
That's days ago, and still works perfectly until now, I'm happy with it, so I'd like to share the AWESOMENESS.
I'm not sure about push notif from Google servers via GCM, I don't use any app which takes advantage of GCM, I only use BBM which uses its own servers.
In this case, you should first try adjusting heartbeat interval using PushNotificationFixer (which can't help me since it only resends heartbeat to Google server).
Tasker setup :
1. create new profile : Time
* uncheck both start & end time (so it starts and ends from midnight to midnight)
* check Repeat : every 6 minutes (during deep sleep, this 6 mins expands 5x to 30 mins)
2. add new task :
what you do in this task doesn't really matter, the point is to do something in a regular interval (I only use Alert Morse, so I know that the profile is still running)
GODSPEED !!!!
PS. :
if you're not familiar with Tasker, after installation you have to :
1. allow it as admin (system Settings > Device Administrators)
2. turn on its service (system Settings > Accessibility)
3. put it on auto-start list

Related

[07.07.2009, v 1.3.1] Astrolabe - SMS your GPS position

Download. Simply decompress it and copy it on your Windows Mobile 6 device and run it. (Works on my Polaris.)
Details
Source code
Description
Use your PDA to acquire your GPS position and send it through an SMS.
The GPS position is update every 5 seconds (in order to conserve energy).
SMSs can be sent automatically at regular time intervals.
Do you like hiking?
What if you go out in the wilderness and have an accident? How do you direct a rescue team to your location?
You can use Astrolabe on your PDA to acquire your GPS position and send it through an SMS to your friends / parents / children / rescue team.
Privacy
SMSs are not encrypted, so anyone who tracks your phone number can tell your precise position by reading the SMSs with your GPS position.
However, it's debatable whether this is relevant because if someone tracks your phone number, they may already know the position of your phone in the communication grid.
Power saving modes explained
The following power saving modes are available: none, manual, auto.
None
In this mode there is no power saving. The application and the GPS are running even if the PDA is in standby.
GPS positions are retrieved as soon as they are available and are automatically sent through SMSs as soon as it is mandated.
Warning: In this mode, the battery is drained quickly (because keeping the GPS active requires a lot of power). Therefore, the "Auto" power saving mode is active by default.
Use this mode only when GPS position availability is critical.
Manual
In this mode the power consumption is the same as if the application (including the GPS) is not running.
However, you must keep your PDA on in order for GPS positions to be retrieved and automatically sent through SMSs.
Use this mode only when power consumption must be at minimum.
Auto
In this mode the application is running all the time, but the GPS is sleeping most of the time.
Once every 30 minutes, the GPS is awoken for maximum 5 minutes in order to get a GPS position and automatically send it through SMS. When a GPS position is available, this timer is reset.
In this mode, since the PDA sleeps most of the time, it may miss the narrowest chance it may have to get a GPS signal. In order to be sure that GPS positions are retrieved and automatically sent through SMSs, you must keep your PDA on.
Warning: Do not rely on the ability of a PDA in standby mode to automatically acquire a GPS position in (maximum) 5 minutes. Check this yourself!
Use this mode in most cases.
Tests showed that in this mode the battery (of a HTC Polaris, 1350 mAh) would be depleted in about 16 hours, if no GPS signal is available; if there is a GPS signal, the autonomy should be greatly increased (an informal test indicates more than twice the autonomy). Without power saving, the battery would be depleted in about 6 hours.
Do you like hiking?
What if you go out in the wilderness and have an accident? How do you direct a rescue team to your location?
Click to expand...
Click to collapse
what if there isent any signal?
(joking..)
Nice app btw
If there is no signal, the program waits until it acquires a new GPS position. Then, a new SMS is sent within (generally) 5 seconds.
(Of course, if the repeat time is X, the SMS is sent only if more time than X has passed since the last sent SMS.)
Note: Keeping the GPS active drains the battery quickly.
6ITdtvFQqY said:
If there is no signal, the program waits until it acquires a new GPS position. Then, a new SMS is sent within (generally) 5 seconds.
(Of course, if the repeat time is X, the SMS is sent only if more time than X has passed since the last sent SMS.)
Note: Keeping the GPS active drains the battery quickly.
Click to expand...
Click to collapse
I hace seen many programs like yours, almost all drains battery when there is no GPS signal (inside buildings). Only one programs deals it better, but that has many other issues. One way to stop draining the battery is to read 'N' (say 50) number of NMEA messages from GPS and then turn off GPS for about 'M' (5 - 15) minutes. Then try again. This will save lot of battery. May be you can try implementing it.
You can download a new version which has 2 new features.
You can see the trail of GPS locations where you were. The trail is updated once per minute.
A power save mode is available. If this mode is active, the PDA's power consumption is the same as if the application is not running; however, you must have your PDA on in order for GPS locations to be retrieved and automatically sent through SMSs.
Warning: Keeping the GPS active drains the battery quickly. Therefore, the power save mode is active by default.
Download
Details.
tahdor said:
I hace seen many programs like yours, almost all drains battery when there is no GPS signal (inside buildings). Only one programs deals it better, but that has many other issues. One way to stop draining the battery is to read 'N' (say 50) number of NMEA messages from GPS and then turn off GPS for about 'M' (5 - 15) minutes. Then try again. This will save lot of battery. May be you can try implementing it.
Click to expand...
Click to collapse
As you can see, I've implemented a manual power save mode.
In theory, an automated power save mode can be implemented, where the GPS is woke up every 30 minutes to get a location and then sent back to sleep. However, I have no idea what that would do to the device, that is, waking it up every half hour and then shutting it down.
But most importantly, if a GPS location can't be retrieved, what would the device do? The user could be sleeping in a motel for the night (or move through caves or canyons) and the walls could block the GPS signal. Should the device keep trying and thusly consume energy (for how long?), or go back to sleep and miss even the smallest chance of getting a GPS location in those 30 minutes?
An automated power save mode is in conflict with the criticality of having a GPS location any time it is available. Of course, if the device has no power this becomes irrelevant, so a power save mode is necessary. But it's important for the user to understand what's going on.
The current manual mode allows the user to understand that and allows the settings (especially the trail) to remain active all the time. For the moment I consider this to be the best solution.
Accelerometer
Hi,
Your program i very interesting, it will be great to manage the accelerometer
and send a SMS when the phone do not move or when it goes from vertical to
horizontal position.
What do you think of that?
Regards
doco76 said:
send a SMS when the phone do not move or when it goes from vertical to horizontal position.
Click to expand...
Click to collapse
In what context would someone use such a feature? I mean, what does an accelerometer provide that the GPS's altitude does not?
I guess an SMS could be sent as soon as a significant change in altitude occurs (because this could indicate a fall).
Very good idea, thank you
I know you're still developing this program,
Can you add customizable SMS feature? I might need to send an sms in my native language.
And
The program will send SMS automaticaly to Predefined Numbers feature would be great
May it be easy
I know you're still developing this program
Click to expand...
Click to collapse
The development is actually frozen. I am just implementing critical stuff, like power saving, and doing bug fixing.
Can you add customizable SMS feature? I might need to send an sms in my native language.
Click to expand...
Click to collapse
You can simply send a normal SMS. I'll add a "copy GPS position to clipboard" feature to go with that.
The program will send SMS automaticaly to Predefined Numbers feature would be great
Click to expand...
Click to collapse
SMSs are sent to a predefined agenda contact. Someone who wants to send SMSs with his GPS location should normally do so to a regular agenda contact, so he'll already have an agenda contact or can setup one anytime. What particular usage would there be for an SMS sent to a phone number instead of an agenda contact?
I'll have a new version by tomorrow (if tests are okay) with multiple power saving modes: none, manual (as is now), automatic (where the GPS is automatically woken up to get a location - 5 every 30 minutes). I'll include the "copy GPS position to clipboard" in there.
In automatic power saving mode, tests showed that the battery (of my Polaris, 1350 mAh) would be depleted in about 16 hours (if no GPS signal is available; if it is and reception is good, the autonomy should be greatly increased). Without power saving, the battery would be depleted in about 6 hours.
Although the new version is already up, I'll make a small change later today.
Version 1.3.1 is up. See the first post.
I am going for a hike up the cobbler and Ben Ime in the Arrochar Alps on friday so i will take my polaris and see how things go.
Well that hike went well and i have taken my polaris on a few other hikes.
To be honest you have almost developed a GPS application for your phone. The sms ability is great, but what i really liked was the trail plotting ability.
A standalone GPS will provide you with a line route against gradient maps. I don't expect there to be gradient maps but just a route line sampled at regular intervals would be great. It would be a good aid to plotting your route with a paper map.
Can i ask if the trail samples can be increased?
The current default power saving mode is "Auto", which means that Astrolabe can only take a GPS location once every 30 minutes. As such, the trail can't be updated more often. Moreover, if the 5 minutes window when Astrolabe attempts to get a GPS location is missed (because the GPS reception is poor), the next one is 30 minutes later, which mean that the trail accuracy is getting worse.
You can change the power saving mode is "None", in which case the trail is updated once per minute... but the battery dies out fast.
Instead of changing the power saving mode, you could manually start your PDA every time you think it's necessary to get a GPS location (and trail location). (Just look in Astrolabe to make sure that the time of the last GPS location is the current time.)
(As I said, the power saving modes will cause confusion.)
I added the trail feature after a bunch of us got lost in the woods. After some 2 hours of being off course we were debating whether to return or go further. Fortunately someone went 200 meters further and saw the road (from where we started). With this feature I could have seen that we were going in the right direction.

Dreadful battery life

I can't figure out whats wrong, all I know is battery life is dire. I got a HTC Mozart before Christmas, I would take it off the charger at 6am, before I even went out the door battery life had dropped. To cut a long story short it turned of shortly after lunch time and that is in airplane mode, I did listen to some music but even so an iphone in airplane mode listening to music will last a good couple of days easily if not longer, not 7-8 hrs. So I sent my phone back.
Just this week I got another HTC Mozart as I thought maybe the first one was faulty, and I really like the windows 7 platform and the Mozart has an awesum camera but it is exactly the same as the first, the phone dies soon after lunch time, I have never seen such poor battery life in a phone. My old HTC Desire with all turned on at least made it to 6pm and my previous iPhone made it right the way through to 11pm with all turned on so i can't figure out whats wrong with this phone.
Anyone any ideas?
I should add 3G is of as I don't have any coverage. No push notifications and also in airplane 90% of the day, only turned on occasionally to check email.
Here's setup that i got from HTC Team, :
System tab:
Wi-Fi: off
Bluetooth: off
Email & accounts > Download new content: manually (for all email accounts like Windows Live, Yahoo and Gmail)
Lock & wallpaper > Screen time-out: 30 sec
Location > Location services: off
Brightness > Automatically adjust: off, Level: low
Find my phone > off (both options unchecked)
Feedback > Disabled
Wallpaper > Set for darker color
3G connection > On only when browsing or downloading
..... i'm having the same problem previously... 3 hours standby and the batt drained...
so, i get this setup... with moderate usage, it can last 1.5 - 2 days... hardcore usage : 6 hours - 1 day [depends on what you're using]
svarsgaard said:
Here's setup that i got from HTC Team, :
System tab:
Wi-Fi: off
Bluetooth: off
Email & accounts > Download new content: manually (for all email accounts like Windows Live, Yahoo and Gmail)
Lock & wallpaper > Screen time-out: 30 sec
Location > Location services: off
Brightness > Automatically adjust: off, Level: low
Find my phone > off (both options unchecked)
Feedback > Disabled
Wallpaper > Set for darker color
3G connection > On only when browsing or downloading
..... i'm having the same problem previously... 3 hours standby and the batt drained...
so, i get this setup... with moderate usage, it can last 1.5 - 2 days... hardcore usage : 6 hours - 1 day [depends on what you're using]
Click to expand...
Click to collapse
Right ok I am already doing most of them, will try the rest and see what happens
owh ya...
+ my own setting :
speech > audio confirmation > off
ease of access > off [i'm not sure this is for what, i just simply turn it off..lol ]
keyboard > off the text suggestion
facebook > only tick for "shake to refresh" ; updating- never
that's all.. good luck [^_^]
i left mine stock, and the battery isnt great... but its not THAT bad....
Yeah its strange that about 5 mins after unplugging it from charge it looses a tiny bar...
But after that its ok for me, and i play music on it through my car for 4 hours a day and even after that its only just above half...
I'm a fairly heavy user with around 4+ hours of browsing, 1 hour of music and email retrieving every hour but I always make it through a full day. If I don't touch the internet and just stick to sms + calls I have managed to make it through 2 full days.
The Mozart does have a fairly small battery compared to some other smartphones available but Mugen do sell an higher capacity battery which I have contemplated buying. You can read more about it in this thread here.
slugger09 said:
Right ok I am already doing most of them, will try the rest and see what happens
Click to expand...
Click to collapse
how was it now ?

Tasker profile becomes inactive after phone is idle for 10 minutes

Hi all,
I have an AT&T Samsung Note 3 SM-N900A running Android 4.3 (baseband version N900AUCUBMJ5, kernel v3.4.0-1625098). I rooted it using Kingo, installed Tasker (with Secure Settings plugin), and created 2 profiles: one with a 'Home' location context, and one with a 'Work' location context. In the 'Location Edit' map screen for each, I set a pinned location w/ a radius of 200m. I also de-select 'GPS' (leaving only 'NET'), since I don't want GPS enabled all the time (to extend battery life). I confirm that these work when I'm actively using the phone.. the profile becomes active when I'm at the specified location (as expected). I know it's active because it's displayed in the Notification Panel (and it's also shown in green in the Tasker profiles list).
The issue I'm having is that after ~10 minutes of idle time (i.e. when the display is off and I'm not using the phone), I find that the profile is no longer active when I turn the display back on and start using the phone again. I confirmed that this *doesn't* happen after 1 minute, 2 minutes, nor 5 minutes… only > 10. I also confirmed that it happens for both profiles consistently. However, as soon as I start Tasker again from the Apps Drawer (or from Recent Apps screen), the profile is immediately activated again, and my Enter task is re-run.
I enabled the run log in Tasker prefs, but it basically shows a clean activation of the profile (with no warnings or anything that looks weird to me).
I know there's a 10-minute timeout in the Display Off Monitoring prefs, but that doesn't seem to be related to my issue. I tried reducing the All Checks Seconds from 600 to 90, rebooted the phone, and it still took ~10 minutes before the profile would become inactive after the phone being idle.
Any thoughts as to what the culprit might be? Are there any system logs I can look at that might shed some light here? I'm new to Android, and this seemed like the place to ask..
Thanks.
Ok, not solved..
Alright, bumping this, as the problem is back again after some time.
Has anyone ever seen Tasker exhibit the behavior I described? Again, I start the phone and Tasker profile is active, let the phone go idle for >10 minutes, the profile is no longer active and I need to restart Tasker manually to make it active again.
Still trying to figure out what logs are best to look at..

[Q] Push Notifications Delayed/ Undelivered[EXCEPT GMAIL]

Hi everybody,
My device is rooted with pure stock 4.2.2 and mediatek 6572 processor.
Problems: (ONLY OVER WIFI and SCREEN OFF)
1. all my notifications are either delayed or undelivered, when screen is off.(not SMSes but those over WiFi)
2. GTalk messages always take 5 minutes(Heartbeat Interval duration) when screen off
3. Play Store apps are never updated/ downloaded when screen is off, start right after screen is on
4. IM apps like Xabber never get IMs until screen turned on
Exceptions:
1. NO PROBLEMS WHILE SCREEN ON
2. Gmail ALWAYS gets email exactly after 30 seconds or more(possibly rules out connection timing out)
3. Above problems disappear using MOBILE DATA
4. NEVER HAPPENS during charging
5. With LOCATION REPORTING enabled, Talk messages reach within 30-40 seconds, with screen off.( battery consumption doubles also)
ALREADY TRIED:-
1. In sleep policy set to Always On
2. Used PNF and set heartbeat interval at 5 minutes, to no avail
3. PORT 5228 not blocked on router
4. WiFi optimizations turned off
5. No battery saving mode or 3rd party app enabled
6. Background Data Restrictions disabled
7. Same thing in SAFE MODE
8. Did FACTORY RESET
9. Tried logging in from another Google account
Any help is greatly appreciated!!
same problem here, have you found the solution?
I have done your own attempts..but nothing.
i have two android phones with CM11, 1 has no delay and one yes
Sounds like the device is going into a very deep sleep when the screen is off. Most likely a software setting or a kernel setting that some use boost battery life. Also make sure not to have greenify installed.

Screen off vs standby

Since i'm playing with amplify and power nap on my asus ze551ml (lollipop 5.0 with boret's kernel), i faced the following:
When the screen is off, the device doesn't go to sleep mode, or at least i think so.
I'm doing my testing with telegram; i said to amplify to limit his alarms to 1 every 10 minutes, and it is working fine undernight (BBS confirms that)
Now i'm even trying Power Nap, which is supposed to completely stop Telegram (and others).
Anyway, if i put the screen off, and then send a message to my telegram account, the phone still receives it almost instantly (3 seconds delay).
This clearly means that telegram is still active and kicking, it is not using any wakelock, it is alive all the time.
But, i repeat, it works overnight (Better battery stats confirms that amplify is limiting his alarms).
Another strange thing, is that i've configured com.asus.powersave to disable wifi as soon as the device enters sleep state, but when i wakeup my phone in the morning and see the BBS statistics from "screen off" to "screen on", it shows that wifi has been active for more than 18 minutes, so here's the question:
Is there a time/timeout to wait after one tunr off the screen for the phone to enter in standby/sleep mode?
And if yes, is that time configurable?
Thanks.
I made a test that confirmed what BBS said; i turned the screen off and start to ping my android wifi ip.
After about 18 minutes (that's the time BBS said wifi was active after the whole night), it stopped responding to pings and telegram of course wasn't workling anymore.
Is it possible to change that timeout to something lower?

Categories

Resources