RASPBMC and Edimax EW-7811Un


10 posts
by rabid » Sat Jul 07, 2012 8:26 am
Hello,

My Edimax EW-7811Un works fine with the Wheezy Beta image using the excellent script provided by MrEngman in this thread: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=26&t=6256

However, I am now trying to get it to work with RASPBMC RC 3.

I can get it to work if I run
Code: Select all
sudo /etc/init.d/networking restart
...manually. This script is essentially running ifdown -a then ifup -a. If I SSH in and run ifup -a nothing happens, but running ifdown -a first works. From this I deduce that ifup -a has already been run as part of the boot process, but unsuccessfully.

I've tried a few things in /etc/network/interfaces, but this is what I current have:
Code: Select all
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid myssid
wpa-psk myhexkeygeneratedwithwpapassphrase
I have tried setting a static IP, but still no joy.

  1. Any ideas how I can either get the call to ifup -a on boot to work (preferred), or the best way to just run it again later in the process (hacky)?
  2. Where should I be looking to find out what's happening on boot (logs, etc.)?
  3. How come ethernet works when there's nothing in my /etc/network/interfaces file? Is that an avenue I can investigate?
  4. Where would the initial call to ifup -a be made from (if indeed it is being made)?
Any help on this would be very much appreciated. It's driving me a bit crazy now! Thanks.
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by rabid » Sat Jul 07, 2012 2:26 pm
OK, I think I've resolved this, but maybe this will help someone else.

/etc/init.d/networking was not firing at boot. When I ran update-rc.d /etc/init.d/networking defaults it complained about mountkernfs, which is listed in the networking script as a requirement. I simply removed it from the header, leaving me with:
Code: Select all
### BEGIN INIT INFO
# Provides:          networking
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Should-Start:      ifupdown
# Should-Stop:       ifupdown
# Default-Start:     S
# Default-Stop:      0 6
... and then update-rc.d /etc/init.d/networking defaults worked, and the adapter becomes associated on boot.

For reference, I got the adapter set-up using the driver from this post: http://forum.stmlabs.com/showthread.php?tid=780. At least, I think it was that one in the end. I had also tried adapting MrEngman's script, but I think the driver was not right.
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by rabid » Mon Jul 16, 2012 6:56 am
OK, only seems fair that I post the actual conclusion.

The fix posted before still would not work if the power was removed from the Pi, although it would work on a reboot.

I finally realised that RASPBMC is using NetworkManager.

I have updated /etc/NetworkManager/NetworkManager.conf to set managed to true, so that it will also parse /etc/network/interface:
Code: Select all
[main]
plugins=ifupdown,keyfile

no-auto-default=a0:a0:a0:a0:a0:a0,

[ifupdown]
managed=true
Also, it seems that I needed to set the passphrase as hex in /etc/network/interfaces (as before I did it didn't seem to work).
Code: Select all
sudo apt-get install wpasupplicant
sudo wpa_passphrase <ssid> <passphrase>
Then use the output string in /etc/network/interface:
Code: Select all
allow-hotplug wlan0

auto wlan0
iface wlan0 inet dhcp
wpa-ssid <ssid>
wpa-key-mgmt WPA-PSK
wpa-psk <hexstring>
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by freemansteve » Thu Aug 02, 2012 2:09 pm
I'm running "out-of-box" raspbmc of the most recent auto-download vintage (as of 2nd Aug, but the nightly builds seem to not have a date beyond 16th July...I've no idea how to find out which version is really installed or running).

I am just about to plug in an Edimax 7811un WiFi adapter, so naturally I assume it won't "just work" - this is because I already had to try various mouse, keyboard, & USB hubs from my collection to find ones that could be enumerated and work properly.

So... I had a quick poke in raspbmc having read this thread, and noticed that I don't have this:
/etc/NetworkManager/NetworkManager.conf

as witnessed here:
pi@raspbmc:/etc$ ls net*
networks

network:
if-down.d if-pre-up.d interfaces run
if-post-down.d if-up.d interfaces.bak-0
pi@raspbmc:/etc$

