I recently switched to Dietpi for my audio endpoints and am very happy with it.
Only one of my PI’s has a TP-WN822n usb wifi adapter. It is a V3 type with a RTL8192CU chipset.
The problem is that it won’t connect with speeds over 72.2Mbit and with the stock Raspbian it connected with the full 300Mbit of which it is capable.
Must be a driver problem. Can anybody help me out?
Make sure you have set the Wifi country code for your country, enables channels and power ratings legal for your country: dietpi-config > Networking: Adapters > WiFi.
Can you please verify your router is running with a 40mhz channel width? Sometimes, if this is set to Auto, it can automatically flick between 20mhz and 40mhz without any indication, in which case, wifi speeds would be reduced.
To make it more interesting, I did a complete reinstall.
I added my wireless settings in dietpi.txt before first boot.
Started up the Pi and… it connected with 300Mbt…
It ran thru the first installation scripts and after the first reboot… back to 72.2Mbit…
Here’s the dump as per your request:
root@RPI-Keuken:~# iwconfig wlan0
wlan0 IEEE 802.11bgn ESSID:“Castlepoint”
Mode:Managed Frequency:2.427 GHz Access Point: E4:F4:C6:1C:4F:20
Bit Rate=65 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=58/70 Signal level=-52 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:1 Invalid misc:0 Missed beacon:0
Signal strength is a little low -52dBm. Just wondering if the NL country code is causing a unexplaned reduction in Wifi performance. Raspbian is set to GB as standard (naughty), which is the same channels and ratings for WiFi G, although, unsure for N so you may want to check your countries legislation for wireless N.
Can you please try the following:
Put the RPi in the same room and level as the router (eg: next to it). Power on and get the iwconfig wlan0 results
Just comes to mind. At first boot after a clean install, the wifi adapter is recognised as a TP-link device.
After the first reboot initiated by the install script it get’s a new ip from the dhcp server and is not recognised as a TP-link device.
root@RPI-Keuken:~# lsusb
Bus 001 Device 004: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Yep, very strange. DietPi doesn’t do anything that would cause this to happen during 1st run, at least, not from looking at source code and patch code.
the wifi adapter is recognised as a TP-link device
Is this from the router webpage, or obtained by lsusb (or another) ?
Also, are you using the v133 RPi image (eg: DietPi_v133*.img) ?
As far as i’am aware Raspbian (which DietPi for RPi is based on) pulls the MAC codes directly from the device. Although, there is probably a way to override that somehow, but will require the Google treatment (search).
I gave up and reverted back to plain Jessie lite.
Now the wifi adapter is working at the proper 300Mbit.
It is now back on the proper MAC address, the one it has before the first reboot when installing Dietpi.
Something is wrong with the setup. I don’t think it is the driver. Plain vanil;la Jessie uses the same.
It has something to do with the network setup. If I plug in a network cable, the cable and the WiFi share an ip/mac address and when I unplug the WiFi module, the Wlan0 stays online…
And this with a fresh unaltered install of v133…
I’ll keep monitoring the this thread when somebody comes up with something…
I do like the Dietpi. It is working nicely on other Pies in my home.