Dedicated Phone with Automatic Startup and Shutdown

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
I wanted to build out a dedicated phone with fully automatic startup and shutdown that I could leave in my car for JBV1. My built in screen is generally showing Waze and my normal phone is generally mounted low in the car handling music, so I figured why not add another?

First, I picked out a current Android ROM that worked well with my old OnePlus One and focused on getting it to automatically boot up when plugging it in for charging.

I went with LineageOS 16 and rebuilt my boot.img to automatically start the OS using this guide:
I tried other autoboot methods like editing "/system/bin/healthd" or setting "fastboot oem off-mode-charge 0" but they didn't work for me. Also LineageOS 17 didn't seem to work with the boot.img tools either.

Next I loaded up OpenGApps pico for the play store and Magisk for root and made myself a spare throwaway gmail account. Then I shut off the phone's lock screen and paired it to my primary phone via bluetooth tethering since I don't have a dedicated car wifi access point. Bluetooth connection sharing is slower than wifi tethering for app updating, but you won't notice a speed difference when just running mapping apps and bluetooth tethering uses minimal power so you can leave it on all the time.

Next I loaded up JBV1, Waze, Google Maps, MacroDroid, Blackvue (& Blackvue Battery) for my dashcam, Adaway (I manually add a block on advil.waze.com to prevent Waze ads), and Firefox with uBlock Origin. I also put on gmail (just in case I wanted to email myself something), and 3C battery manager so I can graph battery temps over time (probably not needed but I am curious).

Normally I'd just use Tasker, but since I'm considering this phone throwaway (it's staying in my car and won't have a lock screen) I don't have access to my paid copies of my apps.

I set up the attached macros in MacroDroid (see attached photos) to automatically shut the phone off whenever it doesn't have power. I also added a custom macro widget to toggle the shutdown macros off and on. Shutdown is on a 5 second delay so I have just enough time to hit the custom button to disable the macros if I want to keep the phone on when it's not charging.

Finally I set up JBV1 to autostart and autoconnect.

As soon as my ProClip mount arrives, I'll have a fully hands free solution.

Anyone else found solutions for automatically starting up their android phone?
 

Attachments

  • Screenshot_20200707-195826_MacroDroid.png
    Screenshot_20200707-195826_MacroDroid.png
    190.3 KB · Views: 51
  • Screenshot_20200707-195819_MacroDroid.png
    Screenshot_20200707-195819_MacroDroid.png
    173.5 KB · Views: 46

sdrawkcaB

Defender of Light 📶
ModSec
Premium Plus
Lifetime Premium
Advanced User
Joined
Mar 6, 2018
Messages
6,562
Reaction score
14,169
Location
Here
I've wanted to do something similar, but had a lot of these same questions. I'm definitely excited to follow your progress on this. I'll likely rely on your guidance here in the near future. Thank you for taking the time to create this helpful How-To post. It is much appreciated. We need more people like you to come to the forums and be willing to share and give back to the community. Thanks again!
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
Thanks for the words of encouragement, I'm glad people are finding my projects useful.

Last night I simplified the Macros so they would work smoother and I removed the need for a widget. Now it just pops up a box that lets you know your phone will shut off in 5 seconds if you don't press OK. Also, since the free version of MacroDroid only allows 5 macros, I combined my startup macros into the auto shutdown macro by using two triggers on the same macro.

I'm also considering installing a battery charge app from F-Droid to stop charging at 80%, but we'll see how the phone behaves in practice before I go overboard.

If anyone is curious, my One Plus One with LineageOS 16 takes about one minute to start up. I figure I'll wire it in so it can boot while remote started. Worst case, if I do a manual start, I probably will be driving pretty easy during the first minute of runtime anyway. The key is making sure it automatically starts and connects so I don't need to touch anything.
 

Attachments

  • Screenshot_20200708-075838_MacroDroid.png
    Screenshot_20200708-075838_MacroDroid.png
    170.7 KB · Views: 30

Bloovy One

