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 python3yum install git cmake python3-devel libudev-develgit clone https://github.com/accesio/aiousb-linuxmkdir build
cd build
cmake ..
make
sudo make installACCES attempts to provide source code that will build with as wide a range of Linux kernels as possible. Our officially supported distribution is Ubuntu, and in house development is done on Debian based distros including Ubuntu.
Red Hat will backport changes from newer kernels that break compatibility with
the vanilla Linux kernel. If you get a compiler error in the module directory
and are running a Red Hat based OS, search for LINUX_VERSION_CODE in the source.
Modify the code to choose the other path than what uname -r indicates and
build. Don't hesitate to contact ACCES if you need assistance.
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.