Skip to content

DVSoftware/serialport-binding-webusb-ftdi232

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serialport-binding-webusb-ftdi232

FTDI232 Binding for webusb-serialport.

Note: Even though this binding can be used with the default serialport package, it loads the default bindings which try to initialize Linux bindings, webusb-serialport does not load any binding nor it does autodetect it.

Installation

npm install webusb-serialport serialport-binding-webusb-ftdi232

Usage

const SerialPort = require('webusb-serialport'); // Require WebUSB Serial
const FTDIBinding = require('serialport-binding-webusb-ftdi232'); // Require FTDI Binding

SerialPort.Binding = FTDIBinding; // Set the binding

SerialPort.list() // List the devices (this will trigger the WebUSB device chooser)
    .then((devices) => {
        const serialPort = new SerialPort(devices[0], {
            autoOpen: true,
            baudRate: 115200,
        });

        // Use as a serialport module
        serialPort.write('data');
    });

About

WebUSB Serial Port Binding for FTDI chips

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published