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 sophisticated in recent times, and some integrate an Arm Cortex microcontroller with a USB-C port that can be used to bring a network interface and run a web server.
The specific disposable vape (exact model not provided, but Grok thinks it may be from Bang King. Update: Wrong!) 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 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-constrained microcontrollers and sends data byte-by-byte by default. Since the PY32F0002B MCU has 3KB SRAM, there was some room to implement a ring buffer, which dramatically improved performance. That means 20ms pings, no packet loss, and a 160ms full page load of a minimal web page.

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 many people accessing it, but a copy can be found on the Wayback Machine. Vaporware has gotten real!
Via Hackaday

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
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.




