← Back to context

Comment by bityard

3 years ago

Doesn't Android's aggressive app sleeping/killing policies (ostensibly to extend battery life) make this somewhat... well if not useless then at least a challenge?

I have a bunch of old Android phones kicking around that I'd like repurpose for random IoT/monitoring things but I don't trust them to stay "on" all the time. And Raspberry Pis are pretty cheap, so...

Termux supposedly has a setting that prevents that. I haven't had issues so far; I keep long-running stuff like tmux with `tail -f log-file` etc running for literally months.

Just make sure to either set the thing to not go to sleep while connected to a power supply in the developer settings, get a wake lock for your specific application or use another app to keep the device awake. Android phones make for versatile sensor-rich platforms for monitoring/media/etc. applications. They come with their own wifi hotspots, 3/4G communications, several cameras, microphones, motion sensors, compass, gyroscope, light sensors, proximity sensors, magnetic sensors and more. They even have their own built-in UPS so... get hackin'.