Showing posts with label udev rules. Show all posts
Showing posts with label udev rules. Show all posts

Saturday, 5 October 2013

Creating a static WLAN interface number for a wifi wireless adaptor using udev rules

If you need your USB wifi adaptor to be a certain number on boot, i.e wlan5

Using udev rules this is possible.  reference: www.backtrack-linux.org/forums/showthread.php?t=2848


Run a ifconfig and get the mac address of the adaptor:
HWaddr de:ad:be:ef:ca:fe

Create a new udev rule

sudo touch /etc/udev/rules.d/70-persistent-net.rules
sudo nano /etc/udev/rules.d/70-persistent-net.rules


Insert the following lines into the file.

# Comment for the device, the following below should be on one line!
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="de:ad:be:ef:ca:fe", ATTR{type}=="1", NAME="wlan5"



WindyCityTech Blogger
WindyWindyCityTech Wordpress

Saturday, 16 March 2013

Notes for configuring udev rules for em28xx USB capture card

Goal: 
to create static /dev/video10 for plug in USB capture device em28xx.  Static video card location using udev rules ensures that the correct video device is utilised during reboots.  Used for motion program www.lavrsen.dk

Soloution: 
auto create a symlink from kernel assigned video address to /dev/video10 when em28xx is plugged in.

Plug in device and note video number assignment i.e. video0
then use this command to search for variables that can uniquely identify this device.
udevadm info -a -p $(udevadm info -q path -n /dev/video0)

Create udev rule:
KERNEL=="video[0-9]*", DRIVERS=="em28xx", SYMLINK+="video10"

Where:
KERNEL=="video[0-9]*" binds this rule to only video devices
DRIVERS=="em28xx" bind the rule to devices using driver em28xx
SYMLINK+="video10" creates a symlink from /dev/videoX to /dev/video10

Does it work:
ls /dev/video*

sudo service udev restart

References:
http://www.mythtv.org/wiki/Device_Filenames_and_udev

WindyCityTech Blogger
WindyWindyCityTech Wordpress

Tuesday, 5 June 2012

Motion webcam two webcams change order on boot /dev/video0 persistent linux ubuntu

Copied from various resources on the web, Original Reference Here

When using Motion http://www.lavrsen.dk/foswiki/bin/view/Motion with multiple usb webcams, sometimes the dev order of the webcams changes on reboot of a machine. 

i.e.  /dev/video0 becomes dev/video1

This can seriously stuff things up.  To overcome this, create a udev rule to lock/assign a device dev location.

First do a lsusb, notice that I have two webcams, one is built into the screen and the other is USB connected.



Take note of the ID of the webcam you want
i.e 045e:00f7


Now do a:
sudo touch /etc/udev/rules.d/25-name-video-devices.rules


Edit this file and enter the following:
SUBSYSTEM=="video4linux", BUS=="usb", SYSFS{idVendor}=="045e", SYSFS{idProduct}=="00f7", NAME="video5"


I assigned the webcam to give a default location of /dev/video5 so it would never conflict with other webcams fitted in the future (hopefully)

Don't forget to modify your ~/.motion/motion.conf file and change the video device to /dev/video5


What happens if you have two webcams and they are both the same?  Fuuuuuuuuuuuuuuuuu!!!!!!!!!!!!!!!

WindyCityTech Blogger
WindyWindyCityTech Wordpress