Giter Site home page Giter Site logo

webusbserial's Introduction

webusb-serial

This is an partial implementation of WebSerial using WebUSB. You should avoid using this. All browsers that support WebUSB also support WebSerial in their currently shipping version, so there is really no need for for regular use.

What does this library do?

If you have a USB to Serial dongle, this library allows you to access it in a similar way as you would using WebSerial. It contains drivers for the most common chipsets used in these dongles: FTDI, PL2303 and CP2102.

However... on Windows the dongle might be exclusively claimed by the system driver. In that case you cannot use WebUSB to access the device. But luckily WebSerial itself will work!

How to use it?

Load the webusb-serial.umd.js file in the browser and call requestPort on WebUSBSerial. Then use it as you would any other WebSerial port.

<script src='webusb-serial.umd.js></script>

<script>

    const port = await WebUSBSerial.requestPort();

</script>

Or import the webusb-serial.esm.js module:

import WebUSBSerial from 'webusb-serial.esm.js';

const port = await WebUSBSerial.requestPort();

What is implemented?

This is a work in progress and nowhere near complete implementation of the WebSerial API. There will be features missing.

What does not work for sure: signals and events.

What might also not work: everything else.

License

MIT

webusbserial's People

Contributors

nielsleenheer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

strugglingbunny

webusbserial's Issues

Clarify that chrome-android has no plans to support webserial

The following line "All browsers that support WebUSB also support WebSerial in their currently shipping version" is wrong. Due to underlying Android API's WebSerial (and WebHID) are both "impossible to implement".

While I have yet to test if this works, I do know that I can see a Serial Keyboard with WebUSB and I fully intend to test this library in the near future.

I will update this thread with my testing sometime in the next week.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.