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.