diff --git a/cmd/benchpod-cli/commands_serial.go b/cmd/benchpod-cli/commands_serial.go index b61ba74..e6851c8 100644 --- a/cmd/benchpod-cli/commands_serial.go +++ b/cmd/benchpod-cli/commands_serial.go @@ -196,6 +196,10 @@ func newShowNetworkCmd(g *globalFlags) *cobra.Command { // ── clear-wifi ─────────────────────────────────────────────────────────────── +// clearWifiTimeout covers the C3 NVS erase that wifi-clear runs before it answers. 10 s was too +// short: the CLI gave up on pods that were still erasing (2026-10-15). +const clearWifiTimeout = 60 * time.Second + func newClearWifiCmd(g *globalFlags) *cobra.Command { return &cobra.Command{ Use: "clear-wifi", @@ -206,7 +210,9 @@ func newClearWifiCmd(g *globalFlags) *cobra.Command { if err != nil { return err } - console, _, ctx, cancel, err := g.openSerialConsole(device, g.effectiveTimeout(10*time.Second)) + // The pod answers once it has also erased the ESP32-C3's NVS over the C3's ROM + // loader: about 3 s, and up to half a minute when the C3 is slow to answer. + console, _, ctx, cancel, err := g.openSerialConsole(device, g.effectiveTimeout(clearWifiTimeout)) if err != nil { return err } diff --git a/internal/serialconsole/wifi.go b/internal/serialconsole/wifi.go index e60d664..af4f131 100644 --- a/internal/serialconsole/wifi.go +++ b/internal/serialconsole/wifi.go @@ -167,7 +167,8 @@ func lastFieldValue(s, label string) (string, bool) { } // WifiClear erases the stored credentials and takes Wi-Fi down. Firmware after 3.7.0 also erases -// the ESP32-C3's own copy, which takes a few seconds. +// the ESP32-C3's own copy before it answers, which takes a few seconds and up to about 30 s when +// the C3's ROM loader is slow to answer: give ctx a deadline well past that. func (c *Console) WifiClear(ctx context.Context) error { _, err := c.sendCommand(ctx, "wifi-clear") return err