Phidget22 JavaScript Library (Network Client)


Official Phidget22 JavaScript library.
This library includes both Node.js and browser support.
Phidgets are accessed over the network via the Phidget Network Server.
A full library is also available, which adds USB support: phidget22
Start by reading the Phidgets JavaScript Language Page.
Resources
* API Reference
* Node.js Code Samples
* Browser Code Samples
Node.js
``bash
npm install phidget22-net
`
ES6 module import:
`javascript
import * as phidget22 from 'phidget22-net';
`
CommonJS import:
`javascript
const phidget22 = require('phidget22-net');
`
Browser
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:
`html
`
ES6 module import:
`html
`
You can also load the library directly from UNPKG:
`html
``
App bundlers such as Webpack are supported with browser-specific files in the npm.
Changelog
$3
* Support for ADP0001_0, ADP0002_0, LED0100_0
$3
* New ChannelPersistence API - Maintains output state when a channel is closed
$3
* Minor fixes and improvements
$3
* Bugfix: Adjusted supported Voltage Sensor Types for some devices
$3
* Bugfix: Reinstated support for DAQ1400_0 v130, which was inadvertently removed in version 3.20.1 (1.19.20240411)
$3
* Support for DCC1020_0 and DCC1120_0
* New APIs for DCMotor, BLDCMotor, MotorVelocityController, and MotorPositionController
$3
* Support for 1024_1 v320 - Added support for EM4305 writable tags
$3
* Support for 1024_1
$3
* Support for LCD1100_1
$3
* Support for ENC1001_0
$3
* Ensure that numbers are sent to the network server in the correct format - Numbers may be rounded to the nearest integer value.
$3
* Support for STC1005_0 v110+
$3
* Support for HUB0002_0, HUB0007_0, HUB0000_1
$3
* Support for HUB0002_0, HUB0007_0, HUB0000_1
$3
* Support 1046_1 and RCC1000_1
$3
* bugfix: network connection could stop being maintained if it fails during the initial handshake
$3
* Fix for HUB0001_0 v114 showing up as 'Unsupported USB Phidget' on release 3.15.1
$3
* AutoSetSpeed support
$3
* bugfix: Corruption of network packets wasn't being handled properly
* bugfix: Connection after authentication callback was being delayed
$3
* Support STC1005_0
$3
* Handle garbled json without crashing
$3
* Fix DAQ1400 FrequencyInput mode
$3
* Force IPv4 hostname resolution as the network server doesn't support IPv6
$3
* Support MOT0100_0
$3
* Support MOT1102_1, TMP1200_1
$3
* Fixes a bug where a server connection can stop auto re-connecting if interrupted near the start of a connection
$3
* 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
$3
* Support 1014_3, 1017_2
$3
* Support MOT0110_0
* Add option to network connect() to retry on initial failure
$3
* Fixes a bug where a network connection reconnect can be cancelled immediately and no further attempts are made
$3
* Fixes a bug in the network connection maintainer to ensure that only one connection request is active at a time
$3
* Removed some superfluous log messages
$3
* 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
$3
* Initial v3 release