tangential
Posts: 4
Joined: Tue Jun 05, 2012 4:55 am

Re: Really odd wifi behaviour! LXDE kills it...

Tue Jun 05, 2012 4:23 pm

Please find the contents of my /etc/network/interfaces file below:

Code: Select all

auto lo wlan0

iface lo inet loopback

iface eth0 inet static
        address 10.0.0.1
        netmask 255.255.255.0
        pre-up ifdown wlan0

iface wlan0 inet dhcp
        wireless-essid ********
        wireless-key ********
        wireless-rate 11M auto
        pre-up ifdown eth0; echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
        post-down echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/bind
YMMV.
Have a good one ;)

ShaunB
Posts: 3
Joined: Mon Jun 04, 2012 11:27 pm

Re: Really odd wifi behaviour! LXDE kills it...

Wed Jun 06, 2012 10:15 pm

Perfect solution, thanks for sharing... i can stop banging my head on the wall now :D
tangential wrote:I was experiencing this issue, but managed to resolve it by disabling the eth0 interface. While not a fix, this workaround is feasible if you do not require both wlan* and eth0 functionality at the same time.

In order to disable the eth0 interface, run the following:

Code: Select all

echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
And to re-enable, run the following:

Code: Select all

echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/bind
These commands effectively disconnect (and reconnect) the ethernet device portion of the smsc95xx chipset from its USB bus. In my experience, the low/high speed USB issue (resulting in a loss of wireless connectivity) only occurs while the eth0 device is connected/bound.
The unbind'ing and re'bind'ing of the eth0 device can be added into the /etc/network/interfaces configuration as part of the appropriate 'pre-up' and 'post-down' directives. You may also want to add similar directives to the eth0 interface configuration to ensure that online state of eth0 and wlan* are mutually exclusive (I have been too lazy to do this yet, so I don't have a tested excerpt to share).

Chrisn
Posts: 9
Joined: Sun Feb 19, 2012 9:39 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sun Jun 17, 2012 8:43 am

Sounds brilliant but as a newbie I can't seem able to get to either run the unbind statement or change the interfaces file.
I don't seem to have rights to do this even though I am logged in as Pi in the Debian distro.

Could someone give me step by step instructions please

Chris

tangential
Posts: 4
Joined: Tue Jun 05, 2012 4:55 am

Re: Really odd wifi behaviour! LXDE kills it...

Sun Jun 17, 2012 4:23 pm

Chrisn wrote:Sounds brilliant but as a newbie I can't seem able to get to either run the unbind statement or change the interfaces file.
This is in fact due to insufficient permissions. You will probably need to be using the 'root' account (effective UID 0) in order to perform these tasks.
Chrisn wrote:Could someone give me step by step instructions please
Sure. If you try running

Code: Select all

sudo -s
or

Code: Select all

sudo su -
You should be given a new shell (with root privileges) from which you should be able to perform the aforementioned tasks (i.e., unbinding the interface and editing the interfaces file). Please note that it's important to run the unbind in a (sub)shell as UID 0, as simply prepending `sudo` to the `echo` command will cause the `echo` to run as root, but not the shell redirection.

Chrisn
Posts: 9
Joined: Sun Feb 19, 2012 9:39 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sun Jun 17, 2012 7:40 pm

Thanks for the feedback, but I thought I was in the root, I haven't added any users and I had logged in as Pi password raspberry which I thought was the root.

Also how can I change the interfaces file like the example?
What can I use to edit text files at command line?

Chris

tangential
Posts: 4
Joined: Tue Jun 05, 2012 4:55 am

Re: Really odd wifi behaviour! LXDE kills it...

Mon Jun 18, 2012 4:43 pm

