# USB Wifi Dongle Issues FreeBSD 12.0



## newbsdkv (Jan 6, 2019)

Hello,

I'm having issues connecting to WiFi using my USB Wifi Adapter. Details below...

I'm running FreeBSD 12.0 Release. The device is a Hornet Tek N300 USB Lan Adapter. The machine sees it a "rtwn0". Following "man rtwn" and "man rtwn_usb" I have the following lines  in /boot/loader.conf

```
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
```
I have the following lines in /etc/rc.conf

```
wlans_rtwn0="wlan0"
ifconfig_wlan0="ssid ******** WPA SYNCDHCP"
```
I also have the following lines in  /boot/loader.conf for the encryption protocols

```
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
and finally I have the following in /etc/wpa_supplicant.conf

```
network={
    ssid="***********"
    psk="************"
}
```
I have rebooted my desktop a couple times with the above settings...

I've used the handbook as reference, and basically tried to follow it. However,I cannot get wifi to work. What should I be doing differently?

Thanks much!


----------



## Phishfry (Jan 6, 2019)

newbsdkv said:


> ifconfig_wlan0="ssid ******** WPA SYNCDHCP"


You do not need ssid for a wireless client connection. This is used when creating a FreeBSD Access Point

Diagnosis should include:
`ifconfig wlan0` <<< To check status of your interface
`ifconfig wlan0 scan` <<< To check if radio can see surrounding Access Points

One of our users has a page up for wireless setup as well.
http://srobb.net/fbsdquickwireless.html


----------



## Phishfry (Jan 6, 2019)

A good way to investigate what a usb stick is doing is to hotplug it.
Add your settings to their respective files, reboot and then plug in your USB device.
This will show you if the firmware is being loaded properly and other details.


----------



## SirDice (Jan 7, 2019)

You don't need these in loader.conf:

```
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
They are already loaded as part of the GENERIC kernel.


----------



## newbsdkv (Jan 8, 2019)

Hello,

Just wanted to give folks an update...

I got my wifi working but with a different dongle!

The original dongle was a Hornet Tek HT-WN300A N300 with a Realtek 8192 chipset. I had added the  drivers specified in rtwn(4) to /boot/loader.conf. Also, I had set up /etc/rc.conf to use rtwn0 as wlan0. With the above settings, rebooted the system. The dongle would scan all wifi networks in the neighborhood and report the ssid. However, it would not connect to the ssid in /etc/wpa_supplicant.conf ! It had errors connecting to the driver interface, when i used " wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf".

I then tried a different dongle- A Hornet Tek HT-WN300M N300. This had a Ralink RT5372L Chipset. I used the drivers specified in run(4) in boot/loader.conf. I made changes to /etc/rc.conf to use run0 as wlan0. Rebooted my system, and it connected to wifi right away!

In summary, this seems to me like a chipset/driver issue. Although, I'm not totally discounting any rookie mistakes on my part !

Thanks for all the responses. It was definitely helpful in figuring out the problem, and a good learning experience for me...

Cheers


----------



## SirDice (Jan 8, 2019)

newbsdkv said:


> I had added the drivers specified in rtwn(4) to /boot/loader.conf. Also, I had set up /etc/rc.conf to use rtwn0 as wlan0.


Regarding rtwn(4):

```
After you have read the license in /usr/share/doc/legal/realtek.LICENSE
     you will want to add the following lines to loader.conf(5):

           legal.realtek.license_ack=1
           rtwn-rtl8192cfwU_load="YES"
           rtwn-rtl8192cfwU_B_load="YES"
```
Did you actually do that? Especially the license agreement?


----------

