Since I was bored with kids battles choosing cartoons from old DVDs I decided to use a Raspberry Pi together with Raspbmc as a media center. Everything had to be powered from the cigar lighter receptacle...
I took an old 2.5" hard-drive as the repository for cartoons. Because of power constraints, I bought a 2.1A dual USB car adapter: it provides enough power for the Raspberry Pi and for the hard-drive; one USB cable goes to the power input of the Raspberry and another "Y" USB cable is connected to the USB car adapter, to the Rabspberry Pi USB port and to the hard-drive. Y USB Cable like this one:http://www.lacie.com/lu/products/product.htm?id=10572.
I wanted to use my iPad as a remote control for XBMC so the idea was to have a wifi emitter in the Raspberry Pi, to connect the iPad to this Wifi network and to use the official remote control app.
So I bought a cheap USB Wifi dongle: D-Link DWA-121 (less than 13€ on Amazon.fr). This dongle has a Realtek RTL8188CUS chipset compatible with the rtl8192cu linux driver already installed on the latest Raspbmc. However, configuring this dongle as a Wifi access point can turn to be a nightmare! So this post is to help people doing the same thing!
Here is how to proceed, using your home network first before going into the car.
1. Install Raspbmc (http://www.raspbmc.com/download/) on the SD Card.
2. Start your Raspberry Pi and let it boot with a connection to your Ethernet network first.
3. Use the official XBMC iPad or iPhone app to automatically detect your Raspberry (your iPhone has to be connected to your home Wifi wich uses the same network as the Raspberry Pi).
4. Check the IP address of the Raspberry in the 'Systems' / 'Info' menu.
5. From your PC or your MAC, connect to the Raspberry Pi using an SSH terminal (from MacOS, you can go to a terminal and type
- CODE:
ssh -l pi IP_ADDRESS
- CODE:
sudo -s
6. You will need to follow this tutorial: http://elinux.org/RPI-Wireless-Hotspot but at the first step you have to change the following code:
- CODE:
sudo apt-get install hostapd udhcpd
- CODE:
sudo apt-get install hostapd udhcpd iptables
7. Later in the tutorial you also need to modify the driver from the file /etc/hostapd/hostapd.conf which is
- CODE:
driver=nl80211
- CODE: SELECT ALL
driver=rtl871xdrv
8. The hostapd file also need to be changed before running hostapd. Download the correct version by typing
- CODE:
wget http://dl.dropbox.com/u/1663660/hostapd/hostapd
- CODE:
mv hostapd /usr/sbin
- CODE:
chmod 755 /usr/sbin/hostapd
9. You should have finished the tutorial by now but there is an ultimate modification to be done. I realized that the Wifi interface was not starting, causing the wifi Access Point not to be working... So you have to modify the /etc/rc.local file by typing
- CODE:
nano /etc/rc.local
and adding the following 2 lines before the exit 0 line:
- CODE:
ifup wlan0
service udhcpd restart
10. Restart you Raspberry Pi, check the Wifi from your iPad: you should be able to connect to your newly create access point, to detect your Raspberry Pi from the official xbmc app and to enjoy an autonomous Wifi Raspberry Pi!
Pictures from the installation in my car:
Official XBMC iPad app together with Raspbmc in my Renault Espace:
IMPORTANT NOTE:
If you see the SSID but are not able to connect to it that means that it is probably a DHCP issue: your raspberry is not providing an IP address to your iPad. To solve this, we will simply change the DHCP server...
First thing to check: if you type 'ifconfig', do you have an IP address for WLAN0 interface? If yes, it is really a DHCP issue.
I also had a DHCP issue once and I changed the DHCP server (after a reinstall from scratch). You can do so by typing:
- CODE:
apt-get install isc-dhcp-server
- CODE:
service udhcpd stop
- CODE:
sudo nano /etc/default/isc-dhcp-server
- CODE:
sudo nano /etc/dhcp/dhcpd.conf
- CODE:
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.42.255;
option domain-name "home";
option routers 192.168.42.1; #default gateway
subnet 192.168.42.0 netmask 255.255.255.0 {
option routers 192.168.42.1;
range 192.168.42.10 192.168.42.20; #IP range to offer
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
- CODE:
sudo isc-dhcp-server start
- CODE:
cat /var/log/syslog
You're done! Enjoy!
Thumbs up!
ReplyDelete