Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If serial port is already open (another tab/software) then tab still pretends to connect / be connected #165

Open
3 tasks done
tyeth opened this issue Nov 30, 2024 · 0 comments

Comments

@tyeth
Copy link

tyeth commented Nov 30, 2024

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

I expect the connect routine to fail, as it does in some respects, and then the connected buttons to go back to the disconnected state.

Actual behavior (suspected bug)

Instead the connected buttons appear, and disconnect doesn't function because the port is not connected

Error logs or terminal output

esptool.js
Serial port WebSerial VendorID 0x1a86 ProductID 0x55d4
Connecting...Error: Failed to execute 'open' on 'SerialPort': Failed to open serial port.

Steps to reproduce the behavior

open one tab, connect device.
open second tab, attempt to connect device.
notice disconnect button is now available but there was a connection error in the terminal and connected device says null.
notice disconnect doesn't function, so another port cannot be chosen nor the page used without refreshing
image

Project release version

latest

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows

Operating system version

11

Shell

other (details in Additional context)

Additional context

Saw this when testing something for @brianignacio5, but didn't know the recreation steps. Just seen it and the issue was clear.

Clicking disconnect gives this error:
image
Browser console:

index.ts:107 NetworkError: Failed to execute 'open' on 'SerialPort': Failed to open serial port.

index.ts:111 Settings done for :null
webserial.js:379 Uncaught (in promise) InvalidStateError: Failed to execute 'close' on 'SerialPort': The port is already closed.
    at $4616b1a2f9a5b082$export$86495b081fef8e52.disconnect (webserial.js:379:27)
    at async $382e02c9bbd5d50b$var$disconnectButton.onclick (index.ts:219:18)

@tyeth tyeth changed the title If serial port is already open (another tab/software) then tab still pretends to be connected If serial port is already open (another tab/software) then tab still pretends to connect / be connected Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant