Hasty Briefsbeta

Hosting a WebSite on a Disposable Vape

5 hours ago
  • #DIY
  • #web-server
  • #embedded
  • Author collects disposable vapes, initially for batteries, but now for their advanced features like USB C and rechargeable batteries.
  • Discovered a PUYA chip in a vape, which is an ARM Cortex-M0+ microcontroller, leading to the idea of hosting a web server on it.
  • The microcontroller has modest specs: 24MHz CPU, 24KiB Flash, 3KiB RAM, but deemed sufficient for a web server.
  • Used semihosting and SLIP (Serial Line Internet Protocol) to enable internet connectivity via a virtual tty and pyOCD.
  • Implemented a web server using uIP, a lightweight IP stack, with modifications for ARM alignment issues.
  • Initial performance was poor (~20s page load), but optimizations like batch reads/writes improved it significantly (~160ms page load).
  • The project uses most of the available RAM and flash, demonstrating the feasibility of hosting a website on a disposable vape's microcontroller.
  • Added a JSON API endpoint for fun, showing request counts and the microcontroller's unique ID.