dchao99
Posts: 45
Joined: Fri Jan 15, 2016 9:26 pm

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Wed Oct 12, 2016 1:13 pm

I'm running the latest kernel 4.4.21. Nope, you can not use the bundled new Realtek driver with the modified hostapd. Instead, you must use the original hostapd and nl80211 driver.
Put:
drive=nl80211
back in your .conf file.
If you don't the WPA authorization will fail.

macmpi
Posts: 38
Joined: Tue Dec 15, 2015 9:39 pm

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Wed Oct 12, 2016 1:34 pm

epoch1970 wrote:rtl8188eu might be another kind of beast?
Indeed rtl8188eu requires an updated driver rather than kernel's staging one: MrEngman's, based on rtl8188eus_linux_v4.3.0.8 is required here.
However, on the hostapd side of things, same conclusion as yours: it just works with baseline hostapd v 2.3 in 4.4.x Raspbian; no need for custom-built hostapd anymore.
Only requirement is driver=nl80211 statement in hostapd.conf

Thanks @epoch1970 for your discovery!

mixpc
Posts: 21
Joined: Sun Mar 04, 2012 4:40 pm

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Wed Nov 09, 2016 1:13 pm

@epoch1970 Hi, thanks for your success feedback! However, you mention driver=nl80211 for chip 8192cu. Would the same driver work for RTL 8188CUS?
I am willing to go on an try it as well but advice is appreciated. My current setting is:

Code: Select all

[email protected]:~ $ uname -a
Linux raspberrypi 4.4.27+ #917 Tue Oct 25 15:51:38 BST 2016 armv6l GNU/Linux

[email protected]:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

[email protected]:~ $ lsb
lsblk        lsb_release
[email protected]:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

[email protected]:~ $ dmesg
...
[  490.732098] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[  490.834266] usb 1-1.2: New USB device found, idVendor=050d, idProduct=1102
[  490.834309] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  490.834333] usb 1-1.2: Product: 802.11n WLAN Adapter
[  490.834351] usb 1-1.2: Manufacturer: Realtek
[  490.834370] usb 1-1.2: SerialNumber: 00e04c000001
...
050d  Belkin Components
    1102  F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CUS]



epoch1970
Posts: 3339
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Wed Nov 09, 2016 2:37 pm

You're mixing chipset and driver name...
My Edimax device uses the RTL8188CUS chipset, so yes, I think you should be fine.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

mixpc
Posts: 21
Joined: Sun Mar 04, 2012 4:40 pm

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Thu Nov 10, 2016 4:16 pm

Well, success and no. I'll explain:

I follow this guide https://frillip.com/using-your-raspberr ... h-hostapd/ because it takes hostapd+dnsmasq and seemingly dnsmasq takes less resources from my Raspberry Pi 1 Model B (256 RAM).

The advice regarding driver is great (thank you!) because ssid is being broadcasted after running

Code: Select all

[email protected]:~ $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 08:86:3b:a7:9e:e5 and ssid "Pi3-AP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
So great, @epoch1970 ! Because now the WiFi can act as an AP! :)

However, anything else from that poing onwards seems not to work the way it is expected and so no I cannot get the Raspberry Pi to act as an AP.

FYI, and before posting I have done more tests and followed info from
https://wiki.debian.org/HowTo/dnsmasq
http://www.daveconroy.com/turn-your-ras ... s-chipset/
and other threads in this forum with the result no no additional success.

Could you kindly give further advice? This a Linux newbie here.

Here are the files I have tweaked following the guide I mentioned above
https://frillip.com/using-your-raspberr ... h-hostapd/

BTW, I am running a OpenVPN. I don't know if that may have an impact in the way I should get my AP configured.

Code: Select all

cat sudo nano /etc/dhcpcd.conf

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

denyinterfaces wlan0

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
::: interface eth0
    static ip_address=192.168.100.100/24
    static routers=192.168.100.1
    static domain_name_servers=192.168.100.1

Code: Select all

sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

# allow-hotplug wlan0
#iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.101.1
    netmask 255.255.255.0
    network 192.168.101.0
    broadcast 192.168.101.255
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

cat sudo nano /etc/hostapd/hostapd.conf

# This is the name of the WiFi interface we configured above
interface=wlan0

# Use the nl80211 driver with the brcmfmac driver
driver=nl80211

# This is the name of the network
ssid=Pi3-AP

# Use the 2.4GHz band
hw_mode=g

# Use channel 6
channel=6

# Enable 802.11n
ieee80211n=1

