cart My Cart 0
☰ Menu

Our Blog

Get the latest

Setting Up the Avantes Raspberry Pi SDK

Posted on: July 29th, 2020


Because of its size and low power requirements, the AvaSpec CompactLine (affectionately called the “mini”) is often used with a raspberry pi, Arduino, or other single board computer. This headless operation allows for use in portable and hard-to-reach settings. In this tech note, we’ll discuss in more detail setting up the Avantes Raspberry Pi SDK.

Getting the AvaSpec library

Please download the AvaSpec library DEB installer here  or contact your local sales representative. This installer doesn’t include demo files; so make sure to ask your rep for these!

Setup and Installation

Make sure you have set up your raspberry pi. You can install the library and the required USB drivers with the commands.

sudo dpkg -i libavs_X.X.X.X_armhf.deb
sudo apt-get install libusb-1.0-0-dev

You can check the /usr/local/lib/ directory to confirm the proper files have been installed. (You can read more about shared libraries here.)

By default, a user has no rights to open USB ports on Linux. You can run your python files as the superuser; but a better solution is to add rights to Avantes USB devices.

The  lsusb command will list connected devices.  Run it with the spectrometer unplugged and then plugged in to find the vendor and product IDs.

Navigate to /etc/udev/rules.d and add a file 99-avantes-rule.rules. In this file, add an exception for your spectrometer. I’ve listed the three possible options here:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1992", ATTRS{idProduct}=="0667", MODE="0666" 
SUBSYSTEM=="usb", ATTRS{idVendor}=="1992", ATTRS{idProduct}=="0668", MODE="0666" 
SUBSYSTEM=="usb", ATTRS{idVendor}=="1992", ATTRS{idProduct}=="0669", MODE="0666"

Finally, you can run your test script!

Get help with Custom Project Development

To learn more about developing your custom spectroscopy application or to get support with your development, contact Avantes today.

  • This field is for validation purposes and should be left unchanged.