The following shows a typical run through installing and setting things up on Linux.
sudo apt-get install libusb-1.0 libudev-dev
and answer Y to the prompt. This should install libusb and libudev.
Setup udev rules
A udev rule is needed to adjust the permissions to allow non-root access to the MCP2221. This is just a text file. Use a text editor to create and edit the file /etc/udev/rules.d/99-mcp2221.rules and add the following contents.
The specific udev rule syntax that works may vary with linux distribution. This is the original udev rule that worked at the time this guide was first written:
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTR{idProduct}=="00dd", MODE="0666"
If the Post Install Checks fail with a "open failed" message for the MCP2221, then try changing to this udev rule:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", GROUP="plugdev", MODE="0666"
The following screen shots show an example of creating the udev rule file using nano. Replace the actual udev rule text as needed (see above).
and add the contents from above:
and then press CTRL-X and Y to save and exit.
The settings will take effect the next time you plug in the MCP2221.
pip3 install hidapi
Remove Native MCP2221 Driver
Starting with Linux Kernel 5.7, a native MCP2221 driver (hid_mcp2221) is included with the installation. This will interfere with the HID generic driver (hid_generic) used by Blinka. The native driver can be temporarily removed (disabled) with:
sudo rmmod hid_mcp2221
To prevent the driver from loading again at boot or when reinserting the MCP2221, update the kernel module blacklist configuration. Add this line to /etc/modprobe.d/blacklist.conf
blacklist hid_mcp2221
Then run the following command to also update the configuration in initramfs (details):
sudo update-initramfs -u
Reboot the system.
pip3 install adafruit-blinka
Set environment variable
We need to manually signal to Blinka that we have a MCP2221 attached. To do this, we set the environment variable BLINKA_MCP2221. The value doesn't matter, just use 1:
export BLINKA_MCP2221=1
Page last edited January 15, 2025
Text editor powered by tinymce.