Mounting Hardware for TO-220 Heat Sinks

If you are using transistors and regulators in a TO-220 form factor, you will need the correct mounting hardware. This web site has the details for several different heat sink form factors, starting with the TO-220:

AAVID Heat Sink Mounting Kits

Basically, you need SAE #4-40 machine screws, nuts, washers, and lock washers. It should be much cheaper to purchase these parts from a local hardware store than to buy small batches of them from somewhere like Digikey.

Configuring WPA2 using wpa_supplicant on the Raspberry Pi

To use WPA2 pre-shared key on the Raspberry Pi, you will first need to add a network configuration to “/etc/wpa_supplicant/wpa_supplicant.conf”. Note the lack of space in “network={“.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="Your SSID Here"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk="YourPresharedKeyHere"
}

After you have modified wpa_supplicant.conf, you will need to change the “wlan0” section of “/etc/network/interfaces”. For a static IP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
    address 10.1.2.20
    netmask 255.255.255.0
    network 10.1.2.0
    gateway 10.1.2.1

For DHCP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

After that, you will need to bring up the “wlan0” interface using “ifup”:

# sudo ifup wlan0

You may have to bring the interface down and then back up:

# sudo ifdown wlan0
# sudo ifup wlan0

You may see messages like this:

# sudo ifup wlan0
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

While the messages are annoying, the adapter will still connect and transmit and receive data.

You can check your wireless connection using iwconfig:

# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"Your SSID Here"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.442 GHz  Access Point: NN:NN:NN:NN:NN:NN   
          Bit Rate:54 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=95/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

If there are errors in your “/etc/wpa_supplicant/wpa_supplicant.conf” file or you have some other problem, you can start wpa_supplicant manually using the following command:

# sudo /sbin/wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 \
-D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf

The backslash above is used to break the long line into two lines.

Using a Turtle Beach Amigo II with a Raspberry Pi

To make the Turtle Beach Amigo II the default sound card on a Raspberry Pi, edit “/etc/modprobe.d/alsa-base.conf” and comment out the second line below:

# Keep snd-usb-audio from being loaded as first soundcard
# options snd-usb-audio index=-2

After you reboot, you should see the following:

# Get a list of sound cards using procfs

pi@raspberrypi ~ $ cat /proc/asound/cards 
 0 [Audio ]: USB-Audio - Turtle Beach USB Audio
 Generic Turtle Beach USB Audio at usb-bcm2708_usb-1.3.4, full speed
 1 [ALSA ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
 bcm2835 ALSA

# Get a list of sound devices using aplay

pi@raspberrypi ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Audio [Turtle Beach USB Audio], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
 Subdevices: 8/8
 Subdevice #0: subdevice #0
 Subdevice #1: subdevice #1
 Subdevice #2: subdevice #2
 Subdevice #3: subdevice #3
 Subdevice #4: subdevice #4
 Subdevice #5: subdevice #5
 Subdevice #6: subdevice #6
 Subdevice #7: subdevice #7