# cannot detect Wifi - Edimax EW7811un V2



## utternull (Jan 9, 2021)

Hello,

did troubleshooting


```
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen2.1: <Intel EHCI root HUB> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <Realtek Edimax N150 Adapter> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen2.2: <vendor 0x8087 product 0x8000> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x8087 product 0x8008> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Vimicro corp. Lenovo EasyCamera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (256mA)
ugen0.4: <Broadcom Corp BCM43142A0> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (0mA)
ugen0.5: <Generic USB2.0-CRW> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
```



> ```
> pwr=ON (500mA)
> 
> 
> ...




```
ifconfig
alc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=c319a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE>
    ether 20:1a:06:95:b0:8f
    inet 192.168.0.15 netmask 0xffffff00 broadcast 192.168.0.255
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
[CODE]cat /boot/loader.conf
# hw.syscons.disable=1
hw.psm.synaptics_support="1"
net.inet.ip.fw.default_to_accept="1"
entropy_cache_load="YES"
crypto_load="YES"
aesni_load="YES"
geom_eli_load="YES"
vfs.zfs.arc_max="512M"
vfs.root.mountfrom="zfs:tank/ROOT/initial"
zfs_load="YES"
legal.realtek.license_ack=1
if_rtwn_usb_load="YES"
if_rtwn_load="YES"
legal.realtek.license_ack=1
```


```
cat /etc/rc.conf
wlans_rtwn0="wlan0"
ifconfig_wlan0="DHCP"
```


```
sudo ifconfig wlan0 create wlandrev rtwn0
ifconfig: must specify a parent device (wlandev) when creating a wlan device
```


```
kldstat
Id Refs Address                Size Name
 1   74 0xffffffff80200000  2c0bb60 kernel
 2    1 0xffffffff82e0c000   3bacf0 zfs.ko
 3    2 0xffffffff831c7000     a448 opensolaris.ko
 4    1 0xffffffff831d2000     eed8 aesni.ko
 5    1 0xffffffff831e1000    1e7b0 geom_eli.ko
 6    1 0xffffffff83919000     87d0 tmpfs.ko
 7    1 0xffffffff83922000     35b4 geom_uzip.ko
 8    1 0xffffffff83926000     2e30 xz.ko
 9    1 0xffffffff83929000     1a20 fdescfs.ko
