Official Phidget22 JavaScript library.
This library includes both Node.js and browser support.
Phidgets are accessed over the network via the Phidget Network Server.
Newer Phidgets can also be opened directly over USB, allowing for no-install access within the Browser or Node.js.
A smaller network only library is also available: phidget22-net
Start by reading the Phidgets JavaScript Language Page.
USB Access in Node.js requires installation of the optional usb dependency.
USB Access in the Browser requires a browser that supports WebUSB
npm install phidget22
ES6 module import:
import * as phidget22 from 'phidget22';
CommonJS import:
const phidget22 = require('phidget22');
Download the latest release here.
The release contains full, net, and usb versions of the library, in both UMD and ES module format.
UMD import:
<script src="phidget22.min.js"></script>
ES6 module import:
<script type="module">
import * as phidget22 from './phidget22.esm.js';
</script>
You can also load the library directly from UNPKG:
<script src="https://unpkg.com/phidget22@^3.10/browser/phidget22.min.js"></script>
App bundlers such as Webpack are supported with browser-specific files in the npm.
- Support for 1024_1
- Support for LCD1100_1
- Support for ENC1001_0
- Ensure that numbers are sent to the network server in the correct format - Numbers may be rounded to the nearest integer value.
- Support for STC1005_0 v110+
- Support for HUB0002_0, HUB0007_0, HUB0000_1
- Support for HUB0002_0, HUB0007_0, HUB0000_1
- Support 1046_1 and RCC1000_1
- bugfix: network connection could stop being maintained if it fails during the initial handshake
- Fix for HUB0001_0 v114 showing up as 'Unsupported USB Phidget' on release 3.15.1
- AutoSetSpeed support
- bugfix: VINT device packets could get corrupted
- bugfix: detaching a VINT device could cause a USB hub to be closed, even if other channels are still being used
- bugfix: Quaternion from VINT MOT0110 was corrupted
- bugfix: Corruption of network packets wasn't being handled properly
- bugfix: Connection after authentication callback was being delayed
- Support STC1005_0
- Handle garbled json without crashing
- Fix DAQ1400 FrequencyInput mode
- Force IPv4 hostname resolution as the network server doesn't support IPv6
- Support MOT0100_0
- Support MOT1102_1, TMP1200_1
- Fixes a bug where a server connection can stop auto re-connecting if interrupted near the start of a connection
- Fixes a bug where a channel can become stuck while opening over an unstable network connection
- Improved logging in Node
- Error events are rate limited to 1/second
- Support 1014_3, 1017_2
- Support 1048_1, 1048_2 on USBConnection
- Support MOT0110_0
- Add option to network connect() to retry on initial failure
- Fixes a bug where a network connection reconnect can be cancelled immediately and no further attempts are made
- Fixes a bug in the network connection maintainer to ensure that only one connection request is active at a time
- Removed some superfluous log messages
- Node.js USB bugfixes
- Fix issue where a channel could end up with 2 simultaneous open requests internally
- Add client-side keepalives to network connection
- Initial v3 release