How tworjaga/esp32gotchi works
ESP32Gotchi is autonomous ESP32 firmware for passive Wi-Fi AP monitoring and WPA/WPA2 handshake capture, with PCAP and CSV output to microSD. Its principal workflow receives and queues Wi-Fi frames, parses them for APs and the four EAPOL handshake messages, then writes completed handshakes and periodic logs. GPS can supply location and UTC timestamps; the OLED, LED, and button provide device feedback and controls. The README documents the task layout and optional GPS capability; edges from unsampled firmware setup are limited to those documented relationships.
Main entry points: sdlog.cpp SD writer task · capture.cpp Packet capture · gps.cpp GPS parser and clock · Cheapagotchi.ino Task setup
Components 17
Firmware runtime
- Task setup
Cheapagotchi/Cheapagotchi.ino - Shared state
Cheapagotchi/state.cpp - GPS parser and clock
Cheapagotchi/gps.cpp
Wi-Fi capture
- Packet capture
Cheapagotchi/capture.cpp - Packet queue
Cheapagotchi/capture.cpp - Handshake parser
Cheapagotchi/handshake.cpp - AP registry
Cheapagotchi/ap_table.cpp
Storage outputs
- AP log queue
Cheapagotchi/capture.cpp - SD writer task
Cheapagotchi/sdlog.cpp - Handshake PCAP
Cheapagotchi/pcap.cpp - AP CSV log
Cheapagotchi/sdlog.cpp - Stats CSV log
Cheapagotchi/sdlog.cpp
Device interface
- OLED and controls
Cheapagotchi/ui.cpp
Other components
- Wi-Fi traffic
- microSD card
- GPS receiver
- Device user
Connections 28
- Task setup → Packet capture: starts task
README.md - Task setup → SD writer task: starts task
README.md - Task setup → OLED and controls: starts task
README.md - Task setup → GPS parser and clock: starts task
README.md - Wi-Fi traffic → Packet capture: supplies frames
README.md - Packet capture → Packet queue: queues packets
Cheapagotchi/capture.cpp - Packet queue → Handshake parser: processes packets
Cheapagotchi/capture.cpp - Packet capture → AP registry: records new APs
Cheapagotchi/capture.cpp - Handshake parser → AP registry: records APs
Cheapagotchi/handshake.cpp - Packet capture → AP log queue: queues AP logs
Cheapagotchi/capture.cpp - Handshake parser → SD writer task: queues completed slots
Cheapagotchi/handshake.cpp - AP log queue → SD writer task: drains log queue
Cheapagotchi/sdlog.cpp - SD writer task → Handshake PCAP: writes handshakes
Cheapagotchi/sdlog.cpp - SD writer task → AP CSV log: writes AP entries
Cheapagotchi/sdlog.cpp - SD writer task → Stats CSV log: writes snapshots
Cheapagotchi/sdlog.cpp - Handshake PCAP → microSD card: writes PCAP
Cheapagotchi/pcap.cpp - AP CSV log → microSD card: writes CSV
Cheapagotchi/sdlog.cpp - Stats CSV log → microSD card: writes CSV
Cheapagotchi/sdlog.cpp - GPS receiver → GPS parser and clock: sends NMEA
README.md - Handshake PCAP → GPS parser and clock: gets UTC time
Cheapagotchi/pcap.cpp - AP CSV log → GPS parser and clock: gets timestamp
Cheapagotchi/sdlog.cpp - Stats CSV log → GPS parser and clock: gets timestamp
Cheapagotchi/sdlog.cpp - GPS parser and clock → OLED and controls: provides fix data
README.md - Device user → OLED and controls: presses button
README.md - Shared state → Packet capture: shares runtime state
- Shared state → Handshake parser: shares runtime state
- Shared state → SD writer task: shares runtime state
- Shared state → OLED and controls: supplies display state