Article 75Q0N Yes, you can serve a website from a $1 microcontroller

Yes, you can serve a website from a $1 microcontroller

by
from www.theregister.com - Articles on (#75Q0N)
Story ImageUPDATED Web hosting bills getting too expensive? Maybe you ought to consider serving your site from a one-dollar 8-bit microcontroller. Okay, you won't exactly be serving up a high-performance, graphic-rich website using this project from European developer and blogger Maurycy Zalewski. The setup is limited to one URL, but hey, it actually works, provided an influx of visitors hasn't killed the site yet. The bargain-basement chip that serves as the central component of this project is the AVR64DD32, which currently retails from DigiKey for $1.30. It has a single 8-bit AVR core with a blistering 24 MHz max clock speed, 8 KB of static RAM, 64 KB of flash memory, and 256 bytes of EEPROM non-volatile memory for storing a very limited amount of data. Zalewski told The Register in an email that the whole build was free for him, as he had everything on hand, but he estimates the total cost of the thing to run closer to $2 or $3 when accounting for resistors and capacitors, the board the chip is attached to, and the like. Serving a web page from such a limited chip is a task, to say the least, and Maurycyz had to do a lot of legwork to get the thing working. The I/O pins on the AVR max out at 12 MHz, which Zalewski explained meant that it wouldn't be possible to use Ethernet for the project, as the data flow from even the aged baseline Ethernet connection of 10BASE-T is too fast for the chip to handle. 10BASE-T still runs at 10 megabits/second," Zalewski wrote. Worse, it uses Manchester encoding: a zero is sent as 10' and a one as 01,' so 10 megabits of data is actually 20 megabits at the wire." The proper solution is to buy a dedicated Ethernet chip from DigiKey, but then I'd be waiting weeks to finish this project," Zalewski noted. Instead of waiting, he decided to take a different approach by turning to Serial Line Internet Protocol (SLIP), just like the guy who turned a discarded vape into a web server last year. For those unfamiliar with SLIP, it's a 38-year-old protocol designed to encapsulate IP traffic for transmission over serial lines, and it was widely used to make internet connections in the olden days. SLIP is still supported in modern Linux builds due to its compact size and the fact that it's often used to connect microcontrollers to the internet. Now, giving the AVR an internet connection didn't solve the harder problem of actually serving a web page to visitors. Zalewski said the chip could generate response packets by swapping the source and destination addresses on incoming traffic and resetting the packet's TTL value, but implementing TCP still took several days of work. HTTP handling was simplified by returning a hardcoded response for every request, which works as long as the site only serves a single URL. Here's that limitation we were talking about: This works fine as long as there's only a single URL on the site," Zalewski said. Sorry for those wanting to host more pages from that $1 microcontroller. Lastly, Zalewski said he had to figure out how to get requests from the internet to the microcontroller without spending money on a publicly routed IP address. That was resolved by using WireGuard to connect the microcontroller located at his home to a public-facing machine at a Helsinki datacenter, which then proxied requests to the microcontroller using a local address block. This means that visitors aren't directly connecting to the MCU's TCP/IP stack... but hey, it's the same setup that the Vape Server uses and no one complained," Zalewski said. And all without having to buy a vape or root through dumpsters to find an old one. Zalewski told us that the hardware he used for the task was so simple that it only took a few minutes to build the thing itself. The software was another thing altogether, though. "Wiring up the board only took a few minutes, but writing the software took multiple days," Zalewski said. Lucky for those wanting to duplicate or add to his work, the source code and a pre-compiled binary that'll run on an 8-bit microcontroller are included in his blog post. (R) Updated at 1854 GMT on 3/18/2026 with more information after we spoke to the developer.
External Content
Source RSS or Atom Feed
Feed Location http://www.theregister.co.uk/headlines.atom
Feed Title www.theregister.com - Articles
Feed Link https://www.theregister.com/
Reply 0 comments