aiousb is the Linux implementation of the ACCES I/O USB API as a linux kernel module and library.
apt install git cmake build-essential libudev-dev python3
yum install git cmake python3-devel libudev-devel
git clone https://github.com/accesio/aiousb-linux
mkdir build
cd build
cmake ..
make
sudo make install
By default the device file requires root permissions to access. To change the default permissions for the device pass dev_mode
to the module as a parameter. The mode can be passed in octal similar to chmod
command
- To set using insmod
insmod accesio_usb.ko dev_mode=0666
- To set for boot
- Create a file /etc/modprobe.d/accesio-usb.conf
options accesio_usb dev_mode=0666
To use the library include aiousb.h in your program. The first call into the library must be AiousbInit()
. All of the functions are documented in the ACCES I/O USB API
The source code in the samples directory is intended as a guide. The source code in the test directory is not intended for general use.
It is possible to build the library without hotplug support by defining NO_HOTPLUG in the cmake command. This was done to address a known Python issue
cmake -DNO_HOTPLUG=y ..
When the library is built without hotplug support the behavior of calls to AiousbInit() after the first one will simulate a hotplug by checking for removed devices and then scanning for new ones. When the library is built with hotplug enabled (the default) then subsequent calls to AiousbInit() will return -EALREADY.
Python support is limited, and in order to use it the cmake command must include -DNO_HOTPLUG when building the project. For more information on using the library in this mode see here.
Attempting to use the library in Python when hotplug support is enabled result in a failure when attempting to load the library. The ctypes.CDLL('./libaiousb.so')
call will cause the program to crash.