Chrisn wrote:Thanks for the feedback, but I thought I was in the root, I haven't added any users and I had logged in as Pi password raspberry which I thought was the root.
Not to nitpick, but the phrasing "in the root" could lead to a conflation of terms.
  • The 'root directory' or 'root of the filesystem', represented by the path '/', is the root of the filesystem tree. Please see hier(7) for more details (by using the command `man hier`).
  • The super-user with UID 0, which conventionally bears the username 'root'. This is a login account, but password logins for root are disabled in the Raspberry Pi Debian image.

    Code: Select all

    pi@raspberrypi:~$ sudo grep root /etc/shadow
    root:!:14999:0:99999:7:::
  • root's home directory, which is conventionally '/root'.
The 'pi' user that you login as is not the same as 'root', but rather is an admin/power user with password-less sudo permissions.

Code: Select all

pi@raspberrypi:~$ sudo grep pi /etc/sudoers
pi      ALL=(ALL) ALL
Chrisn wrote:Also how can I change the interfaces file like the example?
What can I use to edit text files at command line?
The Raspberry Pi Debian image includes several text editors by default (some more intuitive/easier than others). If you are new to text editors, and want to make the changes with minimal fuss, I would recommend that you use `nano`. If you plan on performing a significant amount of text editing in the future, I highly recommend that you learn `vi` at the very least (as it is the most standard/universal screen editor). You may wish to check out `sam` (`ed`-like command syntax, but with structural regular expressions; this is the editor that I wish I used), `vim` (like `vi`, but with tonnes of other features/extensions/cruft; this is what I actually use), or `emacs` (What doesn't it do? If you never want to have to leave your text editor or you have a particular affinity for Lisp, then `emacs` is for you).

herrb
Posts: 5
Joined: Mon Jul 16, 2012 12:21 pm

Re: Really odd wifi behaviour! LXDE kills it...

Thu Jul 19, 2012 8:24 am

You can also do it like this:

Disable:

Code: Select all

sudo sh -c 'echo -n 1-1.1:1.0 > /sys/bus/usb/drivers/smsc95xx/unbind'
Re-enable:

Code: Select all

sudo sh -c 'echo -n 1-1.1:1.0 > /sys/bus/usb/drivers/smsc95xx/bind'

SDC
Posts: 6
Joined: Sat Jul 28, 2012 11:09 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sat Jul 28, 2012 11:12 pm

I had this exact same problem. Wifi worked fine in command line, went haywire once in LXDE (startx).

Disconnecting the hardware Ethernet worked !

Thanks for the time savings (wish I'd looked sooner!)
--- SDC

User avatar
Montala
Posts: 675
Joined: Mon Mar 05, 2012 11:54 pm
Location: Herefordshire (U.K.)

Re: Really odd wifi behaviour! LXDE kills it...

Sun Jul 29, 2012 7:24 am

I have found this to be a very interesting and informative thread, and would like to thank all those who have contributed to it.

Just one query on the examples from 'herrb' above... am I correct in assuming that the reference to smsc95xx has nothing whatsoever to do with the Wi-Fi 'dongle' being used, and will presumably still 'work' without an Ethernet connection being plugged in at all?

Thanks! :)

ninapat
Posts: 18
Joined: Wed Aug 01, 2012 4:15 pm

Re: Really odd wifi behaviour! LXDE kills it...

Wed Aug 15, 2012 12:45 pm

works for me too
solution to put in wiki, faq, howto, .. ?

kaneg
Posts: 2
Joined: Thu Aug 16, 2012 4:51 pm

Re: Really odd wifi behaviour! LXDE kills it...

Thu Aug 16, 2012 5:07 pm

Interesting solution!

I have encountered the exact same issue with my D-Link dwl-g122 wifi card. I had thought it was caused by the lack of power, so tried a powered USB hub, but still not fixed. I have doubted the powered USB hub can't supply enough current. Now it seems it was caused by software.

I will try your method tomorrow and return you the result. :)
tangential wrote:Please find the contents of my /etc/network/interfaces file below:

Code: Select all

auto lo wlan0

iface lo inet loopback