10    1 0xffffffff8392b000    103f0 fuse.ko
11    1 0xffffffff8393c000     2908 ums.ko
12    1 0xffffffff8393f000    3c4c0 linux.ko
13    3 0xffffffff8397c000     4b80 linux_common.ko
14    1 0xffffffff83981000    35ce0 linux64.ko
15    1 0xffffffff839b7000     4ea4 cuse.ko
16    1 0xffffffff839bc000   12bfbc i915kms.ko
17    1 0xffffffff83ae8000    75e30 drm.ko
18    4 0xffffffff83b5e000    13770 linuxkpi.ko
19    3 0xffffffff83b72000    13f30 linuxkpi_gplv2.ko
20    2 0xffffffff83b86000      6d0 debugfs.ko
21    1 0xffffffff83b87000     54fc linprocfs.ko
22    1 0xffffffff83b8d000    25360 ipfw.ko
```

is rtwn not loading?

I'm not sure what to do


----------



## T-Daemon (Jan 9, 2021)

utternull said:


> is rtwn not loading?


It looks that way.


utternull said:


> if_rtwn_usb_load="YES"


That should be enough to load the driver. Checked on 12.1-, 12.2-RELEASE, `kldstat` shows if_rtwn_usb.ko and rtwn.ko loaded. Which editor have you used to edit /boot/loader.conf? Execute `file /boot/loader.conf`, see if there is a reference to _line terminators_.


----------



## utternull (Jan 9, 2021)

T-Daemon said:


> It looks that way.
> 
> That should be enough to load the driver. Checked on 12.1-, 12.2-RELEASE, `kldstat` shows if_rtwn_usb.ko and rtwn.ko loaded. Which editor have you used to edit /boot/loader.conf? Execute `file /boot/loader.conf`, see if there is a reference to _line terminators_.


I used nano



> /boot/loader.conf: ASCII text


Would that cause an issue?
Should I stick to vi or editor?


----------



## obsigna (Jan 9, 2021)

T-Daemon said:


> It looks that way.
> 
> That should be enough to load the driver. Checked on 12.1-, 12.2-RELEASE, `kldstat` shows if_rtwn_usb.ko and rtwn.ko loaded. Which editor have you used to edit /boot/loader.conf? Execute `file /boot/loader.conf`, see if there is a reference to _line terminators_.


I thought the same, until I recognized the v2 tag. While even on these forums are notes that the original Edimax EW7811un does work using the driver for the RTL8192cu chipset (see https://forums.freebsd.org/threads/how-can-i-get-a-realtek-driver-for-freebsd.64389/#post-480681) there are many reports that the v2 one doesn’t even work under Linux, and all links to the downloads of drivers on the Edimax site which are available for Edimax EW7811un got a comment that these won’t work for v2. Edimax does even add insult to the harm by not telling in any specs what chipset these v2 thingy is operated by.

I am also looking for suitable USB-WLAN dongles, and I won’t buy any which does not clearly state in the specs, on which chipset it is based on. I would try to return the v2 since the original one (supposedly v1) seems to be still available.


----------



## utternull (Jan 9, 2021)

obsigna said:


> I thought the same, until I recognized the v2 tag. While even on these forums are notes that the original Edimax EW7811un does work using the RTL8192cu chipset (see https://forums.freebsd.org/threads/how-can-i-get-a-realtek-driver-for-freebsd.64389/#post-480681) there are many reports that the v2 one doesn’t even work under linux, and all links to downloaded of drivers on the Edimax site which are available for Edimax EW7811un got a comment that thses won’t work for v2. Edimax does even add insult to the harm by not even telling in any specs what chipset these v2 thingy is operated by.
> 
> I am also looking for suitable USB-WLAN dongles, and I won’t buy any which does not clearly state in the specs, on which chipset it is based on. I would try to return the v2 since the original one (supposedly v1) seems to be still available.


I saw on openbsd that urtwn supports  v2
assumed and freebsd as well


			urtwn(4) - OpenBSD manual pages
		



could be wrong.....

I wasted 4 hours+

I'll return the v2

Do you know any 100% workable usb dongles? I'm going through the forums now

I have a TL-WN822N coming in the mail... so hopefully that works

I'll look on amazon


......fml


----------



## obsigna (Jan 9, 2021)

utternull said:


> Do you know any 100% workable usb dongles? I'm going through the forums now



A few month ago, I bought a no-name dongle which is operated by Realtek’s RTL8188eu chipset. I use this in Host-AP mode with a Beaglebone Black running 13-CURRENT. It got no external antenna, and the signal strength is lacking. Therefore, I am looking for another one, which got an antenna.

For example this one, which employs Realtek’s RTL8811au and which seems to work with FreeBSD, although, I am not 100 % sure.
https://www.alibaba.com/product-detail/AC-600Mbps-DualBand-USB-WiFi-card_60738700693.html


----------



## utternull (Jan 9, 2021)

obsigna said:


> A few month ago, I bought a no-name dongle which is operated by Realtek’s RTL8188eu chipset. I use this in Host-AP mode with a Beaglebone Black running 13-CURRENT. It got no external antenna, and the signal strength is lacking. Therefore, I am looking for another one, which got an antenna.
> 
> For example this one, which employs Realtek’s RTL8811au and which seems to work with FreeBSD, although, I am not 100 % sure.
> https://www.alibaba.com/product-detail/AC-600Mbps-DualBand-USB-WiFi-card_60738700693.html


I need to find one that 100% works

I'll look up RTL8811au

Is there a list of known good chipsets?


----------



## obsigna (Jan 10, 2021)

I tend to look into the man files:

Realtek WLAN: rtwn(4). Therein listed chipsets are the generic ones, and the for the USB dongle version you would append an u.

Atheros WLAN: uath(4).


----------



## judd (Jan 10, 2021)

utternull said:
Do you know any 100% workable usb dongles?

WiFi Solved with → Adapter Nisuta 150 Mbps Wireless - Nano usb 802.11n - Model No. NS-WIU153N

Real chip <Realtek 802.11n WLAN NIC> at usbus0, cfg=0 md=HOST spd=HIGH (480 Mbps) pwr=ON (500mA)


----------



## obsigna (Jan 10, 2021)

judd said:


> … Adapter Nisuta 150 Mbps Wireless - Nano usb 802.11n - Model No. NS-WIU153N


That looks similar to the one which I got working here:

`dmesg | grep rtwn`

```
rtwn0 on uhub0
rtwn0: <Realtek 802.11n NIC, class 0/0, rev 2.00/0.00, addr 2> on usbus1
rtwn0: MAC/BB RTL8188EU, RF 6052 1T1R
rtwn0: rtwn_tx_beacon_check: cannot push beacon into chip, error 60!
rtwn0: unable to push beacon into the chip, error 60
rtwn0: rtwn_newstate: could not move to RUN state
```


----------



## wb7odyfred (Jan 13, 2021)

http://openbsd-archive.7691.n7.nabble.c ... 01834.html

Seems that openbsd has recompiled the rtwn driver to add support for this Edimax driver V2.
So update the FreeBSD driver with the new USB IDs 7932:b811  and recompile.

https://devicehunt.com/view/type/usb/vendor/7392 This list is missing the new Version 2 Edimax EW-7811un device RTL8188EU USB device ids 7932:b811


Notice that the Version 2 Edimax EW-7811un 7932:b811 uses a different RealTek device RTL8188EU than the Version 1 Edimax EW-7811un USB Ids 7932:7811 specifies a RTL8192cu chipset device.

It looks like this device is RTL8188EU based (not RTL8188CU like the 7811Un V1), since the linux driver they offer for download is called rtl8188EUS, so you'd add

URTWN_DEV_8188EU(EDIMAX, EW7811UNV2)

to the urtwn device list or if_rtwn_usb file device list.  Edit this file:
src/blob/main/sys/dev/rtwn/usb/rtwn_usb_attach.h
add your device Realtek to this section of the code file:




> /* RTL8188EU */#define RTWN_RTL8188EU_DEV(v,p) \
> 
> 
> 
> ...


Relative new FreeBSD post from
https://forums.freebsd.org/threads/cann ... ost-489571
https://forums.freebsd.org/threads/how- ... ost-480681 Wow here is my FreeBSD post on Edimax EW7811 version 1

[1]: https://www.mail-archive.com/bugs@openb ... 15706.html






                                Top


----------



## drs (Jul 28, 2021)

wb7odyfred said:


> Notice that the Version 2 Edimax EW-7811un 7932:b811 uses a different RealTek device RTL8188EU than the Version 1 Edimax EW-7811un USB Ids 7932:7811 specifies a RTL8192cu chipset device.
> 
> It looks like this device is RTL8188EU based (not RTL8188CU like the 7811Un V1), since the linux driver they offer for download is called rtl8188EUS, so you'd add
> 
> ...



Thanks for the info, that was a good starting point.
One thing I'd like to add is that you'll need to edit the usbdevs file too before you can compile the module.

Here's the list of steps I took in order to make the V2 work under 13.0 arm64 on an rpi 3b.

First, the two files needs to be edited, adding one line to each:


```
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # diff /usr/src/sys/dev/rtwn/usb/rtwn_usb_attach.h-orig /usr/src/sys/dev/rtwn/usb/rtwn_usb_attach.h
127a128
>       RTWN_RTL8188EU_DEV(EDIMAX,              EW7811UNV2),
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # diff /usr/src/sys/dev/usb/usbdevs-orig /usr/src/sys/dev/usb/usbdevs
1836a1837
> product EDIMAX EW7811UNV2     0xB811  EW-7811Un-V2
```

Then compile the module:


```
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # cd /usr/src/sys/modules/rtwn_usb
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # make

 /*** After a couple of minutes of compiling ***/