"Today didn't have to end in eels"
Premium Plus
Lifetime Premium
Corgi Lovers
Advanced User
Joined
Feb 8, 2016
Messages
7,139
Reaction score
16,015
Location
Western NC
What might the negatives be if the battery was removed entirely? Power on with the vehicle, power off with the vehicle. If the running environment wasn't changing much, that might not hurt anything.
 

johnboy00

Geaux Tigers!
Premium Plus
Lifetime Premium
Advanced User
Software Developer
Joined
Sep 6, 2016
Messages
5,071
Reaction score
11,900
When I ran a dedicated phone, I used Tasker to turn on/off Wi-Fi and BT on power state connected/disconnected. With a healthy battery and airplane mode enabled, my phone could sit idle for weeks, ready to spring to life instantly when accessory power was energized.
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
What might the negatives be if the battery was removed entirely? Power on with the vehicle, power off with the vehicle. If the running environment wasn't changing much, that might not hurt anything.

Removing a battery generally isn't an option, the battery helps smooths out the power and handle the spiky current loads seen in phones. Sometime I've been able to remove a battery and put in a capacitor, but it doesn't quite behave the same way.

When I ran a dedicated phone, I used Tasker to turn on/off Wi-Fi and BT on power state connected/disconnected. With a healthy battery and airplane mode enabled, my phone could sit idle for weeks, ready to spring to life instantly when accessory power was energized.

That is an excellent idea, I'll have to give it a try.
 

sdrawkcaB

Defender of Light 📶
ModSec
Premium Plus
Lifetime Premium
Advanced User
Joined
Mar 6, 2018
Messages
6,562
Reaction score
14,169
Location
Here
When I ran a dedicated phone, I used Tasker to turn on/off Wi-Fi and BT on power state connected/disconnected. With a healthy battery and airplane mode enabled, my phone could sit idle for weeks, ready to spring to life instantly when accessory power was energized.

I had a coworker who tried this, and the tablet he used would go dead if it was a 3 day weekend. He didn't have the same success as you at keeping the phone idle. He ultimately gave up this approach. I don't know if he used airplane mode. I'll have to ask about that.
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
I'm trying an airplane mode test now, we'll see how long it lasts. I have 3C battery manager sitting in the background logging the battery consumption.

I figure that no matter what, eventually my old OnePlus One won't hold much of a charge and I'll either need to crack it open and replace the battery or deal with it shutting down.

I might try tweaking my macros so above some battery percentage it goes into airplane mode, but if the battery drops too low it just shuts down. If I recall, my phone will refuse to start up if the battery is completely dead, so I don't want to cut it too close. Waiting for a 20 minute trickle charge to boot would not be a viable solution.
 
Last edited:

johnboy00

Geaux Tigers!
Premium Plus
Lifetime Premium
Advanced User
Software Developer
Joined
Sep 6, 2016
Messages
5,071
Reaction score
11,900
I had a coworker who tried this, and the tablet he used would go dead if it was a 3 day weekend. He didn't have the same success as you at keeping the phone idle. He ultimately gave up this approach. I don't know if he used airplane mode. I'll have to ask about that.

Well, if it's dedicated to car use only, it can't be loaded with a bunch of crap that's always running in the background. 30% or so drain per day while idle is horrible, even for a phone. I went through the app manager and everything I didn't need was uninstalled, or disabled if it couldn't be uninstalled. I also turned off auto updates in Google Play so it wouldn't try to update anything when Wi-Fi was turned on.
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
johnboy00 is spot on, with battery saver and airplane mode on, my old phone is averaging a loss of about .5% per 6 hours. I'd need a longer test to get exact numbers, but the savings is significant.

I'll be modifying my macros to automatically enter and exit airplane and battery saver mode until 25% or so, and to only shut off beyond that point. Turning Battery saver and airplane mode off and on takes a little bit of time (5-10 seconds), but it is significantly faster than a reboot.