iface eth0 inet static
        address 10.0.0.1
        netmask 255.255.255.0
        pre-up ifdown wlan0

iface wlan0 inet dhcp
        wireless-essid ********
        wireless-key ********
        wireless-rate 11M auto
        pre-up ifdown eth0; echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
        post-down echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/bind
YMMV.
Have a good one ;)

stevenwiner
Posts: 13
Joined: Wed Jul 11, 2012 7:29 pm
Location: South Africa

Re: Really odd wifi behaviour! LXDE kills it...

Sat Aug 18, 2012 12:53 pm

Thanks herrb.

This solved my problem perfectly.

Can you tell me how to now make this command run automatically when I start LXDE, so I don't have to type it into my command line every time before I run startx in Raspbian.

Cheers

Steven

pzc
Posts: 5
Joined: Sat Aug 18, 2012 4:36 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sat Aug 18, 2012 4:58 pm

Many thanks tangential! Brilliant solution!
I was having the same problem using:
D-Link DUB-H4 USB Hub
D-Link AirPlus G DWL-G122 Rev E1 Wireless Adapter
Cherry Master Linux Keyboard
Logitech B110 Optical Mouse

Good to know it isn't a USB power problem. I'm using the D-Link Hub to power the Pi and it works fine (so long as I don't use the Fast Charge port to power the Pi - that causes all kinds of mayhem!)

Here's a copy of my /etc/network/interfaces file. It is slightly different as I'm using /etc/wpa.conf to configure the wireless:

Code: Select all

auto lo wlan0
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
        wpa-conf /etc/wpa.conf
        pre-up ifdown eth0; echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
        post-down echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/bind
:D

pzc
Posts: 5
Joined: Sat Aug 18, 2012 4:36 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sat Aug 18, 2012 5:01 pm

PS. How about making this post sticky?!

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Really odd wifi behaviour! LXDE kills it...

Sat Aug 18, 2012 5:27 pm

I found that installing network-manager-gnome made my WiFi work in or out of the GUI. This worked fine until I tried to use it on the Lapdock.

Use the disable-ethernet script in the following post. See if this works to solve the WiFi problem. It did for my Lapdock. Runs automatically at boot.
http://www.raspberrypi.org/phpBB3/viewt ... 51#p127151
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

kaneg
Posts: 2
Joined: Thu Aug 16, 2012 4:51 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sun Aug 19, 2012 11:06 am

It works!
Thank you very much for your solution.
kaneg wrote:Interesting solution!

I have encountered the exact same issue with my D-Link dwl-g122 wifi card. I had thought it was caused by the lack of power, so tried a powered USB hub, but still not fixed. I have doubted the powered USB hub can't supply enough current. Now it seems it was caused by software.

I will try your method tomorrow and return you the result. :)
tangential wrote:Please find the contents of my /etc/network/interfaces file below:

Code: Select all

auto lo wlan0

iface lo inet loopback

iface eth0 inet static
        address 10.0.0.1
        netmask 255.255.255.0
        pre-up ifdown wlan0

iface wlan0 inet dhcp
        wireless-essid ********
        wireless-key ********
        wireless-rate 11M auto
        pre-up ifdown eth0; echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
        post-down echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/bind
YMMV.
Have a good one ;)

ninapat
Posts: 18
Joined: Wed Aug 01, 2012 4:15 pm

Re: Really odd wifi behaviour! LXDE kills it...

Sun Aug 19, 2012 1:30 pm

same probleme with openelec distribution :
you don't have /etc/network/interfaces and system fs are read only

Code: Select all

vi /storage/.config/autostart.sh

    RET=`ifconfig wlan0 1>/dev/null 2>&1 ; echo $? ;`
    if [ $RET -eq 0 ]
    then
        echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind
    fi

chmod +x /storage/.config/autostart.sh
    
reboot the system
perhaps a better solution

Return to “Troubleshooting”