Difference between revisions of "Bus pirate"

From ArchWiki
Jump to: navigation, search
m (Moved category link)
(update templates, see Help:Style)
Line 2: Line 2:
 
==General==
 
==General==
  
The [http://code.google.com/p/the-bus-pirate/ Bus Pirate] is a versatile tool for communicating with various hardware. All scripts will assume that there is a '{{Filename|/dev/buspirate}}'.
+
The [http://code.google.com/p/the-bus-pirate/ Bus Pirate] is a versatile tool for communicating with various hardware. All scripts will assume that there is a '{{ic|/dev/buspirate}}'.
  
 
===Installation===
 
===Installation===
  
The drivers for the FTDI chip is included in the kernel, so it should be detected as soon as it's plugged in, and assigned to device {{Filename|/dev/ttyUSB[0-9]}}.
+
The drivers for the FTDI chip is included in the kernel, so it should be detected as soon as it's plugged in, and assigned to device {{ic|/dev/ttyUSB[0-9]}}.
 
To check where it got assigned, run:
 
To check where it got assigned, run:
  
Line 17: Line 17:
 
====udev====
 
====udev====
  
It can be annoying to have to look up what {{Filename|/dev/ttyUSB[0-9]}} the device gets assigned, so it's a good idea to add a simple udev rule that creates the symlink '{{Filename|/dev/buspirate}} -> {{Filename|/dev/ttyUSB*}}' when it is plugged in.
+
It can be annoying to have to look up what {{ic|/dev/ttyUSB[0-9]}} the device gets assigned, so it's a good idea to add a simple udev rule that creates the symlink '{{ic|/dev/buspirate}} -> {{ic|/dev/ttyUSB*}}' when it is plugged in.
  
First of all, you will need to find out the serial number of FTDI chip on the bus pirate. This can be achieved by running the following, assuming your device is plugged in and was assigned to {{Filename|/dev/ttyUSB0}}:
+
First of all, you will need to find out the serial number of FTDI chip on the bus pirate. This can be achieved by running the following, assuming your device is plugged in and was assigned to {{ic|/dev/ttyUSB0}}:
  
 
  # udevadm info --attribute-walk -n /dev/ttyUSB0  | sed -n '/FTDI/,/serial/p'
 
  # udevadm info --attribute-walk -n /dev/ttyUSB0  | sed -n '/FTDI/,/serial/p'
Line 25: Line 25:
 
Now add/create the following file:
 
Now add/create the following file:
  
{{File|name=/etc/udev/rules.d/98-buspirate.rules|content=
+
{{hc|/etc/udev/rules.d/98-buspirate.rules|2=
 
<nowiki>
 
<nowiki>
 
SUBSYSTEM=="tty", ATTRS{serial}=="XXXXXXXX", GROUP="users", MODE="0660", SYMLINK+="buspirate"
 
SUBSYSTEM=="tty", ATTRS{serial}=="XXXXXXXX", GROUP="users", MODE="0660", SYMLINK+="buspirate"
 
</nowiki>}}
 
</nowiki>}}
 
  
 
Change 'ATTRS{serial}=="XXXXXXXX"' to the serial on your device and force udev to load the new rule:
 
Change 'ATTRS{serial}=="XXXXXXXX"' to the serial on your device and force udev to load the new rule:
Line 41: Line 40:
 
To communicate with the device, you can use any of the following, to name a few:
 
To communicate with the device, you can use any of the following, to name a few:
  
* {{Filename|minicom}}
+
* {{ic|minicom}}
 
  # minicom -b 115200 -8 -D /dev/buspirate
 
  # minicom -b 115200 -8 -D /dev/buspirate
* {{Filename|screen}}
+
* {{ic|screen}}
 
  # screen /dev/buspirate 115200 8N1
 
  # screen /dev/buspirate 115200 8N1
* {{Filename|picocom}}
+
* {{ic|picocom}}
 
  # picocom -b 115200 -p n -d 8 /dev/buspirate
 
  # picocom -b 115200 -p n -d 8 /dev/buspirate
  
 
Type '?' and press enter and the device should reply with a list of possible commands.
 
Type '?' and press enter and the device should reply with a list of possible commands.

Revision as of 11:29, 3 January 2012

General

The Bus Pirate is a versatile tool for communicating with various hardware. All scripts will assume that there is a '/dev/buspirate'.

Installation

The drivers for the FTDI chip is included in the kernel, so it should be detected as soon as it's plugged in, and assigned to device /dev/ttyUSB[0-9]. To check where it got assigned, run:

# dmesg | tail

The output will contain a line that looks something like this:

# usb 1-4.4: FTDI USB Serial Device converter now attached to ttyUSB0

udev

It can be annoying to have to look up what /dev/ttyUSB[0-9] the device gets assigned, so it's a good idea to add a simple udev rule that creates the symlink '/dev/buspirate -> /dev/ttyUSB*' when it is plugged in.

First of all, you will need to find out the serial number of FTDI chip on the bus pirate. This can be achieved by running the following, assuming your device is plugged in and was assigned to /dev/ttyUSB0:

# udevadm info --attribute-walk -n /dev/ttyUSB0  | sed -n '/FTDI/,/serial/p'

Now add/create the following file:

/etc/udev/rules.d/98-buspirate.rules
SUBSYSTEM=="tty", ATTRS{serial}=="XXXXXXXX", GROUP="users", MODE="0660", SYMLINK+="buspirate"

Change 'ATTRS{serial}=="XXXXXXXX"' to the serial on your device and force udev to load the new rule:

# udevadm control --reload-rules

At this point, whenever you plug in the device, the symlink should be created.

Communication

To communicate with the device, you can use any of the following, to name a few:

  • minicom
# minicom -b 115200 -8 -D /dev/buspirate
  • screen
# screen /dev/buspirate 115200 8N1
  • picocom
# picocom -b 115200 -p n -d 8 /dev/buspirate

Type '?' and press enter and the device should reply with a list of possible commands.