Page 1 of 1

Wifi issues

Posted: Sat Jul 05, 2014 12:08 pm
by musicboy
Someone else having wifi problems - using Edimax EW-7811UN.
I've trawled through various solutions but have had no luck so would appreciate some help :)

cat /etc/network/interfaces

Code: Select all

auto lo

iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.50
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
cat /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

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

network={
        ssid="my router's name"
        psk="my router's password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        auth_alg=OPEN
}
sudo ifup -v wlan0

Code: Select all

Configuring interface wlan0=wlan0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wait for wpa_cli to attach
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -W -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
Starting /sbin/wpa_supplicant...
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant: waiting for "/var/run/wpa_supplicant.wlan0.pid":  0 (max. 5)
wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan0
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
wpa_supplicant: /sbin/wpa_cli -B -P /var/run/wpa_action.wlan0.pid -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action
Starting /sbin/wpa_cli...
sudo ifdown -v wlan0

Code: Select all

Configuring interface wlan0=default (inet)
run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/upstart
run-parts: executing /etc/network/if-down.d/wpasupplicant
wpa_supplicant: terminating wpa_cli daemon via pidfile /var/run/wpa_action.wlan0.pid
Stopped /sbin/wpa_cli (pid 2974).
dhclient -v -r -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/80:1f:02:f1:e7:b1
Sending on   LPF/wlan0/80:1f:02:f1:e7:b1
Sending on   Socket/fallback
DHCPRELEASE on wlan0 to 192.168.1.254 port 67
ip link set dev wlan0 down
run-parts --verbose /etc/network/if-post-down.d
run-parts: executing /etc/network/if-post-down.d/avahi-daemon
run-parts: executing /etc/network/if-post-down.d/wireless-tools
run-parts: executing /etc/network/if-post-down.d/wpasupplicant
wpa_supplicant: terminating wpa_supplicant daemon via pidfile /var/run/wpa_supplicant.wlan0.pid
Stopped /sbin/wpa_supplicant (pid 2893).
wpa_supplicant: removing /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:7b:24:c6
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1906 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1419 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:182790 (178.5 KiB)  TX bytes:270631 (264.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:93 errors:0 dropped:0 overruns:0 frame:0
          TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9144 (8.9 KiB)  TX bytes:9144 (8.9 KiB)

wlan0     Link encap:Ethernet  HWaddr 80:1f:02:f1:e7:b1
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:42 errors:0 dropped:2 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6049 (5.9 KiB)  TX bytes:12425 (12.1 KiB)

iwconfig

Code: Select all

wlan0     unassociated  Nickname:"<[email protected]>"
          Mode:Managed  Frequency=2.462 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

eth0      no wireless extensions.

Thanks in advance :)

Re: Wifi issues

Posted: Sat Jul 05, 2014 1:08 pm
by MrEngman
Have you tried

Code: Select all

sudo ifup --force wlan0
or

Code: Select all

sudo ifdown wlan0
sudo ifup --force wlan0
EDIT: Just noticed, must get some new spectacles, add line

Code: Select all

allow-hotplug wlan0
immediately before line

Code: Select all

iface wlan0 inet manual
in your file /etc/network/interfaces.


MrEngman

Re: Wifi issues

Posted: Sat Jul 05, 2014 3:19 pm
by musicboy
Thanks Mr Engman :)
I added that line and it now works fine, I can ssh it from other devices in the network.
However, when I try to ping google.com I get

Code: Select all

Connect: Network is unreachable
This puzzled me so I tried it with ethernet and got the following

Code: Select all

ING google.com (173.194.34.68) 56(84) bytes of data.
From mypi.home (192.168.1.50) icmp_seq=1 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=2 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=3 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=4 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=5 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=6 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=7 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=8 Destination Host Unreachable
From mypi.home (192.168.1.50) icmp_seq=9 Destination Host Unreachable
^C
--- google.com ping statistics ---
11 packets transmitted, 0 received, +9 errors, 100% packet loss, time 10076ms
pipe 4
Thanks in advance.

Re: Wifi issues

Posted: Sun Jul 06, 2014 1:11 pm
by hhoanganh
you can check DNS at resolv.conf file on /etc,

Re: Wifi issues

Posted: Sun Jul 06, 2014 8:02 pm
by musicboy
This is what /etc/resolv.conf contains:

domain home
search home
nameserver 192.168.1.254

Also wifi doesn't connect on boot, I have to connect it to ethernet, ssh it then manually bring the wifi up. It then doesn't stay on for more than a few minutes.
I also now cannot ssh it over ethernet using mypi.home, which I used to be able to do, I can only ssh it via it's IP.

Re: Wifi issues

Posted: Sun Jul 06, 2014 8:35 pm
by MrEngman
Not sure why your wifi won't come up when you reboot. I've seen this on the odd occation but usually only after upgrading the firmware or when changing network settings, but then running command sudo ifup --force wlan0 brings it up and then when rebooting it starts up OK.

To stop it from shutting down/disconnecting you should try this. Create a file /etc/modprobe.d/8192cu.conf and add the contents

Code: Select all

# Disable power management
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
You can make the file using the nano text editor with the command

Code: Select all

sudo nano /etc/modprobe.d/8192cu.conf
and then add the content above. Save the file using keys, cntl-x, y, enter. This disables power management for the EW7811Un as the normal power management you see if using commands like iwconfig appear to have no effect with the Realtek based wifi modules, and stops it shutting down it's USB connection.


MrEngman

Re: Wifi issues

Posted: Mon Jul 07, 2014 6:34 am
by hhoanganh
I usually use 8.8.8.8 on resolv.conf file
here is my interfaces
auto lo

iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
gateway 192.168.1.1

allow-hotplug wlan0 eth0
auto wlan0
iface wlan0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
gateway 192.168.1.1
wpa-passphrase "wifi pw"
wpa-ssid "wifi id"
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
wireless-power off
This is wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="wifi id"
scan_ssid=1
psk="wifi pw"
proto=RSN
key_mgmt=WPA-PSK
pairwise=TKIP
auth_alg=OPEN
}