Some people like their homelabs to be as big and fancy as possible, with racks of new or surplus server hardware sucking down power. [Hardware Haven] evidently has the opposite idea, given he just made a video about making the cheapest, smallest server possible: an Android phone.
Sure, it’s not going to be streaming terabytes of data at multiple gigabytes per second, but that’s not everyone’s use case. Don’t forget, flagship phones had multiple cores and gigabytes of RAM a decade ago, so even an old and busted smartphone has more than enough power for something like Home Assistant, which is what gets installed in this video.
After considering loading termux and rooting his device for Docker-on-Android, he opted for postmarketOS, the premiere Linux for old smartphones. That’s not because the Linux environment you get with termux wouldn’t work; it’s just that he wanted something native. To that end, he bought a somewhat worse-for-wear Xiaomi Mi A1 from eBay to get hardware Alpine-based postmarket could use.
Software wise, it was just a matter of following instructions and reading manuals — Linux is Linux, after all. The firewall proved to be his main challenge, though trying to branch out from Home Assistant to run Minecraft Server did run into Java issues [Hardware Haven] had no interest in troubleshooting. Hardware wise, though, well — do you want to leave a phone plugged in permanently? Smokey the Bear suggests you not, especially if you live near a forest. Besides, you probably don’t want your server on WiFi, and at least this smartphone wouldn’t charge when using a networking dongle.
That meant phone surgery: the battery came out, and 5 V from an old USB charger was piped into the battery charge controller via a diode. The diode was used for its voltage drop, to bring the 5 V supply down to a believable battery voltage — a buck converter might have been better, but you use what you have, and the diode drop doesn’t dissipate much power. Power dissipation is still one watt at idle, six during a stress test.
Given how cheap the phone was, and how little power this thing sips, [Hardware Heaven] has an excellent answer to those who say homelabbing is a rich person’s hobby. This project also reminds us that while our phones might not be as hackable as we’d like, they’re still far from totally locked down. You can even run NixOS on (some of) them.
Note that the diode forward voltage depends on the current you draw through it. The normal assumption of 0.7 Volts holds for large currents, while for small currents in the microamps or milliamp range for large diodes, the forward voltage drop might be halved.
In other words, if you take a 5 Volt supply and pretend to be a lithium battery by a diode, it may work until you turn the device off, at which point the charge controller sees a much higher voltage and may not turn back on because it thinks the “battery” is overcharged and possibly damaged. It may also damage the charge controller and/or any component down the line.
Solution: use two diodes in series. The simulated battery will look emptier but you’ll be squarely within the normal battery voltage range.
The bigger issue with the setup is the power dissipation. If your maximum power draw at 100% load is 6 Watts at 5 Volts, then 1.2 Amps must be going into the device, which means the diode will see just under a Watt of heating, which may still bring Smokey the Bear around for a visit. What’s more likely, you’ll hear a pop and smell something acrid, and the phone suddenly stops working.
Solution: pick a larger diode rated for more amperage and leave it outside of the phone where it can cool itself.
Or, just use an Lm317 or similar adjustable regulator.
Some LDO would do – LM317 has too much drop.
Also, same problem with the heat dissipation. A Watt is a lot unless you have a heatsink.
Ooooh, magic homelab smoke!
That USB cable will not last long with that (too) tight bend right near the plug.
If it is not moved it will last nearly for ever, no matter the bend
Smartphones have great hardware for the price and after they are too slow to run the “latest” version of the OS and apps, and stutter, I foresee no reason why they should not be able to be repurposed as servers, or something similar. The RAM is good, the storage should still be good, the CPU is far, far faster than most SBCs
The only problem is the terribly closed up software
Arm architecture and only one USB port is a tad limiting too.
Android phones can use USB hubs and a lot of stuff runs on Arm these days.
“if it has a C compiler, it’ll run anything”
You’d be hard-pressed to find anything that won’t run on arm64 alpine.
I have a moto phone where the sound doesn’t function anymore (it got wet) and this sounds like a good project for it. I might be lazy and fiddle see if a USB hub will work, since I know how much of a PITA it is to take most recent cell phones apart. Yeah, I know, smokey would like a word, but between some jank with a diode and the existing battery that has, frankly, done fine even after water damage, I’m inclined to toss it in an old coffee cup where I can see it and take my chances.
If your moto’s less than probably 5 years old it should work with a hub. Really, anything with USB OTG probably will, and that tends to include even older phones. I saw this video when it came out and I’m kind of considering getting the same phone Hardware Haven did, because Postmarketos supports it (I wish some of these projects like this or Lineageos supported newer phones, but it is what it is.)
Honestly x64 should be the norm. Arm and mips and all that bs, even soldered ram ought to be outlawed.
For many of my projects Termux, with the API pack , makes an easier solution on many more Androids than Postmark and other distros. The Droids I use are wiped clean and on reboot I disable or kill as many Google and carrier bits as I can find. Mostly I just use WiFi as i am not needing the carrier cruft.
I have run web servers, a few Tor hidden services so I can get to them outside my home net, music servers , and recently got copy party going over tor.
Its a great compact on the go server. Ymmv
do you have any details about this.
i have a bunch of collected “obsolete” smartphone that i would like repurpose but the PostmarketOS is a nope and building an AOSP image is overkill.
If you ever do a write up, let us here at Hackaday know– lots of people would benefit from knowing how you do it.
Whoa whoa whoa whoa hold on hold on You guys can use this with termux You guys also can make your guys own music base station as in a base network in your own home and if you’re outside your home network you can go on your LTE network and connect to your home station storage computer system that has all your music on there You can code your own music server like YouTube music You could host your own music service on Android devices
Can you host your own photo library as well? How would one go about doing these things? I’d love to get rid of subscriptions to cloud services that I don’t want, but want to access my music and photos still. Thanks!
Samsung batteries have NFC antennae in a wrapper on the side with two traces going to the end board. Twice I failed to preserve the connection in taking it apart and broke the security of a genuine battery.
So my favorite use for an old phone:
https://photos.app.goo.gl/Uya8TAkaUuj7EPPMA
I talked about it here: https://hackaday.com/2022/07/18/quick-hack-the-phone-to-stream-deck-conversion/
The stand is a $5 special from Five Below. It is ok but if you pull it off, the ring that holds it comes off with the phone. Not a big deal since it just stays there permanently anyway.
I’m having Déjà vu.. Was this not on here recently, even with a board you could buy to place the phones motherboard directly on for power and breakout?
I know it’s a bad idea but the entire reason I would even consider using a phone to run HASS, is because of the internal battery. That would be the biggest upside to the entire thing. Right now I’m waiting for my batteries to come in for my UPS hat for my Pi, just to have the PI run safely for along time and not be afraid of power outages.
Very creative idea but still the risk of powering the phone permanently from the charger and the danger of exploding battery – unless the battery is removable- but this isn’t the case in new flagship new phones.