usb devices appear as /dev/ttyUSB<somenumber> devices. When you plug it to another USB port <somenumber> is unpredictable and you always wasting time to figure out what is the right port number for your device.
To fix this, you can create "udev" rules, so every time you plug in your device there will be the same sym link created for that particular device.
Check vendor and product id with lsusb command:
~# lsusb
Bus 001 Device 011: ID 0403:6001 FTDI FT232 USB-Serial (UART) IC
Bus 001 Device 010: ID 0403:6001 FTDI FT232 USB-Serial (UART) IC
ok, we have 2 FTDI chips and we can't distinguish which chip is from what device.
Let's check device serial number(we know that it is connected to ttyUSB0):
~# udevadm info -a -n /dev/ttyUSB0 | grep '{serial}'
ATTRS{serial}=="0000:00:14.0"
Then go to /etc/udev/rules.d and create file 99-usb-serial.rules
~#sudo touch 99-usb-serial.rules
open file for edit and add these line:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="0000:00:14.0", SYMLINK+="arduino"
Now everytime when you plug in your board it will be accesible via symlink /dev/arduino
~# ls -l /dev/arduino
lrwxrwxrwx 1 root root 7 Nov 15 20:11 /dev/arduino -> ttyUSB0
~# ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Nov 15 20:11 /dev/ttyUSB1
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
Tuesday, February 21, 2017
Wednesday, October 19, 2016
Ubuntu. Cannot upgrade because of full /boot partition. Freeing some space
If you try to upgrade linux distribution (for example from 14.04 to 16.04) sometimes upgrade fail because of no free space at /boot partition. This happens because there are old kernel installed that are no longer needed. To remove old kernel you shoul issue command like this:
sudo apt-get purge linux-image-x.x.x-xx-generic
where "x" are numbers. so you remove all kernels except one that is used. ( check it with uname -r command). Usually in /boot partition there are many of kernels, so removing them one by one is time consuming operation. To make it more convenient use that crazy long command and wait :)
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
It remove all unused kernels from your /boot partition.
sudo apt-get purge linux-image-x.x.x-xx-generic
where "x" are numbers. so you remove all kernels except one that is used. ( check it with uname -r command). Usually in /boot partition there are many of kernels, so removing them one by one is time consuming operation. To make it more convenient use that crazy long command and wait :)
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
It remove all unused kernels from your /boot partition.
Subscribe to:
Posts (Atom)