Setup udev rules for Airspy

If you are connected the Airspy for the first time, it is possible that you need to add some udev rules to make the receiver available for the non-root users.

First you need to find the vendor id and product id.

sergsero@aileron:~$ lsusb
Bus 002 Device 007: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 002 Device 011: ID 1d50:60a1 OpenMoko, Inc.
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

The middle line was the Airspy:

Bus 002 Device 011: ID 1d50:60a1 OpenMoko, Inc.

The important parts are “1d50” (the vendor id) and “60a1” (the product id).

Create a new text file (as root) named /etc/udev/rules.d/airspy.rules that contains the following line:

sergsero@aileron:~$ cat /etc/udev/rules.d/airspy.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60a1", GROUP="plugdev", MODE="0666", SYMLINK+="airspy"

The content of the file instructs udev to look out for devices with Vendor ID and Product ID matching Airspy device.
It then sets the UNIX permissions to 0666 and the group to plugdev and creates a symlink in /dev to the device when the Airspy is attached:

sergsero@aileron:~$ ls -l /dev/air*
lrwxrwxrwx 1 root root 15 окт. 4 19:02 /dev/airspy -> bus/usb/002/011

After creating the rules file you can either reboot computer. Or unplug the Airspy from USB, run the command to restart udev (sudo restart udev) and re-plug in the receiver at this point. After replugging your Airspy, you should be able to access the device with all utilities and modesdeco2 as a normal user:

sergsero@aileron:~$ ./modesdeco2 --device-list
2015-10-04 19:37:10.122 INFO ModeSDeco2 v.20151005

Available RTL Devices:
0 mnf: Realtek prod: RTL2838UHIDIR serial: 00000013

Available AirSpy Devices:
Board ID Number: 0 (AIRSPY)
Firmware Version: AirSpy NOS v1.0.0-rc4-0-g23d1436 2015-03-22
Part ID Number: 0x6906002B 0x00000030
Serial Number: 0x16C463C821
Supported sample rates: 10.0 2.5

If you still can’t access the device, make sure that you are a member of the plugdev group:

sergsero@aileron:~$ cat /etc/group | grep plugdev
plugdev:x:46:sergsero