Writing a Bus Pirate udev rule

It only took a couple of instances where the Bus Pirate wasn’t linked to /dev/ttyUSB0 before I got sick of that game and wrote a udev rule to create a symlink. Now, every time I plug it in it is available at /dev/buspirate. This simple bit of code creates the rule:

sudo echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001";, MODE="0660", SYMLINK+="buspirate"' | sudo tee /etc/udev/rules.d/47-BusPirate.rules
sudo restart udev

Note: The restart udev command is for Ubuntu 9.10 Karmic Koala. Older version should run “sudo /etc/init.d/udev restart” instead.

Update: Kenny emailed saying he uses this for Bus Pirate v4:

SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="fb00", MODE="0660", SYMLINK+="buspirate4"

That should do it.  You can now point your serial terminal program to ‘/dev/buspirate’. This doesn’t differentiate between different devices using the same FTDI chip but I don’t have any others so this isn’t a problem. If you need to specifically pinpoint this Bus Pirate as a unique device, add a compare key that looks at the serial number (ATTRS{serial}==”YourSerialNumberHere”).

3 thoughts on “Writing a Bus Pirate udev rule

  1. Your above “solution” caused me pretty much pain. I couldn’t communicate with /dev/buspirate using minicom and I thought that the hardware must be buggy. A friend of mine also tried the above snippet and got the same result.

    http://wiki.countercaster.com/The_Bus_Pirate_on_Linux:_From_/dev/ttyUSB%3F_to_/dev/bus_pirate however has the udev rule that actually works.

    Here’s the specific rule that worked for us:
    SUBSYSTEM==”tty” ATTRS{idVendor}==”0403″ ATTRS{idProduct}==”6001″ ATTRS{serial}==”A7004IdU” MODE=”0660″ SYMLINK+=”bus_pirate”

    I don’t wanna blame you, since you have all the good intentions, but I’m sure that this correction is worthwile to many 🙂

  2. Here’s the specific rule for Ubuntu 11.04 that worked for us:
    #Bus Pirate v3a DangerousPrototypes.com
    SUBSYSTEM==”tty”, SYSFS{idProduct}==”6001″, SYSFS{idVendor}==”0403″, SYSFS{serial}==”v3BusPirate”, SYMLINK+=”bus_pirate”

Leave a Reply