Skip to content

restart-esp-usb reports success for a device that came back in an error state #34

Description

@bdbarnett

After a restart the script looks the device up again and logs what it found, then exits 0 whatever that was. The installed log from 2026-09-21 has the case:

pnputil /restart-device ok: ... Device restarted successfully.
back as "USB Composite Device" status=Error
--- restart-esp-usb done ---

LastTaskResult was 0 and the board had no COM port. That run was the old script against a node it had itself left disabled, and #33 now enables a disabled node first, so this exact path is closed. The shape is still there for any other reason a node comes back not OK: the caller reads 0 and believes the board is reachable.

What it should do: when the same instance id is present after the restart and its status is not OK, log the Problem code and exit with a code of its own (6 is free), and have mpftp usb-restart say so. A node that is gone afterwards stays a success, because that is a board re-enumerating in download mode.

The test doubles in cli/tests/esp_usb_doubles.ps1 can play this: a scenario where the node reads Error after /restart-device.

It waits because changing the installed script costs the owner another elevated install, and nothing depends on it today.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    housekeepingThe 2026-09-22 sweep: workable from a desk, a build, or a board here

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions