# Wlan help



## balanga (Jan 16, 2018)

I've never really bothered with wireless lan, but I'd like to see if I can get wi-fi working on my Z83 Mini-PC, but I don't know where to start.

Any pointers would be appreciated.


----------



## k.jacker (Jan 16, 2018)

What about the most obvious?
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html
There are also a bunch of threads on that topic in the forum allready, use the search function.


----------



## balanga (Jan 17, 2018)

After some reading, I'm not sure if I need to add anything to /boot/loader.conf

`dmesg`:-

```
iwn0: <Intel Centrino Advanced-N 6205> mem 0xf2400000-0xf2401fff irq 17 at device 0.0 on pci2
```
...so I guess it is recognised.

I'm using a ThinkPad T420 which has a switch at the side for Wi-Fi, but no LED comes on when I switch it on...

`pciconf -lcve`:-

```
iwn0@pci0:3:0:0:   class=0x028000 card=0x13118086 chip=0x00858086 rev=0x34 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Centrino Advanced-N 6205 [Taylor Peak]'
    class      = network
    cap 01[c8] = powerspec 3  supports D0 D3  current D0
    cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message
    cap 10[e0] = PCI-Express 1 endpoint max data 128(128) FLR RO NS
                 link x1(x1) speed 2.5(2.5) ASPM L1(L0s/L1)
    ecap 0001[100] = AER 1 0 fatal 0 non-fatal 0 corrected
    ecap 0003[140] = Serial 1 8c705affff64e5dc
```

After adding

```
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
```
to /etc/rc.conf, creating /etc/wpa_supplicant.conf:-

```
network={
   ssid=ssid
   psk=password
}
```
and running `service netif restart`
I end up with`ifconfig`:-
	
	



```
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
   ether 8c:70:5a:64:e5:dc
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
   status: no carrier
   ssid "" channel 1 (2412 MHz 11b)
   regdomain FCC country US authmode OPEN privacy OFF txpower 30
   bmiss 10 scanvalid 60 wme bintval 0
   groups: wlan
```

What have I overlooked?


----------



## Phishfry (Jan 17, 2018)

There is  nice ncurses tool you can use for that:
`bsdconfig wireless`

This is assuming you are trying to setup a wireless client.


----------



## Minbari (Jan 17, 2018)

Read Chapter 30. Advanced Networking for manual setting the wifi or if you prefer a graphical tool, try net-mgmt/networkmgr.


----------



## scottro (Jan 18, 2018)

man iwn suggests adding lines to /boot/loader.conf as well. 

https://www.freebsd.org/cgi/man.cgi....1-RELEASE+and+Ports&arch=default&format=html

If you have a hidden network, you have to add scan_ssid=1

I have  a quickstart guide to FreeBSD wireless at http://srobb.net/fbsdquickwireless.html


----------



## balanga (Jan 18, 2018)

Phishfry said:


> There is  nice ncurses tool you can use for that:
> `bsdinstall wireless`
> 
> This is assuming you are trying to setup a wireless client.



Thanks for the suggestion... although you probably meany `bsdinstall netconfig`...

Unfortunately I got an error saying that wpa_supplicant could not be started (or some such...)


----------



## balanga (Jan 18, 2018)

Minbari said:


> Read Chapter 30. Advanced Networking for manual setting the wifi or if you prefer a graphical tool, try net-mgmt/networkmgr.



That's the same reference as the first reply gave, which was a kickstart, but the '*status: no carrier*' msg suggests that something fundamental is missing...


----------



## Phishfry (Jan 18, 2018)

balanga said:


> although you probably meany  bsdinstall netconfig


Nope I meant what I said:


----------



## balanga (Jan 18, 2018)

Phishfry said:


> Nope I meant what I said:
> 
> View attachment 4311


`bsdinstall wireless` didn't do anything on my system and `man bsdinstall` didn't show wireless as an optional target...


----------



## balanga (Jan 18, 2018)

After running `ifconfig wlan0 up` the wifi led starts flashing and this msg pops up:-

```
iwn0: iwn_read_firmware: ucode rev=0x12a80601
```

`ifconfig wlan0 scan` displays all the nearby SSIDs...


----------



## Phishfry (Jan 18, 2018)

The manual mentions some firmware:
https://www.freebsd.org/cgi/man.cgi?iwn

Sorry I got the app name wrong.
`bsdconfig wireless`

bsdinstall * writes to a chroot and really don't work for an installed system.


----------



## balanga (Jan 18, 2018)

Phishfry said:


> The manual mentions some firmware:
> https://www.freebsd.org/cgi/man.cgi?iwn


I had a look, but it's unclear which driver goes with which card. I have Intel Centrino Advanced-N 6230 but can't work which is the correct driver.

In the end I added
	
	



```
if_iwn_load="YES"
       iwn1000fw_load="YES"
       iwn100fw_load="YES"
       iwn105fw_load="YES"
       iwn135fw_load="YES"
       iwn2000fw_load="YES"
       iwn2030fw_load="YES"
       iwn4965fw_load="YES"
       iwn5000fw_load="YES"
       iwn5150fw_load="YES"
       iwn6000fw_load="YES"
       iwn6000g2afw_load="YES"
       iwn6000g2bfw_load="YES"
       iwn6050fw_load="YES"
```
to /boot/loader.conf but it made no difference.



> Sorry I got the app name wrong.
> `bsdconfig wireless`
> 
> bsdinstall * writes to a chroot and really don't work for an installed system.



Good to know about this, but I get - '*Failed to reach wpa_supplicant*'.

After a number of searches it appears that:

*iwn0: iwn_read_firmware: ucode rev=0x12a80601*

is a common problem with FreeBSD 11, whereas the same card worked with previous versions.

One suggestion I came across was
	
	



