posted in Selfhosted

Part 3: They said a phone can’t run without a battery. Unfortunately, Pettyl didn’t get the memo.

This post is an update of the second part of my Moto server series: lemmy.zip/post/72142441

Rumor has it that keeping an 8-year-old phone permanently plugged in with its equally ancient Li-ion battery might not be the greatest idea ever conceived.

Some even claimed that a phone needs a battery to work.

Very negative people.

Anyway, I removed it.

Pettyl did not care.

nginx: UP PHP-FPM: UP MariaDB: UP WordPress: UP cloudflared: UP sshd: UP

The battery is currently sitting next to the phone, contributing absolutely nothing to the project.

Pettyl is now running entirely from USB power, at around 37°C, while continuing to serve the website like this is completely normal.

There is, however, one tiny detail the haters may enjoy:

It can’t boot without the battery.

So the official Pettyl disaster recovery procedure is now:

  1. Insert battery
  2. Boot Pettyl
  3. Connect USB power
  4. Remove battery
  5. Pretend this is enterprise infrastructure

The battery is no longer a battery.

It is the starter motor.

I see no problems with this architecture.

Anyway, Part 3 is going great.

Edited ⁨⁨Sep⁩ ⁨26⁩, ⁨2026⁩, ⁨11:30⁩⁩enPage

Replying to @⁨tradicije@lemmy.zip⁩

My old Galaxy S5 would work without the battery, including bootup. So it’s not entirely unexpected that other phones could also do so. I would say I can’t imagine who would take the time out out of their day to just talk out their ass and claim something like this wouldn’t work without trying it first. Except then I remember this is the internet, and people do that all the time.

Regardless, good on you for making this all work!

Replying to @⁨dual_sport_dork@lemmy.world⁩

Hahaha, thank you for defending me! 😄

Just to clarify though, the “they said it couldn’t be done” part was mostly me being ironic and unnecessarily dramatic for the post lol. The comments on this whole project have actually been overwhelmingly positive and helpful.

People here are the reason I even tried some of this stuff in the first place.

But I genuinely appreciate you having my back. And the S5 being able to cold boot without a battery is really interesting — Pettyl unfortunately needs its battery as a starter motor. 😂

Replying to @⁨tradicije@lemmy.zip⁩

The HTC Aria at least could also cold boot from USB power. The first method developed for bootloader unlocking on it required an SD card with the unlocking software be inserted at a particular time during the boot process. And the SD card slot was under the battery!

Edit: now I have to double check myself; signing back into some old posts maybe I’m not remembering the process correctly. It was maybe 16 years ago, and I’m getting old! :-)

Replying to @⁨tradicije@lemmy.zip⁩

I once soldered a usb wire into the terminals where the battery of my moto g4 used to be, and it kept crashing on boot. So I added a large capacitor right across the terminals, and even with that and being at 5V (on a 5 amp supply), some apps still overloaded it and got it to crash.

Would love if there was some package that just attached like a battery with a usb wire coming out the bottom, that could supply any spikes if the usb provided enough average power.

Replying to an earlier post

It’s not just the spike, but the battery is supplying more power than the adapter for sometime extended periods of time. It would take an expensive, or very large, capacitor bank to hold enough power to accomplish that for very power intensive apps. Capacitors are good at charging and discharging quickly and lasting many more cycles than a battery, but no where near the capacity.

What you really need to know is exactly how much power the battery can provide and adjust the power supply to be able to supply that on demand and just enough capacitor capacity to smooth out the initial spike until the power supply gets the power up. I haven’t done the research to know the exact amounts, but I have a lot of experience with electrical and electronics in general, both professionally and amateur. So I could probably build it if o knew the exact specs.

That or adjust the phone firmware to limit the processor and GPU speeds, but that’s only possible on some phones that have code available and a way to root it without some hardware switch killing the phone permanently.

Replying to @⁨nullroot@lemmy.world⁩

That’s why it’s a response to “I want…”!

An add-on to the wishlist, as it were. I’m just an old non-tech cis woman but I firmly believe generous pockets could and should be designed/engineered/built into every twirly skirt, every thigh-high (but down near the ankle bc gravity) every booty pant and even red-carpet gala gowns. At least someone finally realized workout leggings can have a pocket down on the leg if it’s so god-damned important not to interrupt the “line” elsewhere.

