Comments (2)
As I explained in my response to the Chromium issue you filed, from my research the serial port drivers included with most operating systems automatically assert the DTR signal when the port is opened by an application and release it when the port is closed. The behavior of this polyfill library, since it attempts to duplicate what both the browser and operating system do, is to do the same. However unlike in Chromium, since this library is taking over the role of the USB device driver, it can choose to work differently.
This needs to be done carefully to avoid deviating too much from the interface specified by the Web Serial API. The best option seems to be to extend the SerialPolyfillOptions dictionary that is passed to requestPort() to include an option for controlling this behavior.
Edited to add: My recollection is that some sketches will not start executing until the DTR signal is asserted and it is possible that the Arduino serial API itself won't start sending data until the connected system asserts that it is ready (which is what DTR means). As I recommended in the Chromium issue, based on similar questions asked on the Arduino forums, I think the best workaround for this behavior is to use one of the other UARTs available on the Arduino instead of the one used for programming which has the DTR-reset behavior.
from web-serial-polyfill.
Yes you are right, after digging into this some more and writing some native programs for Windows and Debian I found out that I can only make this work after the arduino's port was opened at least once (resetting on first open) without unplugging which defeats the hole point. So scrap, but it was worth a try. Knowing that it just behaves this way is not necessarily a bad thing after all. Thank you for the inisghts and these great projects you are working on (serial>blink and polyfill) 😎. I think the possibilites of this combined with pwa are really great.
from web-serial-polyfill.
Related Issues (20)
- No compiled file published to npm in 1.0.7 HOT 8
- Unable to find interface with class 2
- Implement support for Prolific virtual COM port over WebUSB HOT 6
- Implement support for CDC composite gadget HOT 3
- Nothing happens after clicking RequestInfo HOT 2
- serial api(polyfill) show "access Denied" in windows and android chrome. HOT 5
- web-serial-polyfill and web-serial desktop and Android HOT 4
- Feature Request: Seamless Javascript integration between web-serial-polyfill and webSerial HOT 1
- Create a readable byte stream
- TypeError: serial.SerialPort is not a constructor
- Android: usb.getDevices() succeeds but serial.getDevices() fails HOT 3
- WebSerial update? HOT 5
- Static web serial Polyfill NPM example please. HOT 8
- Feature request: Design a webpage that informs if webSerial or polyfill works on the device. HOT 2
- Which phones support Android Polyfill? HOT 14
- Add support for bluetooth serial devices HOT 4
- Vanilla javascript example HOT 16
- NetworkError: Failed to execute 'transferIn' on 'USBDevice': A transfer error has occurred. HOT 3
- NetworkError: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-serial-polyfill.