What I Personally Built
I engineered this system to eliminate attendance roll-call friction in lecture halls where mobile cell reception is weak or university Wi-Fi is unavailable:
- Autonomous SoftAP & Captive DNS Hijacking: Configured the ESP32 internal radio to broadcast an open network and initialized a local DNS server intercepting all incoming domain lookups (RFC 1035), directing every phone to the ESP32 local IP `192.168.4.1`.
- Embedded HTML/CSS Micro-Server: Handcrafted an ultra-lightweight (under 4KB total footprint) mobile-friendly attendance form served straight from the ESP32 microcontroller flash memory, responding within 25 milliseconds.
- SPI Hardware Bus & SD-Card Driver: Wired and programmed the SPI communication lines with a micro-SD card breakout board. Formatted the card with a standard FAT32 filesystem so instructors can plug the card into any computer and open the spreadsheet in Excel.
- Anti-Cheating & Duplicate Prevention: Designed an in-memory hash table tracking client MAC addresses and student IDs, rejecting multiple check-in attempts from the same device for different students.
Engineering Challenges & Solutions
Writing to an SD card over SPI takes 50–200 ms depending on flash block allocation. When 20 students submit the form at the exact same second, synchronous writes cause HTTP request timeouts and client connection drops.
Solution: Created a FreeRTOS circular memory buffer. Incoming submissions are instantly acknowledged to the student's browser and queued in internal RAM, while a dedicated background write task flushes the records to the SD card sequentially.
Different mobile OSes (iOS, Android, Windows) use different probe domains to detect captive portals (e.g., `captive.apple.com`, `connectivitycheck.gstatic.com`).
Solution: Programmed the local web server to catch all probe paths and return HTTP 302 redirects to `/index.html`, ensuring the native check-in sheet opens automatically across all phone models without manual browser URL entry.