# RTL8192EU NIC - Slow connection



## eomad (Apr 25, 2021)

I have a Realtek RTL8192EU USB NIC and the transfer (download) speed is very slow (maximum of 200k/s). On Linux I get a medium speed of 1000k/s, which is what I would expect and also matches up with the output of `speedtest-cli`.

* dmesg
* ifconfig

in /etc/rc.conf I have:

```
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
create_args_wlan0="country BR regdomain FCC"
```


----------



## Alexander88207 (Apr 25, 2021)

Hello, eomad

i just wanted to let you know that the realtek driver only supports 802.11a and 802.11g. At these frequencies a better antenna alignment alone makes small or even big differences if your NIC have one. But you should be able to reach your medium speed of 1000k/s.

I assume that you are not sitting directly in router range?

How good is the ping to the router?


----------



## eomad (Apr 25, 2021)

My NIC doesn't have an external antenna. And yes, I'm not in direct router range, but still pretty close to the router physically.
A ping to the router takes in average 13ms.


----------



## Alexander88207 (Apr 25, 2021)

In the logs (ssid JOAO channel 2 (2417 MHz 11g) i see you are using 802.11g which is 2.4GHz, it should work better with 802.11a -5GHz by adding "`mode 11a`" to your `ifconfig_wlan0`.

`ifconfig_wlan0="WPA SYNCDHCP mode 11a"`

For that switch a full reboot is not needed, `service netif restart` is sufficient.


----------



## eomad (Apr 25, 2021)

Alexander88207 said:


> it should work better with 802.11a -5GHz by adding "`mode 11a`" to your `ifconfig_wlan0`.
> 
> `ifconfig_wlan0="WPA SYNCDHCP mode 11a"`
> 
> For that switch a full reboot is not needed, `service netif restart` is sufficient.


If I add that I get: `ifconfig: SIOCSIFMEDIA (media): Device not configured` and if I run `ifconfig wlan0` it still says it's in 11g mode.
After that wpa_supplicant also seems to fail and I get errors about USB device descriptors, the device gets disconnected and I have to manually unplug it and plug it again.


----------



## Alexander88207 (Apr 25, 2021)

Even with a reboot?


----------



## eomad (Apr 25, 2021)

At first I tried rebooting actually (didn't see your edit). I tried restarting the service as well and that also didn't work.
And I am on FreeBSD 13, if that matters.


----------



## Alexander88207 (Apr 25, 2021)

If 11a should really not work then unfortunately, I have no more ideas what we could do.

I also had my problems with WLAN and have now just grabbed the LAN cable.


----------



## scottro (Apr 25, 2021)

I've found, with various cards, mostly Intel, some Atheros, that FreeBSD is nowhere near Linux, as far as wireless speed goes. There are less people to work on it, (is there only one?), and so on. Unfortunately, as it stands right now, Linux seems to have around 10x, or more,  the wireless speed of FreeBSD.

I've seen some people on these forums  get good speed with some Atheros cards, but I don't remember who or when.
The one machine I have with an Atheros wireless is a Dell tower, which I use with wired ethernet. (I did try wireless at some point, but this particular, much older card, couldn't even connect to the 5G network.).

However, even with the much slower wireless speed, I've been able to watch youtube videos, and, using the patovm04's tutorial about setting up brave-browser with Linux emulation to watch Netflix, Amazon Prime video and Netflix have also played  without problems.


----------



## eomad (Apr 25, 2021)

I am also trying to get the NDIS driver to work, but when I try to load the module I get a kernel panic (page fault).


----------



## eomad (Apr 25, 2021)

Could anybody please recommend me a cheap WiFi USB adapter that works great on FreeBSD?


----------



## obsigna (Apr 25, 2021)

I am using a cheap RTL8188eu dongle in AP mode with a BeagleBone Black running FreeBSd 13.0-RELEASE. I see you are from Brazil, and actually it is this one:








						Adaptador Sem Fio Wi-fi Usb Rtl 8188 Dongle - R$ 43,82
					

ROBOBUILDERS ME> Produtos a pronta entrega;> Todos os produtos com garantia e Nota Fiscal;> Envio em até 24 horas úteis após a confirmação da compra;> Suporte técnico especializado com engenheiro da...




					produto.mercadolivre.com.br
				




Note: Don’t buy it before you read my final note.

Initially, I had also problems to achieve descent transfer rates, it always stuck at exactly 100 kByte/s and here read _‚exactly‘_ exactly as_ ‚exactly‘_, i.e. 100 ± 0.1 kByte/s. And this already was a strong hint that some rate adjustment told the chip to stay at this rate.

I stumbled across the contribution of Nicola Mignotti here in the forum, and he found the switch:








						Solved - Wifi AP too slow
					

Hi guys, I have this problem I can not sort out, I hope you can give me some ideas.  The story is I made an Wireless Access point in FreeBSD-11.1 running in an BeagleBone Black. My wifi adapter is an Alfa AWUS036HN, recognized as "run0", 802.11g. [n not available] The thing works, the olny...




					forums.freebsd.org
				




Load all necessary kernel modules, in order to make sure, that wlan_amrr is really loaded and not dropped because of a missing dependency (this seemed to have happened to me at the beginning). So add to /boot/loader.conf:

```
...
rtwn_load=YES
wlan_load=YES
wlan_amrr_load=YES
wlan_xauth_load=YES
wlan_wep_load=YES
wlan_tkip_load=YES
wlan_ccmp_load=YES
if_rtwn_usb_load=YES
```

Then in /etc/rc.conf place something like the following:

```
wlans_rtwn0="wlan0"
create_args_wlan0="country BR regdomain ETSI roam:rate 54Mb/s"
```

54MB/s is the rate specifier for 11g-mode. My RTL8188eu may be operated in 11n-mode, and here I use the MCS rate specifier index 7. This equates to a single channel rate of 72 MBit/s. In order to achieve dual channel (40 MHz bw) rate of 144 MBit/s, I need to add the systctl flag dev.rtwn.0.ht40=1 to /boot/loader.conf. However, I was not able to check, whether this really gives a boost, since all my peers (Macs) operate in 20 MHz bw only.

Final note: I do not exactly recommend the above mentioned dongle. It becomes quite hot during operation, and because of the missing external antenna the access range is limited. The chipset itself seems to be well supported by FreeBSD 13. Perhaps, you want to look out for a dongle having an external antenna.


----------



## eomad (Apr 26, 2021)

obsigna said:


> I am using a cheap RTL8188eu dongle in AP mode with a BeagleBone Black running FreeBSd 13.0-RELEASE. I see you are from Brazil, and actually it is this one:
> 
> 
> 
> ...


I added all of those modules and that sysctl to /boot/loader.conf as well as adding the roam option to /etc/rc.conf, but the options either don't work or when they do work I still get a slow speed.
From the output of `ifconfig` I can see that the interface is in simplex mode (that doesnt show up under Linux). Is it possible to enable duplex mode?


----------



## obsigna (Apr 26, 2021)

Please show the output of `# ifconfig wlan0`


----------



## eomad (Apr 29, 2021)

obsigna said:


> Please show the output of `# ifconfig wlan0`


Sorry for the late reply

* ifconfig wlan0
* ifconfig wlan0 list roam list regdomain
* iperf3

Also, as opposed to your case where the speed would stay at 100kb/s, it occilates constantly, sometimes getting close to 220kb/s but most of the time it runs at ~ 160kb/s.


----------

