The following shows a typical run through installing and setting things up on Linux.

Install libusb and libudev

Run the following to install required libraries:

sudo apt-get install libusb-1.0 libudev-dev

and answer Y to the prompt. This should install libusb and libudev.

Setup udev rules

Use a text editor to create and edit the file /etc/udev/rules.d/99-mcp2221.rules and add the following contents.

SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTR{idProduct}=="00dd", MODE="0666"

Here we use nano, so run:

like this:

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.

Install hidapi

To install hidapi, run:

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.

Install Blinka

To install Blinka and its dependencies, run:

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
Don't forget this step. Things won't work unless BLINKA_MCP2221 is set.

Run the sanity check.

Now move on to the Post Install Checks section and run the commands there to make sure everything is installed correctly.

This guide was first published on Dec 22, 2019. It was last updated on Dec 22, 2019.

This page (Linux) was last updated on Jun 23, 2022.

Text editor powered by tinymce.