.....so am I looking in the wrong place, or do I need to install network manager first ? If so how?

I have searched endlessly about raspbmc and wifi (with EW-7811) and so far everything seems either dauntingly complex or inconsistent.

If someone knows whether the 7811 will "just work" in raspbmc (direct r via USB hub) or has a foolproof way to get it working quickly, I'd love to hear it

Many thanks
Steve
Posts: 2
Joined: Thu Aug 02, 2012 1:25 pm
by rabid » Thu Aug 02, 2012 4:23 pm
Remember that *nix is case sensitive: try ls Net*.

I was still having problems with getting the Edimax adapter running from a power-up (i.e.: switching it on, it was fine following a reboot command).

I must admit that the Pi's not currently in a running state, but I'm currently edging more toward the new Raspian image + a download of xbmc.

Using the instructions and script in the following thread it is very easy to get the Edimax running just fine with the Raspian image:

viewtopic.php?f=26&t=6256

I then follow the instructions on the following blog post to get xbmc running.

http://www.memetic.org/pre-compiled-xbmc-for-raspbian/

This has worked for me previously, but very recently I tried switching to a new card and for some reason xbmc is not booting up. I probably just missed a step though. I just need some time to start from scratch again.

NB: I understand the next RC of Raspbmc will be using Raspian, but as someone who is not that au fait with Debian I just wonder whether Raspbmc is a bit too restrictive for me. I like having the core/official Raspian release underneath, so support is more widespread.
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by freemansteve » Fri Aug 03, 2012 8:36 am
Dohh! I forgot the case thing. Long time since I wrote code (under Solaris) or used command lines !

Thanks - I will will try raspian as the only practical reason for me to use the Pi and XBMC is to have wifi based media centre around the house where there are no e/n RJ45s.

Steve
Posts: 2
Joined: Thu Aug 02, 2012 1:25 pm
by spasmoid » Wed Sep 05, 2012 10:03 am
I have just installed the latest version of raspbmc and I have used this thread to help set up my USB wifi interface. I can get it working by manually creating the file

/run/network/ifstate

of course, this doesn't work on reboot, and the ifup error resumes

Code: Select all
ifup: failed to open statefile /run/network/ifstate: No such file or directory


If someone can help me to fix this problem, I would very much appreciate it.

ps. from XBMC > PROGRAMS, when I try to run "Raspbmc Setting" I get script failed: script.raspbmc.settings
but I will start another thread for that or search an existing one.

Cheers.
Posts: 1
Joined: Wed Sep 05, 2012 9:53 am
by rabid » Wed Sep 05, 2012 11:56 am
I'm the originator of this thread, and I got my Edimax EW-7811Un running with the newer Raspbmc by just using the Network Manager from with XBMC, as directed (I can't remember exactly what it entailed but I know I didn't have to do any manual/additional installation).

If you have the same adapter, maybe worth just rewriting the card and going through the steps again?
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by rabid » Wed Sep 05, 2012 12:01 pm
Also, it may be worth taking a look at the Raspbmc thread:

http://forum.stmlabs.com/showthread.php?tid=1620
Posts: 6
Joined: Sat Jul 07, 2012 8:04 am
by amyren » Thu Sep 06, 2012 6:30 am
rabid wrote:I'm the originator of this thread, and I got my Edimax EW-7811Un running with the newer Raspbmc by just using the Network Manager from with XBMC, as directed (I can't remember exactly what it entailed but I know I didn't have to do any manual/additional installation).

If you have the same adapter, maybe worth just rewriting the card and going through the steps again?


This probably means that most wifi sticks with RTL8188CUS could work under raspmc that way, thats cool :)

Another question, are there are obvious benefits for running raspmc compared with raspian with xbmc installed?
I dont mind if raspian + xbmc takes a bit longer to boot, or the extra space needed on the SD card for the raspian setup. So my question is purely about user experience and performance of the two once xbmc is loaded.

Ok, I know one benefit of raspmc, that it mounts usb disks when they are hotplugged. Are there other differerences?
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am