handshake-capture-c6: production SD gating (SD_IsReady), v1.0.1

- Gate capture on SD_IsReady() after successful SD_Init; avoid false
  'insert SD' when SD.cardType() lies after WiFi on shared SPI with LCD
- SD_Init: LCD CS high, SD.end() on empty card; HandshakeCapture save path
  retries SD_Init before discard
- FAT filename sanitize, discard deadlocks, WPA3 scan labels, docs (README,
  PRODUCTION, IMPROVEMENTS), firmware version 1.0.1

Made-with: Cursor
This commit is contained in:
drjones
2026-03-21 01:12:12 -07:00
parent 4bef28bd83
commit 804e71e175
11 changed files with 512 additions and 153 deletions

View File

@@ -5,7 +5,14 @@
#include "esp_wifi.h"
#include <SD.h>
#define MAX_SLOTS 3
/** Semantic version (Serial banner + support). */
#define HANDSHAKE_FIRMWARE_VERSION "1.0.1"
/** SD write only after this many EAPOL-Key frames (full WPA/WPA2 4-way). */
#define HANDSHAKE_EAPOL_FRAMES 4
// Two APs at once: less on-air contention, more time per target before rotating.
#define MAX_SLOTS 2
#define MAX_NETWORKS 20
#define MAX_CLIENTS_PER_SLOT 8
#define PCAP_MAX_SIZE 4096
@@ -63,7 +70,7 @@ enum CapturePhase : uint8_t {
extern WifiNetwork networks[MAX_NETWORKS];
extern CaptureSlot slots[MAX_SLOTS];
extern volatile int pending_save_slots[MAX_SLOTS];
extern volatile int latest_eapol_count;
extern volatile uint8_t latest_eapol_count[MAX_SLOTS];
extern bool is_capturing;
extern int current_channel;
extern CapturePhase capturePhase;
@@ -78,4 +85,3 @@ void stopCapture();
bool isCaptureable(int index);
void handshakeCaptureLoop();
int getCaptureableCount();
int getBestChannel();