Automatically power up Android Device (No Human Intervention)

107 views
Skip to first unread message

John Whitmore

unread,
Apr 15, 2016, 6:15:03 PM4/15/16
to android-...@googlegroups.com
I've been looking into this for a while and can't find an elegant solution. I
have an Android phone (Nexus S (but not tied to it)) connected to embedded
system. Say for example something like an Arduino, (but it's not) I'm trying to
find some way that the electronics can periodically power up the Android, use
it's comms and power it down again.

Once the Android is powered up it can actually power itself off when it's
completed periodic tasks.

I had hoped that there would be opensource code that would let me power up the
phone when it's connected to 5V charging power. That would be simple for the
Electronics to turn on, but not simple in Android as it's probably Boot loader
code, which is HW Dependant.

I then have a One Puls One which will power itself up if you set an alarm and
power off the phone. That would work as the phone could power itself up with
an alarm do it's functions, set a new alarm and power down. The problem with
that is that again I only have one phone that actually does that
functionality.

Perhaps the easiest way is to de-solder the power on switch and wire it to the
electronics. Let an IO Pin power the phone up and down with the
switch. Actually Human intervention is required for power down confirmation.

Hmmm can of worms

Michael Moussa

unread,
Apr 17, 2016, 6:47:28 AM4/17/16
to android-platform
Power off dialogue should be solvable by modifying AOSP. For power on a hardware mod like you suggested is the only thing I can think of.

What's the use case? Are you just trying to save power between runs off a periodic task? Have you considered leaving the phone on and have it going into a low power standby mode between runs? Either way you still need to figure out how to charge the phone once in a while, although powering it off would buy more time between charges.

John Whitmore

unread,
Apr 18, 2016, 10:52:51 AM4/18/16
to android-...@googlegroups.com

Yes the use case is comms in a remote location working off battery power, so
trying to squeeze as much out of batteries as possible. I'll go with the
Hardware mode and modify the power off dialogue.

Thanks a million for your help. I'll try it out, nothing to lose.

On Sun, Apr 17, 2016 at 03:47:28AM -0700, Michael Moussa wrote:
> Power off dialogue should be solvable by modifying AOSP. For power on a hardware mod like you suggested is the only thing I can think of.
>
> What's the use case? Are you just trying to save power between runs off a periodic task? Have you considered leaving the phone on and have it going into a low power standby mode between runs? Either way you still need to figure out how to charge the phone once in a while, although powering it off would buy more time between charges.
>
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
> To post to this group, send email to android-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-platform.
> For more options, visit https://groups.google.com/d/optout.

Michael Moussa

unread,
Apr 19, 2016, 1:08:23 PM4/19/16
to android-...@googlegroups.com

You may be able to do the shutdown with just root and not have to modify AOSP. Just run the Linux shutdown command using root

You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/f4XS9wim3ik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.

Dave Adams

unread,
Apr 29, 2016, 11:28:50 AM4/29/16
to android-platform
#reboot -p should poweroff the device

For power-on; you might be able to do what mentioned, just not sure of directions on the nexus s.

Basically when 5V is applied, you get a battery charging animation right?

Well this is controlled by a binary in /system/bin/ (names vary); simply replacing/removing this binary may cause the phone to fully boot, but again this is likely device specific behaviour.
Message has been deleted

John Whitmore

unread,
Apr 30, 2016, 11:11:35 PM4/30/16
to android-...@googlegroups.com

I got powerdown done but editing

framework/base/core/res/res/values/config.xml

It's not commented in the code but if you change the shutdown to 3 it gets rid
of the power down confirmation:

<integer name="config_longPressOnPowerBehavior">3</integer>

It's not documented but searching through the code I found it. It's intended
as a factory test setting. Works a treet.

Power up I've done a Hardware mod by removing the switch and soldering on two
wires. That works as well but I'll have a look at the recharging animation to
see if I can use that mechanism. It would certainly be cleaner then two wires
hanging out of the phone.
Reply all
Reply to author
Forward
0 new messages