And everyone should feel free to wear whatever styles they feel suit them, with neither social stigma nor pocket-neglectful construction holding them back.

Replying to @⁨foggy@lemmy.world⁩

I used to keep a charged spare on me.

There’s at least one Chinese brand that has smartphone with hot-swappable battery: rugone.net/products/xever-8

Removable battery. Swap within 2 minutes for zero interruption. After 2 minutes, the device enters a 60-second safety lock-out to protect your data.

Unfortunately, software from these brands tends to be shit. I feel like they just outsource it to the cheapest company. Especially following this recent thing:

As of March 4, Sophos X-Intercept telemetry listed over 500 unique compromised Android devices across nearly 50 models. The devices were mostly low-cost models produced by the following manufacturers: Allview, BLU, Dcode, DOOGEE, Gigaset, Gionee, Lava, and Ulefone. The list did not include Alldocube devices, despite Kaspersky reportedly observing Keenadu affect that manufacturer as well.

Source - Sophos
Report from Kaspersky

Replying to an earlier post

Anything made to be run from battery can work fine without one. Worst case scenario requires you to spoof some I²C communication to properly emulate a battery, but most devices and batteries are far dumber than that. DC is DC, and sometimes you just need to graft something on top for the other pins.

Source: My old laptops charging circuit failed, so I soldered the charger onto the battery pins instead. Then I replaced the actual battery with an Adafruit Itsybitsy 32u4 (because that what I happened to have available) that emulated the battery status of “Charging, nothing to see here, move along” and sent it via I²C

Replying to @⁨Asetru@feddit.org⁩

AFAIK it depends on the device. I believe it’s simpler to have a battery management system which keeps the battery charged when power is attached, and then a second separate system which powers the phone from the battery. That does lead to more wear on the battery though, so the better solution is to have a power management system which monitors the battery and keeps it within a set charge range, and additionally can supply the voltage needed to run the phone. Only when power is not connected does the battery power the phone.

From a quick google though, it seems that’s only part of the picture. High-end modern phones will often require a battery present, as they use it to smooth out the power coming from the adapter, even though most of the power for the phone when the charger is attached comes from a direct power path.

Replying to @⁨Asetru@feddit.org⁩

You are not wrong, just for Android. Sometimes. I don’t know why it’s working fine for OP.

The battery controller will reboot it after a second or so if battery voltage is too low, in this case zero. But only if the BMS is actually plugged in, if it’s not it doesn’t care (at least for me) and then it’s Android’s problem. Unless you are booting something non-Android, then it just works and shows 1%. Unless the load is too big for your charger to handle, lul.

Qualcomm SoCs specifically need to run without a battery for EDL/firehose at the factory. And for the devkits. Mediatek needs it for it’s own flashing thingamagig.

Fun fact, plugging in a charger to a dead phone/tablet/whatever doesn’t start charging right away, it powers the CPU from the plug for it to then boot enough to turn on the charger. Unless it’s wired shitily, then it just sits there dead.

Replying to @⁨tradicije@lemmy.zip⁩

I have a challenge for you, if you dare!

How many “Google-like” services could your phone server serve at the same time?

  • Google Photos <-> PiGallery2
  • Google Keep <-> Memos
  • Google Drive <-> Syncthing
  • Google Calendar <-> Radicale
  • Google Contacts <-> Radicale
  • Google Tasks <-> Radicale
  • YouTube Music <-> Navidrome
  • Google Password Manager <-> Vaultwarden
  • Google Reader <-> FreshRSS
  • Chrome bookmarks <-> linkding
  • Google Analytics <-> GoatCounter

And, if the little Moto still has RAM left:

  • Google Docs <-> Etherpad
  • Google Search <-> 4get

How far can 1 GB actually go?

There - now you have the perfect excuse to buy a second moto to play with.

Replying to @⁨moopet@sh.itjust.works⁩

It sounds like a good idea until you remember that USB provides 5V and the battery contacts are designed for a Li-ion battery and its management circuitry.

Wiring USB directly to the battery contacts would basically be like noticing your car runs on petrol and pouring it directly into the engine instead of the fuel tank. The general concept of “engine needs fuel” is technically correct. The implementation leaves something to be desired.

The USB port and the phone’s power-management circuitry exist for a reason, and bypassing them could damage the phone or make it behave in exciting new ways.

A properly regulated dummy battery, however, might actually work. Unfortunately, that means I now have another terrible idea to investigate.