Skip to main content

ctypes bindings for hidapi

Project description

# pyhidapi Installation
To install pyhidapi, use the standard module install procedure: `python setup.py install`. You also need to ensure that you have the required hidapi shared library. On Linux distributions, this is generally in the repositories (for instance, under Debian you can install either libhidapi-hidraw0 or libhidapi-libusb0 depending on which backend you want to use).

**TODO** I don't know the installation procedure for Windows or other Linux distributions. If there is anything special needed, please add docs for it here.

# OSX Support
pyhidapi works on OSX, but requires that you first build a shared library. There may be better ways to do this, but what I did was as follows:

1. Download the latest hidapi release from https://github.com/signal11/hidapi/downloads and unzip
2. Navigate to the mac directory
3. Modify the Makefile to include -fPIC on the CFLAGS line. My CFLAGS now look like this: `CFLAGS+=-I../hidapi -Wall -g -c -fPIC`
4. Run `make`. You should now have a hid.o file in this directory.
5. Create the shared library by running: `gcc -shared -o libhidapi-iohidmanager.so hid.o -framework IOKit -framework CoreFoundation`
6. Copy the resulting libhidapi-iohidmanager.so to /usr/local/lib (or somewhere in the libs search path)
7. Install pyhidapi as normal: `python setup.py install`
8. Verify by running python interactively and typing the following lines:
```
import hid
hid.enumerate()
```
You should see a list of all USB hid devices on your system.

That's it!


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hid-1.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hid-1.0.2-py2-none-any.whl (3.7 kB view details)

Uploaded Python 2

File details

Details for the file hid-1.0.2.tar.gz.

File metadata

  • Download URL: hid-1.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for hid-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9f22ceb50eba4187f1032affbef520bb22dfd1d96666a412f531613ff42b277e
MD5 d5e26c507cc17ccbe69a5db1840f9239
BLAKE2b-256 ed9ab9de414d6255a5058ef692b1480ab67310392fd1bff8c70ef35c9b3c5a32

See more details on using hashes here.

File details

Details for the file hid-1.0.2-py2-none-any.whl.

File metadata

  • Download URL: hid-1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for hid-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 e014a1a7b13472be2f1e6087508e0dcfb7ced886a73140b6d610eb262ad841a9
MD5 abe8b60c1751e248ffe36f5279ae2c1c
BLAKE2b-256 1bb9f582c77c1953c78fb1abadc5f68b907b63787113550dcfb3db063c8d9adc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page