```
legal.intel_iwn.license_ack=1 # loader.conf
```
 !!!


----------



## Phishfry (Jan 18, 2018)

Yes that is what you need. The license ack. I believe the firmware is now built in and the manpage is outdated.
Not sure though as I use Atheros wireless.


----------



## balanga (Jan 18, 2018)

The license ack doesn't seem to make any difference.... nor all the drivers here...

Guess it's time to put wlan on the back burner 

Strange, but the interface becomes active, since it will scan for nearby SSIDs, but seem unable to connect.


----------



## PacketMan (Jan 18, 2018)

balanga said:


> Strange, but the interface becomes active, since it will scan for nearby SSIDs, but seem unable to connect.



I only glanced over this discussion; that sounds like an authentication issue now. But I should ask, does it actually find SSIDs after scanning completes? This seems to suggest so:


balanga said:


> `ifconfig wlan0 scan` displays all the nearby SSIDs...


----------



## balanga (Jan 18, 2018)

Following your suggestion that it was an authentication issue, I switched on tethering on my phone with no password and was able to connect to it... so it looks like the *iwn0: iwn_read_firmware: ucode rev=0x12a80601  *msg must have been a red herring...

`dmesg` tells me
	
	



```
module iwn already present!
```
so, I should probably clean up /boot/loader.conf

I'll try again to connect wirelessly to the router, although I did check the password a number of times, assuming an authentication error would have been flagged as such.


----------



## balanga (Jan 19, 2018)

Can anyone explain what the differences are between these options for assigning IP an address to a WLAN interface?


```
#ifconfig_wlan0="DHCP"
#ifconfig_wlan0="WPA DHCP"
#ifconfig_wlan0="WPA SYNCDHCP"
```

How do I go about switching wifi access on and off? Is it just `ifconfig wlan0 up` and `ifconfig wlan0 down`?
I can't seem to have both interfaces active at the same time...


----------



## trev (Feb 13, 2018)

WPA use WPA key negotiation
DHCP get an IP address from a DHCP server (may timeout if the server is too slow)
SYNCDHCP forces the startup to wait until dhclient(8) returns



> How do I go about switching wifi access on and off? Is it just  ifconfig wlan0 up and  ifconfig wlan0 down?


 Works for me


----------



## Phishfry (Feb 13, 2018)

balanga said:


> ifconfig_wlan0="DHCP"


This would be used with your wireless card connect to the nearest Access Point with no encryption. Open WiFi Hotspots for example.


----------



## flipper_88 (Feb 22, 2018)

If you're running 11.x kernel you can al so use service netif restart


----------



## ronaldlees (Mar 1, 2018)

If you can see other access points in a scan, then it's probably an auth problem, as Phishfry wrote.  Easiest way to diagnose this is to run wpa_supplicant manually with the -dd option.  This will give boatloads of information, and tell you exactly where the problem is (most likely).  Something like:

`/usr/local/sbin/wpa_supplicant -i wlan0 -dd -c /etc/wpa_supplicant.conf -Dbsd`


----------



## flipper_88 (Mar 1, 2018)

In my case on My Hp Eleite Book 8470w Mobile Workstation it turned out to ber the following code on the /boot/loader.conf file

```
iwn_load="YES"

iwn6000fw_load="YES"
```

/etc/crazy.conf


```
ifconfig_iwn0="wlan0
ifconfig_wlan0=WPA SYNCDHCP"
```


```

```


----------



## hph (May 26, 2018)

I guess I've got a similar problem at hand, my NIC (Centrino Advanced-N 6205) shows erratic behavior.

Sometimes the startup works just fine, then again it shows "iwn0: iwn_intr: fatal firmware error".
Most of the time when I log on chrome works and after some time the wireless LED starts flickering
and the connection is lost although I didn't change my location or anything else.

I'll add my rc.conf, loader.conf and dmesg.boot later on, but at the moment I'm puzzled.


----------



## ronaldlees (May 27, 2018)

Just run wpa_supplicant with the -dd option.  That will tell you if the adapter driver is purposely disconnecting, or is more seriously misbehaving (like hardware problem).  If need further info, can run a separate machine in monitor mode and look at the RF packets individually.


----------



## balanga (Mar 23, 2019)

ronaldlees said:


> `/usr/local/sbin/wpa_supplicant -i wlan0 -dd -c /etc/wpa_supplicant.conf -Dbsd`



I was just about to say that I couldn't find the program, but reason was, it should have been - `/usr/sbin/wpa_supplicant`


----------



## freq (Sep 25, 2019)

Phishfry said:


> Yes that is what you need. The license ack. I believe the firmware is now built in and the manpage is outdated.
> Not sure though as I use Atheros wireless.


Sir, do you mind telling me which card you use that works well?


----------



## RedPhoenix (Sep 25, 2019)

Phishfry said:


> There is  nice ncurses tool you can use for that:
> `bsdconfig wireless`
> 
> This is assuming you are trying to setup a wireless client.


And if you like using a GUI, `wifimgr` is GREAT.


----------



## RedPhoenix (Sep 25, 2019)

freq said:


> Sir, do you mind telling me which card you use that works well?


Maybe you could start a new Thread, and ask there.  Not to discourage you, just it would be better organized and more helpful to people who are searching the Forums here.


----------



## Phishfry (Sep 28, 2019)

Here are my recommendations:
Atheros AR9280, AR9380(AR5BXB112 and AR5BHB112) and my WAP uses a AR9580 Mikrotek module.

Using these in some Dell laptops with only a half length slot.


			https://wikidevi.com/wiki/Atheros_AR5BHB112
		


Here is a Atheros desktop variant if that is what you need:
HP WPEA-113N (Found on ebay commonly)


			https://wikidevi.com/wiki/Gemtek_WPEA-113N


----------