Also, I should note that I automated my bluetooth internet tethering with "Bluetooth Auto Connect 4.6.5" on the JBV1 side (newer versions are filled with ads) and Tasker + Secure Settings on my main phone side.
 

johnboy00

Geaux Tigers!
Premium Plus
Lifetime Premium
Advanced User
Software Developer
Joined
Sep 6, 2016
Messages
5,071
Reaction score
11,900
'll be modifying my macros to automatically enter and exit airplane and battery saver mode until 25% or so, and to only shut off beyond that point. Turning Battery saver and airplane mode off and on takes a little bit of time (5-10 seconds), but it is significantly faster than a reboot.

You don't have to turn airplane mode off. Wi-Fi and BT can be turned on/off independently. Airplane mode on is just a convenient way to disable the cellular radio, but you can do it by other means as well.
 

protias

Retired CM enthusiast / Train Horn Advocate
Premium Plus
Lifetime Premium
Advanced User
Joined
Oct 29, 2010
Messages
23,311
Reaction score
17,707
Location
WI
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota

Some devices work better with that method than others, the viability really depends on how they designed the power supply in the phone, and every phone will be different. The peak available current from a lipo is much higher than from a power brick, and this will affect the tuning of the switching supply. Sometimes you can compensate with a capacitor across your supply, sometimes it's not enough, and sometimes it will work for "a while" until the magic smoke comes out.

If you're using your phone for something you care about, and want to keep it reliable and simple, I'd keep some kind of battery installed, even if its an older or lower capacity unit.
 

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
When I moved my main personal phone macros to android 10 I couldn't get Bluetooth tethering toggling to work with Tasker and Secure Settings. After spending a pile of time trying to find something that worked, I noticed that MacroDroid supported BT Tethering toggling natively, so I moved all my other scripts over to MacroDroid and dumped tasker as my automation tool on both my main phone and my JBV1 phone. MacroDroid is lacking some of the high end options Tasker has, but MacroDroid has all the basics I was looking for built in and it didn't need a pile of helper apps to make my automation work.

With adaway on my JBV1 phone, the free versions of MacroDroid, Waze, & 3C battery monitor don't show any ads. The only real restriction is the free version of MacroDroid can only have a total of 5 Macros, but the automation to launch and stop JBV1 and turn the phone off if the battery gets really low only needed 3.

Attached are my 3 MacroDroid scripts I run on my JBV1 phone. I also have set my phone background to all black, and removed all icons from my home screen to make it look cleaner when the program starts or stops.

On my main phone, I have a pair of macros for JBV1 that turns BT tethering off and on when my main phone connects to my car's head unit.

Note: I noticed that 3C Battery Monitor was consuming more battery power than I expected so I manually changed it to only log battery data once an hour. I may eventually remove this app entirely, but I do like having some data on hand to keep an eye on my battery's health.
 

Attachments

  • Cancel_Shutdown.txt
    2.4 KB · Views: 14
  • Power_Saver.txt
    6.2 KB · Views: 14
  • Shutdown.txt
    2.3 KB · Views: 14
Last edited:

Delta9

Learning to Fly
Beginner User
Joined
Jun 18, 2020
Messages
123
Reaction score
155
Location
Central PA
Thanks for your files and research. I just picked up this Android 9 "burner phone" for doing exactly what you are doing in the car. https://www.bestbuy.com/site/simple-mobile-blu-view-1-black/6373977.p?skuId=6373977

Now I am going to try and get your automation working to help startup and shutdown the device.
Post automatically merged:

I was trying to not have to root this "burner phone" because I didn't want to mess with it. I was able to delete two of your actions b/c I dont care about turning BT and Wifi on and off. But the third macro with the shutdown function being root only.

Looks like I won't be able to use that macro until someone comes out for a root for this Blu View1 phone
 
Last edited:

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
After putting some more use on my phone, here are my insights:

