Thursday, April 29, 2010

Setting up FireWire (1394b) machine vision camera

Currently udev on Ubuntu 9.10 has a problem that it does not create firewire video devices in /dev
For proper working of machine vision camera one has to have loaded:
  • ohci1394
  • ieee1394
  • video1394
  • raw1394
and rw rights set up for /dev/raw1394 and /dev/video1394/[0-3]

My fix for this was:
1. Add to /etc/modules (loading modules during boot)
  • raw1394
  • video1394
Setting the "rw" rights:
You can create /etc/udev/rules.d/51-raw1394.rules and add this line to that file:
KERNEL=="raw1394", GROUP=="video"
That way udev will change group belonging of /dev/raw1394 to "video" group.
Of course you have to have this group created (you can use groupadd for this).
Adding yourself to the group:
sudo usermod -a -G video joe
Checking if this was successful:
groups joe
You might want to restart udev to apply changes in udev rules.
sudo service udev restart
raw1394 is done. Now we have to fix /dev/video1394/[0-3]. I have to add startup script to make directory and nodes for my video1394 devices.

I created file /etc/init.d/1394:
touch 1394
changing rights:
sudo chmod +x ./1394
I have to put this text to 1394 file:

#!/bin/bash
mkdir /dev/video1394
mknod /dev/video1394/0 c 171 16
mknod /dev/video1394/1 c 171 17
mknod /dev/video1394/2 c 172 18
mknod /dev/video1394/3 c 173 19
chmod a+rw /dev/video1394/0
chmod a+rw /dev/video1394/1
chmod a+rw /dev/video1394/2
chmod a+rw /dev/video1394/3

This creates the nodes and sets proper rw rights.
I have to put this as startup script:
update-rc.d 1394 defaults

Finally coriander does not complain and my cameras seems to work.
Thanks to Point Grey for sharing the info

No comments:

Post a Comment