Реклама партнера — Название партнёра
UNIT.City — місце, де люди працюють... КРАЩЕ! Обирай свій простір просто зараз 👉

Engineer turns disposable vape into 24KB web server that loads pages in 160ms

Romanian engineer Bogdan Ionescu has been collecting discarded vapes for years to use their batteries, but when he noticed that the “trendier” models had more advanced microcontrollers, he decided to experiment.

Leave a comment
Engineer turns disposable vape into 24KB web server that loads pages in 160ms

Romanian engineer Bogdan Ionescu has been collecting discarded vapes for years to use their batteries, but when he noticed that the “trendier” models had more advanced microcontrollers, he decided to experiment.

In one of these vapes, Ionescu found a PUYA C642F15 chip. After research, he found out that it was actually a PY32F002B, which runs on an Arm Cortex M0+ processor (24 MHz). The chip also had 24 KB of flash memory and 3 KB of RAM, Interesting Engineering writes .

The engineer called this basic kit “so bad it could just be thrown away.” But even in it, he saw potential.

Ionescu decided to use a chip that supported the old SLIP protocol. This turned the device into a very simple analogue of a 56K modem. He then added the uIP 0.9 code, which allowed the vape to act as a web server and transmit data over TCP/IP.

The results were initially disappointing. “The ping time was about 1.5 seconds, and half of the data packets weren’t even delivered. A simple page took over 20 seconds to load. It was so bad it was laughable, and I thought about quitting,” Ionescu said.

But then the engineer realized that the problem was in his code. By adding a special buffer, he significantly accelerated data transfer. Further adjustments reduced the ping time to 20 ms without packet loss, and the full page started loading in about 160 ms.

He uploaded his blog post about this experiment to the server. The text barely fit into the available 20 KB of flash memory.

Visitors could access the page, which ran on a tiny vape server, but the server often failed due to the high number of requests. When many people accessed it at the same time, a “503” error would appear.

Canadian developer turns MacBook Pro into scales using touchpad
Canadian developer turns MacBook Pro into scales using touchpad
On the topic
Canadian developer turns MacBook Pro into scales using touchpad
Tech enthusiast turns Nokia Lumia 1020 into iPhone SE, keeping almost all of iPhone's internal components
A tech enthusiast turned a Nokia Lumia 1020 into an iPhone SE, retaining almost all of the iPhone's internal components
On the topic
A tech enthusiast turned a Nokia Lumia 1020 into an iPhone SE, retaining almost all of the iPhone's internal components
Read the country's main IT news in our Telegram
Read the country's main IT news in our Telegram
On the topic
Read the country's main IT news in our Telegram

Have important news to share? Message our Telegram bot

Key events and useful links in our Telegram channel

Discussion
No comments yet.