Converting a disposable vape into a web server

2 hours ago 2

People have been recycling batteries in disposable vapes for a while, but BogdanTheGeek has gone a lot of further, converting a specific model of disposable vape into a web server.

How is that possible? Vapes have apparently become a bit more sophicated in recent times, and intergrate Arm Cortex microcontroller with a USB-C port that can be used to bring a network interface and run a web server.

Disposable vape web server

The specific disposable vape (exact model not provided, but Grok thinks it may be from Bang King) used by BogdanTheGeek features one of the ultra cheap Puya PY32 microcontrollers, namely a 24 MHz PY32F002B Cortex-M0+ MCU with 3 kB SRAM and 24 kB flash.

The web server hack is here involves using the SLIP (Serial Line Internet Protocol) through a /dev/tty device to bring up a network interface, along with uIP lightweight TCP/IP stack. The first implementation was really slow with 1.5s pings, plenty of packet losses, and a web page loading in about 20 seconds. That’s because uIP is designed for resource-contrained microcontroller and sends data byte-by-byte by default. Since the PY32F0002B MCU has 3KB SRAM, there was some room to implement ring buffer dramtically improving performance. That means 20ms pings, no packet loss, and a 160ms full page load of a blog post with text and one image.

web hosting PY32 vapeScreenshot of webpage hosted on a disposable vape

You’ll find the source code of the semihost-ip implementation on GitHub, and the actual server can be found on ewaste.fka.wtf, which is currently inaccessible due to to many people accesssing it, but a copy can be found on the Wayback Machine. Vaporware has gotten real!

Via Hackaday

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress. We also use affiliate links in articles to earn commissions if you make a purchase after clicking on those links.

Read Entire Article