[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # mv /boot/kernel/if_rtwn_usb.ko /boot/kernel/if_rtwn_usb.ko-backup
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # cp /usr/obj/usr/src/arm64.aarch64/sys/modules/rtwn_usb/if_rtwn_usb.ko /boot/kernel
[root@pi3b !RW! /usr/src/sys/modules/rtwn_usb] # echo "if_rtwn_usb_load=\"YES\"" >> /boot/loader.conf
```

That's it.

Fortunately it works without buildkernel.
Please forgive me for "cp" the module instead of "make install" it.

Here's the working V2, after a reboot:


```
[root@pi3b !RW! ~] # freebsd-version -kru
13.0-RELEASE-p3
13.0-RELEASE-p3
13.0-RELEASE-p3
[root@pi3b !RW! ~] # uname -m
arm64
[root@pi3b !RW! ~] # usbconfig
ugen1.1: <DWCOTG OTG Root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x0424 product 0x9514> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA)
ugen1.3: <vendor 0x0424 product 0xec00> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
ugen1.4: <Realtek Edimax N150 Adapter> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

[root@pi3b !RW! ~] # usbconfig -d 1.4 dump_device_desc
ugen1.4: <Realtek Edimax N150 Adapter> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x7392 
  idProduct = 0xb811
  bcdDevice = 0x0000 
  iManufacturer = 0x0001  <Realtek>
  iProduct = 0x0002  <Edimax N150 Adapter>
  iSerialNumber = 0x0003  <08BEAC12EE74>
  bNumConfigurations = 0x0001 

[root@pi3b !RW! ~] # kldstat
Id Refs Address                Size Name
 1   25 0xffff000000000000  12092d8 kernel
 2    1 0xffff00000120a000    3b300 if_rtwn_usb.ko
 3    2 0xffff000001246000    40d38 rtwn.ko
 4    6 0xffff000001287000    7b560 wlan.ko
 5    1 0xffff000001304000    25808 umodem.ko
 6    2 0xffff00000132a000    28698 ucom.ko
 7    1 0xffff0000c9200000    22000 wlan_wep.ko
 8    1 0xffff0000c9222000    23000 wlan_tkip.ko
 9    1 0xffff0000c9245000    26000 wlan_ccmp.ko
10    1 0xffff0000c926b000    22000 mac_ntpd.ko

[root@pi3b !RW! ~] # dmesg|grep -i realtek
ugen1.4: <Realtek Edimax N150 Adapter> at usbus1
rtwn0: <Realtek Edimax N150 Adapter, class 0/0, rev 2.00/0.00, addr 4> on usbus1

[root@pi3b !RW! ~] # ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 08:be:ac:

 /*** mac/ip/ssid/etc. removed ***/

parent interface: rtwn0
        media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11ng
        status: associated
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```


Any chance something similar can find it's way into 13.0-p4 (or -p5)? 

Best


----------

