-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to terminate a connection? #31
Comments
I believe WebSerial connections are managed by your browser, so you can't manually close those. What are you trying to accomplish? |
Currently, I'm trying to bring your software into an Angular project. Here I would like to allow (via a button) to turn on/off the "loupedeck interface". So it would be nice to open/close the connection. BTW: I also discovered an issue with the serial connection. Everything works fine in the original Google Chrome. But not for any other browsers, like Brave (Chromium) or Firefox:
here 'OTHER BROWSERS' fail with errors. You can test it easily by yourself if you try to start the 'simple' demo, e.g. in the Brave browser. |
Generally only Chromium and its derivatives support webserial https://caniuse.com/web-serial And while brave is chromium based, it explicitly disables webserial https://github.com/brave/brave-browser/wiki/Deviations-from-Chromium-(features-we-disable-or-remove)#what-chromium-features-are-removed-for-privacysecurity-reasons |
yes, I know this. But from what I understood you have build in a fallback, didn't you? And this fallback doesn't work. I found that you used
Here it is not possible to extend |
hmm.. that fallback to me looks like that it is the nodejs mode, not for other browsers |
True, but wouldn't it be a good idea/possible/better :-) to make the code more general to make it working in nodejs but also for browsers? |
thanks @Julusian @elementalPRESS I think there's a misunderstanding. Unlike a general purpose programming environment (I.E. NodeJS), browsers are generally sandboxed execution environments that only allow access to low-level protocols that they create/enable API's for. This means that it is not possible to access serial ports in browsers that do not support or implement WebSerial, and there is no way to get around that. |
However, getting back on topic - I do think that Reading this issue about closing a WebSerial connection makes me think we might need to release a lock somewhere before closing the connection. I will look into it. Thanks for reporting! |
Well, I guess it is possible using the polyfill versions of 'stream' and 'serial'.
I was already able to include it, but stopped because I had to change your package to a |
Hi,
today I tried to programatically close the connection to the Loupedeck CT. So I used:
Unfortunately this results in:
Do you have any idea or fix for that?
Thx and cheers,
Lars
The text was updated successfully, but these errors were encountered: