After using my MindStorms USB Tower on Ubuntu Linux for a while, I started noticing that the permissions on the /dev/usb/legousbtower1 device reverted to “root only” every time I rebooted or un- and re-plugged the device into the USB port. The permissions were like this every time:
crw------- 1 root root 180, 1 Oct 22 09:56 legousbtower1
Since I log on as user michiel, not root, I could not access the device, so NQC would complain about “Could not open serial port or USB device”. I found the solution on Adrian Smith’s Blog:
“For a more permanent solution create the file /etc/udev/rules.d/90-legotower.rules with the following contents,ATTRS{idVendor}=="0694",ATTRS{idProduct}=="0001",MODE="0666",GROUP="<group>"
You can use any group you’re a member of in place of <group>. You can find a list of the groups you’re a member of using ‘id -a
‘. I used the group “adrian”. On a lot of systems there’ll be a group with the same name as your userid. This is fine so long as you’re the only one who’ll need access to the device. Otherwise you’ll need to find a common group or perhaps create a new one. By the way, the vendor and product ids in the udev rules file came from running lsusb.”
I used the group name “michiel” and it worked fine (I think it will work regardless because it sets the mode to 666 which means read/write access for everyone anyway.
After creating that file, I unplugged the USB tower, plugged it back in, and presto there it was:
crw-rw-rw- 1 root michiel 180, 1 Oct 22 12:59 legousbtower1
Problem solved!