Saturday, 16. December 2017 13:05
Search

Hardware

Virtualisation

Tools and scripts

Compiled things

Games and fun

freiesMagazin

Counter
Sponsored by

Build modules for Raspbmc

2013-11-24 17:46
Twitter article

If you want to use your Raspberry Pi as media player, you may find out that Raspbmc fits your needs. Most things work right "out of the box", but when you want to use some kind of "exotic" hardware, it may become complicated.

In my case it took me two days to get started the TP-LINK TL-WN727N USB WLAN stick. You will find no kernel headers package in the repository of Raspbmc and the package that can be installed via the TV interface (or via finding out the correct URL and installing it with dpkg) is not suitable for building the TL-WN727N module. You may notice that there is shipping a module that seems to work with the WLAN stick, but with it you will never connect to an access point.

I had build the module on my own and the following articles gave me good hints on this way: D-Link DWA-140 B3 (2001:3c15) wird nicht erkannt komme nicht weiter and Installing TP-LINK WN725N V2 driver (Kernel 3.10.13/September Update).

You may find the following howto useful even if you don't own a TL-WN727N, because you can adopt the basic building steps for your hardware.

Log in via SSH

Use an SSH client to log into your Raspberry Pi

ssh pi@[current IP of you Raspberry Pi]

Do this in the shell

#Become root
sudo bash

#Stop graphical interface (reduce CPU load and save RAM)
initctl stop xbmc

#Install basic packages for building
apt-get -y install build-essential bc gcc make wireless-tools

#Get Module.symvers from the Kernel headers
cd /tmp
wget http://www.mirrorservice.org/sites/raspbmc.com/downloads/bin/kernel/linux-headers-latest.deb.gz
mkdir x
dpkg-deb -x linux-headers-latest.deb.gz x
mv -v x/usr/src/linux-headers-$(uname -r)/Module.symvers /usr/src

#Fetch and prepare the Kernel source
cd /usr/src
gKernel=$(uname -r | sed 's/[0-9]*$/y/')
wget --no-check-certificate https://github.com/raspberrypi/linux/archive/rpi-$gKernel.tar.gz
tar xzf rpi-*.tar.gz
mv linux-rpi-*y rpi-linux

#Get the module source and extract it
wget media.cdn.ubuntu-de.org/forum/attachments/44/19/4365112-2011_0719_RT3070_RT3370_RT5370_RT5372_V2.5.0.3_prepared.tar.gz
tar xzf 4365112-2011_0719_RT3070_RT3370_RT5370_RT5372_V2.5.0.3_prepared.tar.gz

#Configure the Kernel
cd /usr/src/rpi-linux
make mrproper
zcat /proc/config.gz > .config
sed -i 's/CONFIG_CROSS_COMPILE.*/CONFIG_CROSS_COMPILE=""/' .config
make modules_prepare
cp /usr/src/Module.symvers .

#Make symlinks to make the module source find the kernel sources
rm -r /lib/modules/$(uname -r)/build
rm -r /lib/modules/$(uname -r)/source
rm -r /usr/src/linux
ln -s /usr/src/rpi-linux /lib/modules/$(uname -r)/build
ln -s /usr/src/rpi-linux /lib/modules/$(uname -r)/source
ln -s /usr/src/rpi-linux /usr/src/linux

#Compile and install the module
cd /usr/src/2011_0719_RT3070_RT3370_RT5370_RT5372_V2.5.0.3_prepared
make
make install

#Remove old Kernel modules
rm -r /lib/modules/$(uname -r)/kernel/drivers/net/wireless/rt2x00

#Reboot the Raspberry pi
reboot

#Check, if there is a WLAN device after logging in and becoming root again
iwconfig

Finish line

Configure the WLAN connection via Raspbmc's TV interface.

Alternatively: Create your own WiFi config file

Adjust "[myConfigName]":
nano /etc/NetworkManager/system-connections/[myConfigName]

Static IP for WiFi

Then paste in the following lines and adjust "[myConfigName]", "[SSID name of your access point]", "[WiFi IP]" and "[Router IP]".
[connection]
id=[myConfigName]
uuid=12345678-abcd-1234-abcd-1234567890ab
type=802-11-wireless
timestamp=1367940962

[802-11-wireless]
ssid=[SSID name of your access point]
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=geheim

[ipv4]
method=manual
dns=8.8.8.8;
addresses1=[WiFi IP];24;[Router IP];

[ipv6]
method=auto
ip6-privacy=2

Dynamic IP for WiFi

Then paste in the following lines and adjust "[myConfigName]" and "[SSID name of your access point]".
[connection]
id=[myConfigName]
uuid=12345678-abcd-1234-abcd-1234567890ab
type=802-11-wireless
timestamp=1367940962

[802-11-wireless]
ssid=[SSID name of your access point]
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=geheim

[ipv4]
method=auto
ignore-auto-routes=false
ignore-auto-dns=false
never-default=false

[ipv6]
method=auto
ip6-privacy=2

<< Previous articles

My other projects

m23 software distribution

m23 is a software distribution and management system for Debian, Ubuntu and Kubuntu. With m23 you can install and administrate hundreds of clients in an easy way!

Visit the m23 project at SourceForge: m23.sf.net.

Grass Roots Democracy Machine (GRDM)

The GRDM, the Grass Roots Democracy Machine is a software development project designed to create a voting system. The aim is to implement the basic goals of anonymous and comprehensible votings into software.

Visit the GRDM project at SourceForge: grassrootsdemoc.sf.net.

khtml2png

khtml2png is a command line program to create screenshots of webpages.

Visit the khtml2png project at SourceForge: khtml2png.sf.net.

based on devalcms
devalcms