Scaling a software application is a well-understood challenge. But scaling a system that bridges physical hardware with cloud infrastructure introduces a unique set of constraints: power stability, network jitter, and the ever-present risk of "offline" operation.
When we built the IoT Attendance System, the goal wasn't just to record "check-ins." It was to create a robust, enterprise-grade appliance that remains reliable even when the world around it isn't.
The Edge: ESP32 Firmware Architecture
At the heart of the device is an ESP32, a powerful dual-core microcontroller with integrated Wi-Fi. However, "integrated Wi-Fi" doesn't mean "always connected."
I designed the firmware with a State-Machine Architecture to handle connectivity gracefully:
- Phase A (AP Mode): If no Wi-Fi is found, the device becomes a Wi-Fi hotspot with a captive portal, allowing users to configure network settings from their phones.
- Phase B (Web Setup): Once connected, a secure local web interface handles device registration and admin credentials.
- Normal Operation: The device switches to a low-power polling mode, monitoring RFID and Biometric (Fingerprint) sensors.
Solving the "Offline" Dilemma
In many parts of the world, internet stability is a luxury. If the cloud is unreachable, the attendance system must still work.
We implemented a Local-First Persistence Model:
- SD Card Logging: Every scan is immediately written to a local
scans.logfile on an SD card with a valid NTP timestamp.
