Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/benchpod-cli/commands_serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion internal/serialconsole/wifi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading