Adafruit PlatformDetect is a Python library designed for best-guess platform detection across a wide range of single-board computers (SBCs) and other platforms. It primarily serves as a core dependency for Adafruit-Blinka, enabling CircuitPython API emulation on CPython. The library maintains an active development cycle with frequent releases to add support for new boards and chips.
pip install adafruit-platformdetectVerified import paths — ran on the pinned version, not inferred.
This quickstart code demonstrates how to initialize the `Detector` and retrieve the detected chip and board IDs. It also includes examples of checking for specific popular board models.
Be aware of these environment variables if detection results are unexpected. Unset them if not intentionally used, or consult `adafruit_platformdetect/chip.py` and `adafruit_platformdetect/board.py` for their effects.
Always ensure you have the latest version installed: `pip install --upgrade adafruit-platformdetect adafruit-blinka`.
Always install either for the current user (`pip install adafruit-platformdetect`) or within an activated virtual environment. Avoid `sudo pip install` unless absolutely necessary for system-wide installations and understand the implications.
Upgrade to the latest version of adafruit-platformdetect and adafruit-blinka: `pip install --upgrade adafruit-platformdetect adafruit-blinka`. If the problem persists, open a 'New Board Request' issue on the Adafruit Blinka GitHub repository.
Ensure the library is installed in your active Python environment: `pip install adafruit-platformdetect`. If using a virtual environment, make sure it is activated before installation and execution. If installed system-wide with `sudo`, ensure you run your script with `sudo` as well (though generally discouraged).
If you are not using an FT232H, unset the `BLINKA_FT232H` environment variable. If you intend to use an FT232H, ensure it is properly connected and that `pyftdi` is installed (`pip install pyftdi`).