TP-Link wireless USB adapter setup on Debian

I was using TP-Link WN725N on Raspberry Pi, it worked smoothly well even without any additional configurations. While when I plugged it on a Debian desktop, I noticed that the adapter cannot work at all.

It took me about 2 days to fix this issue. Here comes a step by step guide, may it help you.
If you face this issue on Ubuntu,  this guide should help you as well.

Firstly, we need to upgrade driver for TP-Link WN725N.

The latest driver can be downloaded from Realtek.com. To install the driver, we just need to run the script install.sh. This script will compile a kernel module named “8192cu”, we need to replace this module with the default one “rtl8192cu” in Debian wheezy, like this:

root# echo 'blacklist rtl8192cu’ >> /etc/modprobe.d/fbdev-blacklist.conf
root# echo 8192 >> /etc/modules

When the new driver installed, you don’t have to reboot, as we have additional steps to go.

Then config the Wireless USB adapter

There are two ways to config wireless network, use /etc/network/interface, or use /etc/NetworkManager.We can only choose one way, as they two cannot work with each other. Here we use the most common way by editing interface, like this,

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

allow-hotplug wlan0
     iface wlan0 inet dhcp
     wpa-ssid “admon.org"
     wpa-psk “KL123PDwsx95"

Make sure you have uninstalled NetworkManager.

Now when you have setup a wireless USB adapter, and it can work after a reboot. But the wireless connection is not so reliable, you can check that by ping, like this:

achen-mac:~ achen$ ping 192.168.10.142
PING 192.168.10.142 (192.168.10.142): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
64 bytes from 192.168.10.142: icmp_seq=2 ttl=64 time=159.917 ms
64 bytes from 192.168.10.142: icmp_seq=3 ttl=64 time=5.625 ms
64 bytes from 192.168.10.142: icmp_seq=4 ttl=64 time=6.208 ms
64 bytes from 192.168.10.142: icmp_seq=5 ttl=64 time=123.760 ms
64 bytes from 192.168.10.142: icmp_seq=6 ttl=64 time=761.257 ms
64 bytes from 192.168.10.142: icmp_seq=7 ttl=64 time=169.115 ms
^C
--- 192.168.10.142 ping statistics ---
8 packets transmitted, 6 packets received, 25.0% packet loss
round-trip min/avg/max/stddev = 5.625/204.314/761.257/257.749 ms

Meanwhile, there are warning messages in dmesg like this:

[   84.034365] rtl8192c_dm_RF_Saving(): RF_Normal
[   84.034368] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[  102.068571] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[  102.068692] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[  116.096245] rtw_set_ps_mode(): Enter 802.11 power save mode...
[  116.096251] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[  118.100174] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[  118.100299] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[  140.143583] rtw_set_ps_mode(): Enter 802.11 power save mode...
[  140.143589] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[  428.712338] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[  428.712464] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[  430.720855] rtl8192c_dm_RF_Saving(): RF_Save
[  432.720083] rtw_set_ps_mode(): Enter 802.11 power save mode...
[  432.721290] rtl8192c_dm_RF_Saving(): RF_Normal
[  432.721294] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2

That’s the adapter is dropping connections because of power save. we can disable it by creating a file with this line,

# echo options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 > /etc/modprobe.d/8192cu.conf

Now finally you are all set. It’s time to reboot to make all the changes take effect.

Share Button

Leave a comment

Your email address will not be published. Required fields are marked *