Engineer creates ‘blazingly fast’ web server powered by a disposable vape — 'VapeServer' powered by 24 MHz Arm chip with 24 kilobytes of flash, 3KB of SRAM
These throwaway items contain too many electronic goodies to be left unplundered.

Engineer and origami artist Bogdan Ionescu, AKA BogdanTheGeek, has created a web server that runs on a disposable vape. Inspired by his growing collection of these disposables, and prior work he had done on semihosting on any Arm CPU using “a few lines of code,” Bogdan had a lightbulb moment and decided to host “a web server on a vape,” thus creating the VapeServer.
Disposable vapes can contain a surprising amount of computing power/components. Bogdan had been collecting discarded units for ‘future projects’ for a couple of years, with eyes on reusing the batteries. However, he recently became aware of “fancier” units that pack more advanced ICs and microcontrollers. They didn’t just contain PCBs with unknown ‘blob chips.’ He found some with more advanced microcontrollers.
Bogdan says one of the fancier units he disassembled contained an IC marked ‘PUYA C642F15.’ This sparked some research, and the engineer determined that this was actually a PY32F002B, which has the following specs:
- 24 MHz Arm Cortex M0+ processor
- 24KB of Flash Storage
- 3KB of Static RAM
- a few peripheral interfaces
Those are not stellar specs, and perhaps “about 100x slower” than a 10-year-old mobile, by our hero’s estimation. For web serving, though, Bogdan thought the PY32F002B-powered ex-vape with USB-C port could be leveraged to make a “blazingly fast” device.
The method, in brief, would see Bogdan emulate a dial-up modem on the microcontroller using SLIP (Serial Line Internet Protocol) over the USB serial connection. Linux ‘slattach’ and ‘socat’ utilities enabled IP packet transmission, and then the microcontroller leveraged the compact uIP stack to communicate via TCP/IP and set up a web server. The web page, a copy of the linked blog post, just about fit in the remaining 20KB of flash on the PY32F002B.
Cutting page load times from 20s to 160ms
Optimization to get a usably performant web server presented several challenges. Bogdan says he almost gave up after the first tests, with the vape-powered performance being laughably bad. Pings were ~1.5s, and a simple page load took 20 seconds.
However, he humbly admits the big issue was his code. So the engineer added a buffer and batched writes to improve throughput, and with a few more tweaks managed to get pings down to 20ms with no packet loss, and full-page loading in about 160ms. Not bad.
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
The source link from Bogdan’s blog we shared isn’t hosted on this vape-powered web server. However, if you are really curious, you can try this link to get the post served from the VapeServer. We say ‘try’ because the vape-hosted page is currently throwing up a ‘503’ error, probably due to being overloaded by visitors.
Bogdan has also shared the semihost-ip project code for the VapeServer on GitHub.
Follow Tom's Hardware on Google News, or add us as a preferred source, to get our up-to-date news, analysis, and reviews in your feeds. Make sure to click the Follow button!

Mark Tyson is a news editor at Tom's Hardware. He enjoys covering the full breadth of PC tech; from business and semiconductor design to products approaching the edge of reason.
-
Alvar "Miles" Udell Still way more power than the Apollo capsules had, and even more recent space probes and satellites.Reply
I know there comes a time when it's more expensive to produce anything weaker for a disposable item than a chip that's very mass produced in fabs for a variety of tasks (wouldn't be surprised to find this chip in IoT devices, digital signage, and other things), but it is amazing what's tossed these days because of the cost or difficulty to repurpose. -
gg83 Aamazing! I love this kinda stuff! Future civilizations will only need to mine our landfills. By the time we fail, most of the precious metals will be dug up.Reply -
bit_user So, what do vapes use those microcontrollers for? I presume the USB-C port is for charging. So, maybe the point of the controller is just battery management?Reply -
bit_user
They also didn't have internet, back then. Even a protocol like TCP takes some actual compute power to implement.Alvar Miles Udell said:Still way more power than the Apollo capsules had,
I seem to remember an article around 10+ years ago, where someone worked out a scheme to harness "parasitic computation" of a bunch of networked machines, by using (I think) that CRC computation as a low-level computational building block.
As for memory, Wikipedia claims Apollo Guidance Computer had:
15-bit wordlength + 1-bit parity
2048 words RAM (magnetic-core memory)
36,864 words ROM (core rope memory)
So, that works out to 3.75 kiB of RAM, which is 25% more than this vape computer has. The storage is 67.5 kiB, which is 2.8x as much as this vape computer.
(edit: thanks to @Jessica_J for the corrections! : ) )
Where the vape computer really pulls ahead is in compute performance. Wikipedia claims the M0+ is 32-bit, with a 2-stage pipeline and a hardware multiplier. In comparison, the Apollo Compute Module was 15-bit, only ran at 2 MHz, and almost certainly took many cycles per instruction.
Another big differential is size. The Apollo Compute Module weighed 32 kg and occupied 57 liters. -
Jessica_J bit_user said:They also didn't have internet, back then. Even a protocol like TCP takes some actual compute power to implement.
I seem to remember an article around 10+ years ago, where someone worked out a scheme to harness "parasitic computation" of a bunch of networked machines, by using (I think) that CRC computation as a low-level computational building block.
As for memory, Wikipedia claims Apollo Guidance Computer had:
15-bit wordlength + 1-bit parity
2048 words RAM (magnetic-core memory)
36,864 words ROM (core rope memory)
So, that works out to 30 kiB of RAM, which is 10x what this vape computer has. The storage is 540 kiB, which is 22.5x as much as this vape computer.
Your math is off, methinks:
15-bit wordlength \00d7 2 048 words = 30 720 bits = 3 840 bytes = 3.75 KiB
15-bit wordlength \00d7 36 864 words = 552 960 bits = 69 120 bytes = 67.5 KiB
So about 25% more RAM, and about 2.8x the storage. Of course speed, storage density (whether in terms of mass or volume) and cost... 😱 -
bit_user
You're right. I must've been more sleepy than I thought. I divided by 1024 to convert to ki, but forgot to do the divide-by-8 to go back to bytes.Jessica_J said:Your math is off, methinks:
15-bit wordlength \00d7 2 048 words = 30 720 bits = 3 840 bytes = 3.75 KiB
Thanks for the corrections!
: ) -
bit_user BTW, I was thinking about this, and it seemed to me like a cool project if someone would recreate the Apollo Guidance Computer in a FPGA. Not surprisingly, there's at least one such example!Reply
https://github.com/rzinkstok/fpga_agc -
bit_user
Well, just to be clear, I'm sure they're talking about a direct-connection (i.e. IP over serial over USB). In an equivalent setup, a modern PC would deliver a ping time on the order of 0.1 ms or less.Exploding PSU said:20ms ping is still way better than my actual internet connection..
Impressive! -
CptPlanet Bruhhh, just the thing i was looking for! I've (sadly) collected BAGs of them over the years thinking to myself that I'd rather repurpose the batts then just recycle them. Starting with the 1-hitters, goin all the way up to the rechargeable usb-c's, my lab cabinets are stuffed with them. Hell, some of them even have flex led screen gimmicks on em for some raisin? Welp, seein this just filled me with righteous motivation to make it happen. Seems a lot more fun than continuing to string together the world's longest battery cell anyway.Reply