# Enable WMM
wmm_enabled=1

# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

# Accept all MAC addresses
macaddr_acl=0

# Use WPA authentication
auth_algs=1

# Require clients to know the network name
ignore_broadcast_ssid=0

# Use WPA2
wpa=2

# Use a pre-shared key
wpa_key_mgmt=WPA-PSK

# The network passphrase
wpa_passphrase=raspberry

# Use AES, instead of TKIP
rsn_pairwise=CCMP

Code: Select all

sudo nano /etc/default/hostapd

# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF=""
#MANUEL LA LINEA DE ARRIBA ESTABA COMENTADA DESACTIVA Y AHORA LA DEJO COMO
DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

Code: Select all

sudo nano /etc/dnsmasq.conf

interface=wlan0      # Use interface wlan0
listen-address=192.168.101.1 # Explicitly specify the address to listen on
bind-interfaces      # Bind to the interface to make sure we aren't sending thi$
server=8.8.8.8       # Forward DNS requests to Google DNS
domain-needed        # Don't forward short names
bogus-priv           # Never forward addresses in the non-routed address spaces$
dhcp-range=192.168.101.2,192.168.101.10,1h

Code: Select all

sudo nano /etc/sysctl.conf

net.ipv4.ip_forward=1
Hashed # code from /etc/sysctl.conf has been removed

Code: Select all

cat /etc/iptables.ipv4.nat 

# Generated by iptables-save v1.4.21 on Thu Nov 10 15:38:07 2016
*filter
:INPUT ACCEPT [338:32522]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [228:27392]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Thu Nov 10 15:38:07 2016
# Generated by iptables-save v1.4.21 on Thu Nov 10 15:38:07 2016
*nat
:PREROUTING ACCEPT [3:870]
:INPUT ACCEPT [3:870]
:OUTPUT ACCEPT [4:272]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Thu Nov 10 15:38:07 2016
Thank you once more for your reading time!

User avatar
bensimmo
Posts: 4125
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Thu Nov 10, 2016 5:46 pm

In iptables seems to have a lot of repeats and an IP address that is neither of your eth0 or wlan0

What state is it working/not working at
1) cannot connect to it via wi-fi.
2) connecting but not given an IP.
3) connect, given IP, but does not route to Ethernet and etc..

User avatar
bensimmo
Posts: 4125
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Thu Nov 10, 2016 5:49 pm

This (adafruit) has been updated recently.
Since it's an all in one setup with plenty of links.
Good chance it might work.
I would start from a nice fresh setup.

mixpc
Posts: 21
Joined: Sun Mar 04, 2012 4:40 pm

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Thu Nov 10, 2016 7:01 pm

Thank you for your reply. Well, the line

Code: Select all

-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
in iptables must be related to tun0 device (in OpenVPN)

Code: Select all

[email protected]:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:86:81:21
          inet addr:192.168.100.100  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::723e:2840:ab2f:22da/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10537 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2435 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1106636 (1.0 MiB)  TX bytes:310543 (303.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:119 errors:0 dropped:0 overruns:0 frame:0
          TX packets:119 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:8920 (8.7 KiB)  TX bytes:8920 (8.7 KiB)
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP 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:100
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 08:86:3b:a7:9e:e5
          inet addr:192.168.101.1  Bcast:192.168.101.255  Mask:255.255.255.0
          inet6 addr: fe80::a86:3bff:fea7:9ee5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:22 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2392 (2.3 KiB)  TX bytes:1176 (1.1 KiB)

As you can see the wlan0 is being assigned an ip address 192.168.101.1 so that is working.

Regarding your list, I am in step 2 since I can see the ssid from my mobile phone but cannot connect to it (the AP) via Wi-Fi

The ethernet connection from my Raspberry Pi to my home router is ok:

Code: Select all

[email protected]:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=26.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=26.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=26.2 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=26.3 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=26.5 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 26.256/26.460/26.685/0.211 ms
Regarding the adafruit page, I assume you refer to
https://learn.adafruit.com/setting-up-a ... t?view=all
that was updated in September. I will have a look at it even though I would prefer the other dns server (not isc) as it takes less resources.

Regards and thank you once more!

User avatar
bensimmo
Posts: 4125
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: WIFI Dongle Edimax EW7811UN not working after last updat

Thu Nov 10, 2016 8:50 pm

Yes, it thought I had added the link, oops.

I mention it as in the comments on one of the examples (the older one), it mentioned to use that if the IPs are in a different range for the eth and wlan.

Return to “Troubleshooting”