OctoPrint icon indicating copy to clipboard operation
OctoPrint copied to clipboard

[Request] Add some kind of auto-refresh of the serial ports list to core OctoPrint

Open foosel opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

In 1.8.0 OctoPrint introduces a warning message if no serial ports are currently detected to connect to (see #4237), because we've seen a ton of issues by users using power-only USB cables or trying to connect to unsupported printers and needing guidance on detecting issues like this instead of having to wait for support on the forums or Discord.

The way this warning was implemented in 1.8.0rc1 and 1.8.0rc2 it also caused the "Connect" button to become disable, to force people to realize, hey, something's amiss here, and actually read the warning instead of ignoring it and attempting to connect and then still seeking support when that fails. However, disabling the connect button causes issues with certain workflows where users have their printers powered off and thus unrecognized on serial, and only power them on right before attempting to connect. The auto connect in that cause would then take care of refreshing the ports list, detect the printer and connect just fine. In 1.8.0rc1 and 2 however this required an additional click on refresh before it worked, which means in 1.8.0rc3 the connect button will be re-enabled in these cases.

However, long term it would be the better solution to disable it again if there really are no serial ports recognized by the system and instead have OctoPrint automatically detect new ports, kinda like the PortLister plugin does today, but natively built into core.

Describe the solution you'd like

OctoPrint being platform agnostic and the PortLister plugin only working on POSIX systems, the same approach like it takes (watchdog & monitoring of all of /dev for file additions) won't work. Instead, either a regular auto-refresh (e.g. 1/s) while no ports are detected should be done, or, probably cleaner, a watchdog on the configured serial port patterns under POSIX and a regular polling approach for Windows.

Describe alternatives you've considered

Renaming the connect button to "Refresh & Connect" if no port is detected, and actually having it run a refresh on click in such cases, but that also felt awkward in case of no change in available serial ports after.

Additional context

No response

foosel avatar Mar 22 '22 11:03 foosel