# losing wlan connection after portmaster updates



## koshamo (Jan 22, 2018)

Hi there,

I have a strange issue with my Lenovo E470 laptop. I use this box with an external USB wlan stick TP-Link TL-WN725N.

I set up this box in early summer 2017 and worked on it without any updates and any issues. I sometimes had a system up-time of more than 3 months without any network issues. In December I decided to update some ports using portsnap and portmaster.
After this update I sometimes lost wlan connection to my router, which I could fix doing

```
% service netif restart
% service routing restart
```
As the problems continued to show, I did a base system update using freebsd-update.

When I lose wlan connection to my router, I can switch to ttyv0 and see the message

```
urtwn0: ieee80211_crypto_encap returns null
```
.
This message continues to show up with every single network access I try.

I had this kind of issue before. I set up this laptop with FreeBSD, as I just bought it. Everything run fine until the day I started to update my ports with portmaster. With every single update session the issues became more till the day no network connection was able to establish. This finally had been the reason to newly set up the laptop.

And, by the way:

```
jochen@freebsd:~ % uname -a 
FreeBSD freebsd.tp 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
```
I use the default generic kernel.

Any ideas, why the network connection runs just fine without any losses, as long as I have a freshly set-up system with several ports installed and the problems start as soon as I start to update the system with portmaster?

I didn't attach any config files, as they haven't been changed during the update process and the same config files lead to a running system till updating the ports.

thanks,
Jochen


----------



## SirDice (Jan 23, 2018)

Update the system itself, you're a couple of patches behind. You should be running 11.1-RELEASE-p6 now.

And if you use the default options I would recommend using pkg-upgrade(8) instead. There's nothing to gain by building from ports if you're going to stick to the defaults.


----------



## koshamo (Jan 23, 2018)

```
root@freebsd:/home/jochen # freebsd-update fetch 
Looking up update.FreeBSD.org mirrors... 3 mirrors found. 
Fetching metadata signature for 11.1-RELEASE from update4.freebsd.org... done. 
Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. 

No updates needed to update system to 11.1-RELEASE-p6. 
root@freebsd:/home/jochen # freebsd-update install 
No updates are available to install. Run '/usr/sbin/freebsd-update fetch' first. 
root@freebsd:/home/jochen # uname -a 
FreeBSD freebsd.tp 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
```

So, how to do the update?


----------



## koshamo (Jan 23, 2018)

ok, it seems, I am up to date:

```
# freebsd-version -k 
11.1-RELEASE-p4 
# freebsd-version -u 
11.1-RELEASE-p6
```

But the issue described above isn't to be vanished -- the opposite is true, wlan connection is getting more and more itchy


----------



## koshamo (Feb 2, 2018)

No one any idea?
The issue is still there and the wlan connection very slow most of the time and this crypto encap thing still happens quite regularly


----------



## cjm (May 12, 2018)

This won't be much help right now but I ran into the same situation with an Edimax USB WLAN adapter recently. The underlying chipset, RTL8188CUS, is from Realtek and those are rather on the low end.

Based on the discussion in https://forums.freebsd.org/threads/need-wireless-usb-dongle-recommendation-with-good-range.63960/ I just ordered another USB WLAN adapter with a Ralink RT5370 chipset.

BTW, I replaced a Realtek USB WLAN module in a BananaPI R1 with a Ralink module some time ago and it was rock solid after that. That R1 was running OpenWRT, though, so no guarantees apart from the fact the Realtek sucks in Linux, too.

I can post my results in a few days if you're interested. If I should fail to do so, please feel free to ping me on this thread.

Thanks,
--Christina


----------



## koshamo (May 16, 2018)

as far as I see, at least with my crypto encap thing, this has something to do with the actual wlan signal. As soon as I care for better signal coming through, the crypto encap thing vanishes.
I found some electrical issue between my laptop and my router, which weakened the wlan signal. The signal actually came through, but it seemed to had several losses, so the connection got interrupted. And this interrupt seemed to produce the crypto encap message and disturbed the network from working.


----------



## cjm (May 17, 2018)

Just tried the RT5370-based dongle and it worked only in 11g mode (54Mbps raw), no HT or HT40. On the positive side, it dropped almost no packets with a "ping -f". However, my system crashed completely after a while so I gave up on that one. Other USB devices have crashed my system before, maybe adding/removing USB devices in general triggers some problem in the USB stack over time.

Regarding the RTL8188CUS: my router is around 10" away and the signal strength was good in my case. The Edimax has really bad reception but I plugged it into a cable and positioned it such that it had good reception.


----------

