Solved Raspberry 3B+ and slow WiFi speed

Hello,

I have Raspberry 3B+ whis FreeBSD 12.0-RELEASE instaled on it.
Code:
# uname -a
FreeBSD 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  arm64

And I use WiFi USB bundle "COMFAST CF-WU810N RTL8188EUS chipset"
Code:
# kldstat | egrep 'rtwn|wlan'
12    1 0xffff000053441000    41000 if_rtwn_usb.ko
13    6 0xffff000053482000    71000 wlan.ko
14    1 0xffff0000534f3000    41000 rtwn.ko
17    1 0xffff000054800000    41000 wlan_wep.ko
18    1 0xffff000054841000    41000 wlan_tkip.ko
19    1 0xffff000054882000    41000 wlan_ccmp.ko
20    1 0xffff0000548c3000    41000 wlan_amrr.ko

It's work fine, only the speed of connection is 100Kb/sec and it doesn't grow.

Code:
# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 20:0d:b0:12:a2:ec
    inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
    groups: wlan
    ssid SerLanRT channel 2 (2417 MHz 11g ht/20) bssid c0:ac:54:46:62:f3
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc
    wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Code:
# cat /etc/rc.conf
#WLAN
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA inet 192.168.0.2 netmask 255.255.255.0 ssid SerLanRT mode 11b"

I have tried changing my card mode to 11b or 11g. But the speed of download/upload is always the same 100Kb/sec.

Code:
# ls -lh file.bin
-rw-r--r--  1 root  wheel   100M 22 Sep 16:06 file.bin

# scp file.bin 192.168.0.102:/home/user/Downloads
file.bin                                                    2% 2320KB   1.2MB/s   01:19
file.bin                                                    2% 2320KB   1.1MB/s   01:28
file.bin                                                    2% 2432KB   1.0MB/s   01:36
file.bin                                                    2% 2432KB 929.8KB/s   01:47
file.bin                                                    2% 2432KB 836.8KB/s   01:59
file.bin                                                    2% 2560KB 765.9KB/s   02:10
file.bin                                                 2% 2688KB 702.1KB/s   02:22 ET
file.bin                                               4% 4096KB  47.5KB/s - stalled -
file.bin                                               4% 4096KB  42.8KB/s - stalled -

Its started good but after then speed drops.
Can be a driver problem?
Or usb port does not have enough power for WiFi USB bundle?
 
Last edited by a moderator:
I had similiar problem with ral/rtwn USB WLANs - WLAN will work but it will be slow (only tested when cards were in AP/host mode).
Fix was found on the net somewhere (forgot where) - you need to load wlan_amrr kernel module.
Add to /etc/rc.conf:
Code:
# enable more than 1M for hostapd
kld_list="${kld_list} wlan_amrr"
 
Hello JohnnySorocil,
Yes you are right, it is wlan_amrr kernel module.
I have it in loader.conf
Code:
# cat /boot/loader.conf | grep amrr
wlan_amrr_load="YES"
But now I see that it's never bin loaded.
Only one time by hand.
From rc.conf it's work.

Thank you for your help.
 
Not sure why that happens. I am having it into rc.conf versus in loader.conf - in my case it is not needed during boot (before kernel starts reading rc.conf) and keeping it in loader.conf will result in little slower boot.
But glad to hear that you manage to fix it :)
 
I ran into the same issue. The fix worked, however on 12.1 with the Beaglebone Beagleboard and the Raspberry Pi 2 the system will panic and reboot if I try to download a big file from it. It'll start downloading then crash.

This is only since enabling wlan_amrr. Maybe it's disabled for a reason? Is anyone else running into this?

Edit: On the Beaglebone (maybe Pi 2 as well), if I unplug ethernet it does not panic and download stays steady. Though very slow, maybe 2-4Mbit/sec.

Edit-again: PI2 without Ethernet, same issue: Fatal kernel mode data abort: Translation Fault L2 on read

Edit-yet-again: RPI2 with RT8192 device (instead of RT5370) also panics the same way.

Edit-I-should-just-make-a-new-topic: I can read a file off the native SD card for the device just fine. I can iperf fine. I only get a panic if I am reading a file on a USB drive over wifi. Weird, I know. I don't need wlan_amrr to do it, but it crashes easier with it.
 
Back
Top