# TP-Link TL-WN725N issue with urtwn



## topcat (Jun 22, 2016)

Hi, I have a TL-725n v2 that I'm using with the urtwn(4) driver. The OS is FreeBSD 10.3 amd64, p5. It connects to the network successfully for about 10-15 mins, and everything works during this period. However, eventually the connection is dropped, the green led goes off, and then it never recovers till I reboot, or remove and reinsert the dongle in the USB port. The dongle is brand new, and is listed as supported in the urtwn(4) man page. FreeBSD detects it and reports a Realtek 8188EU chip.

1. Anyone successfully using this adapter with FreeBSD?
2. Since the driver is "almost" working, is there any help I can provide in debugging what's wrong?


----------



## DiscmanDaemon (Jun 24, 2016)

I have this exact wifi dongle and I am actually using it right now to post this  The only issues I've experienced with it is it occasionally seems to have difficulty recovering if you attempt to connect with an invalid wpa_supplicant.conf, reaching a state of endless, uninterruptable error. 

This makes me wonder if perhaps its not the driver, but something about your network that makes the connection reset or temporarilly become invalid every 15 to 20 minutes. The time frame puts DHCP lease renew at the top of my suspect list for causing this failure. Do you mind posting some of the configs of both your network and your driver? That would greatly assist in debugging. 

Hope that helped a little,
-Greg

P.S.
I've considered investigating the fail cases I've experienced with this driver, but I've had difficulty reproducing it with any reliability. Furthermore it only seems to occur when in association with one particular router, which again is why I suspect it may depend on network configs.


----------



## topcat (Jun 24, 2016)

I had it stay connected the whole day on my work network, so I suspect you're right. However none of my other devices, including another FreeBSD laptop using iwi(4) has any issues.

My rc.conf:

```
wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP -powersave -bgscan"
```

My wpa_supplicant.conf (with personal info removed):

```
network={
  ssid="X_VLAN"
  psk="******"
}

network={
  ssid="mynet"
  psk="***********"
}
```

The router is a Linksys EA3500. Incidentally, today the connection has been up for more than an hour as I type this. I'll keep monitoring it. I have also noticed that if there is any configuration error then wpa_supplicant can enter a loop and never recover.


----------



## DiscmanDaemon (Jun 24, 2016)

These all look good. I assume your loader.conf includes something like this as well then?:


```
if_urtwn_load="YES"
legal.realtek.license_ack=1
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
wlan_wpa_load="YES"
wlan_wpa2_load="YES"
wlan_scan_ap_load="YES"
```


----------



## wblock@ (Jun 24, 2016)

The last six are built into the GENERIC kernel already.  But WEP and TKIP are best avoided anyway.


----------



## topcat (Jun 24, 2016)

Thanks! I have only the first two lines in my /boot/loader.conf.


----------



## topcat (Jun 28, 2016)

Quick update. The adapter has been working quite stably even at my home now. Maybe there was some issue with the service the other night. I've tried it on five different networks so far and every one worked great. Thanks everyone for replying.

Now time to stun my geek friends with xmonad + xmobar


----------



## topcat (Jun 28, 2016)

I installed this machine to practice kernel programming on FreeBSD. Just got VM-to-VM remote debugging over a virtual serial line set up. Maybe I'll check out what happens when the driver gets into one of those loops mentioned above, if I can make it do that again.


----------



## Phishfry (Jun 28, 2016)

I think `wpa_supplicant` also retools the keys at a certain rate. Maybe consider that as a possible culprit.
My guess is you could run `wpa_supplicant` in debug mode to see what its doing. Just to eliminate that angle.

Have you checked out `wpa_cli status`.
https://www.freebsd.org/cgi/man.cgi?wpa_cli


----------



## topcat (Jun 29, 2016)

Are you referring to the group rekeying that happens periodically? I think the process is initiated by the access point, at least when `wpa_supplicant` is being run as a client. Many routers have a setting for this.


----------



## Phishfry (Jun 29, 2016)

I am not sure what goes on but rekeying sounds right. Not sure of the frequency. I just remember seeing entries with net/hostapd debug output which shows wpa_supplicant messages as well..


----------

