4 ms·
Is there a way to run a little web server on our phones? It's a device that's always on, and usually on Wi-Fi
by alx__ 4y ago
Is there a way to run a little web server on our phones? It's a device that's always on, and usually on Wi-Fi
- tandav 4y agotermux (android) can run python, node, docker and more, but you should have static IP or some tunneling like cloudflare/tailscale/zerotier
- flobosg 4y agoSee https://news.ycombinator.com/item?id=31841051 https://news.ycombinator.com/item?id=31841051 – Repurposing an old Android phone as a web server
- WorldMaker 4y agoMost modern phone OSes today try to limit background services to squeeze battery life out of idle states. Even though "always on", some of the idle states are extreme battery misers. For instance, even the iPhone 14 with its "always on display" is doing some really interesting idle stuff, the "always on display" itself refreshes as 1 frame per second or slower (sometimes one frame per minute! as the clock is the only guaranteed to update, once a minute). It seems like the device is always responsive due to how "instant" it wakes from idle states. All of which are a lot of very interesting reasons why you can't just run a web server on your current phone with its current modern OS and expect it to have 24/7 up time even though it feels to you like your phone has 24/7 responsiveness uptime. It's a solvable problem if there were enough interest: light web hosting is something that could be added to the list of system services that can wake the device from idle states (in similar ways to how notification services get prioritized, or trickle data feeds like Find My Services). It's not likely a problem that current phone OSes are incentivized to support, though, because there's currently no reason for millions of people to want websites served from their pockets. Maybe one day there will be an interesting P2P data "hosting" protocol that would be useful for modern OSes to prioritize in that way.
- mpd 4y agoI have an old phone set up here, running Octo4a. It's working great. https://github.com/feelfreelinux/octo4a https://github.com/feelfreelinux/octo4a
- ptrwis 4y agoI once ran some GNU/Linux distro on Android, and then Tomcat on it :)
- K7PJP 4y agoThe folks at IconFactory recently published a web server for iOS. https://apps.apple.com/us/app/worldwideweb-mobile/id1623006812 https://apps.apple.com/us/app/worldwideweb-mobile/id16230068...
- alx__ 4y agoOh nice! And it's from IconFactory :D
- Lendal 4y agoYou can but it would drain the battery fast. You can use an old phone that stays plugged in, but my old abandoned phones were all abandoned for a reason, usually because some critical part of them doesn't work anymore. Search for "fanless mini pc" on Amazon or whatever and you'll be surprised. There's a lot of cool devices available that are approximately the size of a phone, use very low power (under 15 W) like a phone, are under $200 brand-new, have wired ethernet built in, USB ports, HDMI ports, can run normal Linux, and unlike Raspberry Pi they are actually in stock.