A cheap soft matte screen protector makes a dedicated display extremely readable.
JBV1's default light map is the best for in the sun.
Nova Launcher is majorly battery hungry, stick to Trebuchet on Lineage.
Sending an intent to JBV1 to shut down doesn't always seem to work if a BT connection is in progress, killing the process is most reliable.
My phone doesn't seem go to 100% brightness when set to auto brightness. My older phone really needs 100% when it's in the sun. (likely phone dependent) Still working out the best way to automatically disable full bright at night.
After enabling bluetooth, you want to have a while loop that waits until BT is actually on before starting JBV1 or enabling wifi (likely phone dependent)
Currently testing battery management via ACCA (free) from F-Droid.
 

Attachments

  • macro.png
    macro.png
    397.8 KB · Views: 22
Last edited:

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
My battery life is down to about 7 days. I think that this old phone is just getting tired (or it doesn't like being in the sun). I don't see any additional app power consumption in 3C battery manager's logs.

This is kind of a problem, because at 7 days, that means if I don't drive for a week, the phone will reach 0%. Currently, I alternate between periods of lots of driving and being parked for a week, so this is a problem for me.

And if you don't know, at 0% a phone generally cannot just start up again, you have to wait about 5-10 minutes for it to charge before use. This isn't really acceptable to me.

I made two changes to my setup to address this. I installed ACCA and set it to let the phone charge to 98% to 99% (pretty much full), and to shut the phone off at 20%. This should always give me enough power to start back up again. I also disabled the temperature control because I noticed it tripping constantly when driving in direct sunlight for extended periods of time. It's not good for the battery, but there isn't much of an alternative. Maybe I'll try 3D printing an ABS hat for my phone and see if it keeps it cooler.

I also made the decision that if my phone is on for 4 days, I want it to just shut off. This means I can park on a friday, and then if I don't drive anywhere during the weekend or monday, Monday at midnight it will shut off. This is accomplished with a script that runs every night at midnight and checks how many nights the phone hasn't been used for.

I also made a pair of scripts that switch the phone between auto bright and max bright. When set to auto bright my phone will not switch to 100% bright, and I need 100% bright for direct sun use. I'm still playing with the threshold values.

The only change I made to my main script is to reset the "days-on-without-use" counter to zero whenever it's launched.
 

Attachments

  • Screenshot_20200905-071942_MacroDroid.png
    Screenshot_20200905-071942_MacroDroid.png
    137.3 KB · Views: 18
  • Screenshot_20200905-071949_MacroDroid.png
    Screenshot_20200905-071949_MacroDroid.png
    114.8 KB · Views: 18
  • Screenshot_20200905-072006_MacroDroid.png
    Screenshot_20200905-072006_MacroDroid.png
    145.7 KB · Views: 17
Last edited:

SwapFile

Learning to Fly
Beginner User
Joined
May 3, 2020
Messages
75
Reaction score
118
Location
Minnesota
With the coming of winter, I changed my setup a little bit.

From my home, I always remote start my car. This way it's cool in the summer and warm in the winter. Because of this, I moved my jbv1 phone fuse tap to a fuse that is on when I remote start.

Combined with my boot.img modification, now no matter the battery level, my JBV1 phone will be able to startup and then shut it's screen off to be ready for me. The screen will stay off until my personal phone Bluetooth tethers to my JBV1 phone (for internet). Then when I shut the car off, the JBV1 screen will immediately turn off, but the phone will stay on for an hour so it's ready to go if I'm just out running errands.

Attached are my current macros. Note that I explicitly disable wifi because the only reliable way I've found to detect the bluetooth pairing is via the "data available" trigger. Having wifi available can false trigger that.
 

Attachments

  • Startup.png
    Startup.png
    166.8 KB · Views: 3
  • Shutdown.png
    Shutdown.png
    141.5 KB · Views: 3
  • Pairing.png
    Pairing.png
    44.7 KB · Views: 3
  • Auto_Brightness.png
    Auto_Brightness.png
    60.5 KB · Views: 3
Last edited:

Discord Server

Latest threads

Forum statistics

Threads
90,748
Messages
1,381,228
Members
22,818
Latest member
ahmednofal
Top