4

I am trying to figure out how to set up my wifi/wired connections manually with raspbmc. I know the recommended method for noobs, like myself, is to use the wireless network plugin, but i bought the pi with the intention of learning a bit more about Linux. I was successful at setting up wifi manually on my raspbarian image using the /etc/network/interfaces file and a creating another file for my wireless settings. My question is, would the same settings possibly work with raspbmc or would i need to go about doing this another way? I can't find a good tutorial on manual configuration of wifi for raspbmc. The /etc/networ/interfaces file on my raspbmc image is empty and I have read somewhere that raspbmc uses a different method, but it didn't really go into details.

The following is what my file looks like in raspberian's /etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp 

allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.1.100
gateway 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.0
wpa-conf /etc/wpa.config
iface default inet dchp

/etc/wpa.config

network={
ssid="*******"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
psk="*******"
}

I am assuming that my wifi dongle is already installed, because when I run ifconfig I get the following at the end:

wlan0     Link encap:Ethernet  HWaddr 00:18:4d:46:9c:ca
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Any advice, or suggestions on where to start, or explanations of what is different between how raspbmc and raspbarian work to connect to the internet would be greatly appreciated. I know that I COULD set up a static IP lease on my router and configure this with the wifi settings plugin, but I really want to learn. I just don't know where to start on this.

Oli
  • 493
  • 5
  • 11
user2969
  • 41
  • 1
  • 1
  • 2
  • 1
    You are correct Raspbmc uses a different method to configure the network. Use the Raspbmc settings menu to configure networking, manually editing the interdaces file will not work. – Steve Robillard Oct 22 '12 at 17:23
  • I guess my question then becomes what file does the raspbmc settings menu modify, and how does it work? Thanks for answering at least this much. – user2969 Oct 22 '12 at 17:51
  • 2
    According to this forum post (http://forum.stmlabs.com/showthread.php?tid=1792) the network details are in /home/pi/.xbmc/userdata/addon_data/script.raspbmc.settings/settings.xml. – Steve Robillard Oct 22 '12 at 17:56
  • Is wpa_supplicant actually running? Your config looks fine, but you're not getting assigned an IP. My guess is that wpa_supplicant is not running or failing to associate with your AP. – Munkeh Oct 25 '12 at 08:47
  • by the way, why is your broadcast 192.168.1.0 ?? it should 192.168.1.255 – gurcanozturk Sep 17 '13 at 17:22

2 Answers2

1

In /etc/network/interfaces change iface wlan0 inet static to iface wlan0 inet manual then cut everything under that except for wpa-conf /etc/wpa.config and paste it under a new line called:

iface something inet static

It should now look like:

auto lo

iface lo inet loopback
iface eth0 inet dhcp 

allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa.config

iface something inet static
address 192.168.1.100
gateway 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.0

iface default inet dchp

Note: I changed wpa-conf to wpa-roam as this is what I have always used and it automatically reconnects when signal is lost.

Note: I leave out network and broadcast from my static IP configuration and it has always worked fine.

Now in /etc/wpa.config add the line:

id_str="something"

So the file ends up looking like

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

network={
    ssid="*******"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    psk="*******"
    id_str="something"
}

Instead of using /etc/wpa.config you should use /etc/wpa_supplicant/wpa_supplicant.conf (exact same setup) as this is what is used by the the WPA supplicant program that you use to setup wifi with the desktop enviroment

Have a look at my answer here and another one here for more info on configuring wifi similar to this. If this was a bit confusing then definitely check those links out as they should be easier to understand compared with this.

11chubby11
  • 4,784
  • 5
  • 25
  • 32
1

As Steve Robillard pointed out, RaspBMC does not use a /etc/wpa.config file to store the WLAN settings, but /home/pi/.xbmc/userdata/addon_data/script.raspbmc.settings/settings.xml.

In this file, the lines starting with <setting id="nm.wifi. are used for WLAN configuration (SSID, password etc.).

abaumg
  • 111
  • 2