Phidget22 is the official Python library for working with Phidgets in Python applications. It provides lightweight bindings to the native phidget22 library. The current version is 1.25.20260408, and the library is actively maintained with frequent updates, often multiple times per year, bundling native libraries for major operating systems.
pip install phidget22Verified import paths — ran on the pinned version, not inferred.
This quickstart initializes a `TemperatureSensor` object, registers event handlers for attachment, detachment, and temperature changes, and then waits for a sensor to be connected. It prints temperature readings to the console as they occur. The program includes basic error handling and a clean shutdown.
Review the 'Upgrading Code from Phidget21 to Phidget22' guide in the official Phidgets documentation and rewrite affected parts of your application, focusing on the new modular object model and event-driven programming. Ensure you are importing from `Phidget22` and not `Phidgets`.
Install the necessary macOS libraries or the Standalone Control Panel from the Phidgets website. Check your Phidget's product page specifications to determine its USB stack.
Double-check that the addressing parameters match your physical Phidget device and its connection. If unsure, try omitting parameters with `openWaitForAttachment()` to allow the library to find any available device of the specified class.
Ensure that your Phidgets and any connected VINT Hubs have the appropriate external power supply connected and functioning.
Add `NetworkServer.exe` (typically in `C:\Program Files\Phidgets\Phidget22\`) to your Windows Defender Firewall exceptions, or configure your firewall to allow connections for the Phidget Network Server.
Ensure `phidget22` is installed in your environment (`pip install phidget22`). Verify your import statements use `from Phidget22...` and not `from Phidgets...`. If using a virtual environment, ensure it's activated.
Verify the Phidget is physically connected, powered on (if needed), and not already in use by another application (e.g., the Phidget Control Panel). Double-check any `DeviceSerialNumber`, `Channel`, or `HubPort` parameters you've set, or increase the `openWaitForAttachment()` timeout.
Close any other programs or instances that might be using the Phidget, including the Phidget Control Panel. If you suspect a background process, check your operating system's task/activity monitor.
Ensure the device is firmly connected and powered. Use `openWaitForAttachment()` with a sufficient timeout before attempting to read from or write to the device. Implement `onAttachHandler` and `onDetachHandler` to manage the device's state.