No Wi-Fi

Megameneer

Member


Messages: 27

Hello everybody,

When my father changed the router this year, my FreeBSD laptop suddenly didn't have a wifi connection anymore. I checked it with another wifi-device and that device couldn't scan the network as well on FreeBSD, but it could do on Linux.
My /etc/rc.conf:
Code:
hostname="Zeebaars"
wlans_wpi0="wlan0"
ifconfig_wlan0="WPA DHCP"
sshd_enable="YES"
dumpdev="AUTO"
hald_enable="YES"
dbus_enable="YES"
devfs_system_ruleset="system"
cupsd_enable="YES"

My /etc/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
ssid="triple checked this one"
psk="triple checked this one too"
priority=5
}
network={
priority=0
key_mgmt=NONE
}

In my humble opinion, it shouldn't be that hard to switch networks, right? All my devices support the new network but why does FreeBSD do so difficult...

But thanks in advance for your support
 

wblock@

Beastie Himself
Developer

Reaction score: 3,729
Messages: 13,851

Why are you setting or overriding the default values? I would remove all that, plus the last network setting with no SSID, and try again:
Code:
ctrl_interface=/var/run/wpa_supplicant

network={
   ssid="triple checked this one"
  psk="triple checked this one too"
  priority=5
}
 
OP
M

Megameneer

Member


Messages: 27

Ok, did that, runned sudo service netif restart without success and that gave these logs
DSC_0489.JPG
DSC_0490.JPG
(sorry that it had to be in pictures but I didn't want to type it over on my other PC)
 

tobik@

Daemon
Developer

Reaction score: 1,419
Messages: 1,909

But wpi0 says it's associated. I would consider this success. Can you show the output of ifconfig wlan0?
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

I was going suggesting trying to change the channel on your father's router, since the US allows fewer channels than the rest of the world (limitations on spectrum I believe) and I'm pretty sure FreeBSD defaults to the US region for WiFi cards. However, I agree with tobik, in that it looks like you have successfully associated with the access point. Try killing the dhclient process and starting it by hand with dhclient wlan0. If you are running a firewall (rc.conf indicates you are not) then try disabling it to ensure you are not blocking any of the DHCP broadcasts or replies.

In the past I have seen WiFi cards that simply don't play well with particular access points. For a while some years back the company I was working for used Draytek routers and had issues with cards from a number of manufacturers using both GNU/Linux and Windows XP. Can you try a different card? Or a different access point?
 

wblock@

Beastie Himself
Developer

Reaction score: 3,729
Messages: 13,851

The first screen says wlan0 does not exist. (And ow, my neck.)

I have found either dhclient or wpa_supplicant do not like to be restarted with service netif restart. They sometimes have to be manually stopped and started. It is usually quicker to just restart the machine.
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Good spot, wblock@. Without restarting, it is possible to create wlan0 yourself with ifconfig wlan0 create wlandev wpi0 and then try to configure WPA with wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf, referencing the excellent Wireless Networking page in the FreeBSD handbook. I end up doing this on one of my laptops when I forget to have the USB WiFi card plugged in at boot (note to self -- must get around to configuring devd(8) to do this automatically).
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Megameneer Now I also have an aching neck, I also noticed you accidentally included in the photos what looks like you new forums password. You might want to change it :)
 
OP
M

Megameneer

Member


Messages: 27

But wpi0 says it's associated. I would consider this success. Can you show the output of ifconfig wlan0?
Here it is
DSC_0498.JPG

I was going suggesting trying to change the channel on your father's router, since the US allows fewer channels than the rest of the world (limitations on spectrum I believe) and I'm pretty sure FreeBSD defaults to the US region for WiFi cards. However, I agree with tobik, in that it looks like you have successfully associated with the access point. Try killing the dhclient process and starting it by hand with dhclient wlan0. If you are running a firewall (rc.conf indicates you are not) then try disabling it to ensure you are not blocking any of the DHCP broadcasts or replies.

In the past I have seen WiFi cards that simply don't play well with particular access points. For a while some years back the company I was working for used Draytek routers and had issues with cards from a number of manufacturers using both GNU/Linux and Windows XP. Can you try a different card? Or a different access point?
I have tried it with a different USB Wi-Fi stick. It did not work as well. It could not even detect the network with
Code:
sudo ifconfig wlan0 up list scan

The first screen says wlan0 does not exist. (And ow, my neck.)

I have found either dhclient or wpa_supplicant do not like to be restarted with service netif restart. They sometimes have to be manually stopped and started. It is usually quicker to just restart the machine.
It still does not work, even after rebooting.
Good spot, wblock@. Without restarting, it is possible to create wlan0 yourself with ifconfig wlan0 create wlandev wpi0 and then try to configure WPA with wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf, referencing the excellent Wireless Networking page in the FreeBSD handbook. I end up doing this on one of my laptops when I forget to have the USB WiFi card plugged in at boot (note to self -- must get around to configuring devd(8) to do this automatically).
Code:
ifconfig: create: bad value
when tried sudo ifconfig wlan0 create wlandev wpi0

Megameneer Now I also have an aching neck, I also noticed you accidentally included in the photos what looks like you new forums password. You might want to change it :)
Thanks. I will definitely change it. Once. Upon a time. I'm quite good at forgetting things :). If my account will ever spawn trolls and spams, you now know it's not from me.
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

I have tried it with a different USB Wi-Fi stick. It did not work as well. It could not even detect the network with
Code:
sudo ifconfig wlan0 up list scan
Does the NIC you are using now (wpi0) detect the access point when you scan?

Code:
ifconfig: create: bad value
when tried sudo ifconfig wlan0 create wlandev wpi0
I think that is happening because after the reboot wlan0 has already been created, whereas as wblock@ pointed out before, in your earlier post that interface didn't exist.

I was going suggesting trying to change the channel on your father's router
Humour me and try changing the channel on the access point. Choose a number of 11 or lower.

Running the ifconfig and wpa_supplicant commands by hand rather than through the start up scripts would be worth doing, since you can see more verbose output that might indicate where the problem is.

Can you connect to other access points using WPA2? Have you tried connecting to the access point using a connection without encryption? I am not suggesting you run an open access point, but it would be good to check that it is the WPA part that is the issue, not a more general connection issue.
 
OP
M

Megameneer

Member


Messages: 27

Does the NIC you are using now (wpi0) detect the access point when you scan?
No, it did not. However, there were other entries on the list from my neighbours.
Humour me and try changing the channel on the access point. Choose a number of 11 or lower.
My father does not allow me to modify his router. He changed his router because he switched to a new internet provider. "You're not going to mess with our network. It brings only more trouble. Go get yourself a normal operating system instead of MS-DOS with all those freaky commands." is what he would say.
Running the ifconfig and wpa_supplicant commands by hand rather than through the start up scripts would be worth doing, since you can see more verbose output that might indicate where the problem is.
How exactly would I do that? Stopping the service and then restart them by hand?
Can you connect to other access points using WPA2? Have you tried connecting to the access point using a connection without encryption? I am not suggesting you run an open access point, but it would be good to check that it is the WPA part that is the issue, not a more general connection issue.
Yes, I can. Before my father installed our new router, the connection ran fine, als with other hosts.
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Let's eliminate my channel theory. In your screenshot of output from ifconfig wlan0, there is part of one line that says country US. I suspect this will limit the channels your WiFi card can operate on. It should be possible to display available channels (noting I'm not on a FreeBSD machine to test this) with ifconfig wlan0 list chan.

Assuming you are not in the US it should be possible to reconfigure the country, which I am hoping will enable your WiFi card to use the the channel that I suspect your router is on. You can list the possible options with ifconfig wlan0 list countries and then set the country with ifconfig wlan0 country Albania, substituting your country's name. ifconfig wlan0 should show the new country, though I also note that according to the man page for ifconfig(8):
Note that
not all devices support changing the country code from a default
setting; typically stored in EEPROM.

I am hoping if you list the channels again with ifconfig wlan0 list chan you will now see more channels and if you scan again with ifconfig wlan0 list scan you will be able to see your router. Have a go and I will keep my fingers crossed.
 
OP
M

Megameneer

Member


Messages: 27

Let's eliminate my channel theory. In your screenshot of output from ifconfig wlan0, there is part of one line that says country US. I suspect this will limit the channels your WiFi card can operate on. It should be possible to display available channels (noting I'm not on a FreeBSD machine to test this) with ifconfig wlan0 list chan.
DSC_0499.JPG

I don't know which one is my father's one. But I could check that out with my Linux box if necessary.
Let's eliminate my channel theory. In your screenshot of output from ifconfig wlan0, there is part of one line that says country US. I suspect this will limit the channels your WiFi card can operate on. It should be possible to display available channels (noting I'm not on a FreeBSD machine to test this) with ifconfig wlan0 list chan.

Assuming you are not in the US it should be possible to reconfigure the country, which I am hoping will enable your WiFi card to use the the channel that I suspect your router is on. You can list the possible options with ifconfig wlan0 list countries and then set the country with ifconfig wlan0 country Albania, substituting your country's name.
DSC_0500.JPG

I feel we are pretty close to the solution, however
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Perhaps. Can you check which channel the router is operating on as you offered? That will at least tell us whether it is a channel that your WiFi card can currently use. I'm not sure why the attempt to change the country failed. Perhaps the wlan0 and/or wpi0 interface needs to be marked as down to be reconfigured, though I am guessing here. Try ifconfig wlan0 down && ifconfig wlan0 country Netherlands && ifconfig wlan0 up (wrap in sudo sh -c "<command>" for use with sudo).
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Another thought: perhaps the wlan0 interface needs to be created with the country parameter set. Try ifconfig wlan0 destroy && ifconfig wlan0 create wlandev wpi0 country Netherlands.
 
OP
M

Megameneer

Member


Messages: 27

Perhaps. Can you check which channel the router is operating on as you offered?
Under Arch Linux, I used iw list and that gave this (finally, sane plain text as error log :))
Code:
    Frequencies:
            * 2412 MHz [1] (20.0 dBm)
            * 2417 MHz [2] (20.0 dBm)
            * 2422 MHz [3] (20.0 dBm)
            * 2427 MHz [4] (20.0 dBm)
            * 2432 MHz [5] (20.0 dBm)
            * 2437 MHz [6] (20.0 dBm)
            * 2442 MHz [7] (20.0 dBm)
            * 2447 MHz [8] (20.0 dBm)
            * 2452 MHz [9] (20.0 dBm)
            * 2457 MHz [10] (20.0 dBm)
            * 2462 MHz [11] (20.0 dBm)
            * 2467 MHz [12] (20.0 dBm) (no IR)
            * 2472 MHz [13] (20.0 dBm)
            * 2484 MHz [14] (20.0 dBm) (no IR)
ifconfig wlan0 down && ifconfig wlan0 country Netherlands && ifconfig wlan0 up (wrap in sudo sh -c "<command>" for use with sudo).
I used:
sudo ifconfig wlan0 down which succeed and then
sudo ifconfig wlan0 country Netherlands which succeed and then
sudo ifconfig wlan0 up which succeed as well and then
sudo service netif restart but still no connection.
Another thought: perhaps the wlan0 interface needs to be created with the country parameter set. Try ifconfig wlan0 destroy && ifconfig wlan0 create wlandev wpi0 country Netherlands.
I used:
sudo ifconfig wlan0 destroy
sudo ifconfig wlan0 create wlandev wpi0 country Netherlands
and then restarted netif but still no success.
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

Slow down a bit -- running service netif restart will make various call to ifconfig and put you back where you started.

OK, so additional channels 12, 13 and 14 (for 802.11g) are available under Arch GNU/Linux... Did you check which channel the access point is using?

After you successfully changed country (please repeat the steps and check the country has in fact changed -- please post the output of ifconfig wlan0) are those additional channels also available on FreeBSD (post the output of ifconfig wlan0 list chan)? And can you now see the access point ( ifconfig wlan0 list scan)? If you can, try running wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf, grabbing the output to post here, wait around 10 seconds and then post the output of ifconfig wlan0. We can try making any permanent changes in the configuration files once we know things work.
 
OP
M

Megameneer

Member


Messages: 27

OK, so additional channels 12, 13 and 14 (for 802.11g) are available under Arch GNU/Linux... Did you check which channel the access point is using?
According to the WifiAnalyzer app for Google Android, it uses channel 13.

In the past I have seen WiFi cards that simply don't play well with particular access points. For a while some years back the company I was working for used Draytek routers and had issues with cards from a number of manufacturers using both GNU/Linux and Windows XP. Can you try a different card? Or a different access point?
My father's router is from Draytek according to WifiAnalyzer.
After you successfully changed country (please repeat the steps and check the country has in fact changed -- please post the output of ifconfig wlan0) are those additional channels also available on FreeBSD (post the output of ifconfig wlan0 list chan)? And can you now see the access point ( ifconfig wlan0 list scan)?
I did as you do: sudo ifconfig wlan0 down, sudo ifconfig wlan0 country Netherlands and sudo ifconfig wlan0 up. Here are the screenshots of the commands sudo ifconfig wlan0, sudo ifconfig wlan0 list chan and sudo ifconfig wlan0 list scan
DSC_0503.JPG

So, does it mean I have to switch to a different operating system?
 

tobik@

Daemon
Developer

Reaction score: 1,419
Messages: 1,909

Can you try setting the country in /etc/rc.conf?
Code:
ifconfig_wlan0="WPA DHCP country NL"
Make sure to reboot afterwards.

Also please do a ifconfig wlan0 scan to initiate a new scan. ifconfig wlan0 list scan just shows the APs that were found during the last scan. According to the man page wpi(4) does not support background scanning, so it's likely that the list isn't updated automatically after setting the country.
 
OP
M

Megameneer

Member


Messages: 27

Can you try setting the country in /etc/rc.conf?
Code:
ifconfig_wlan0="WPA DHCP country NL"
Make sure to reboot afterwards.

Also please do a ifconfig wlan0 scan to initiate a new scan. ifconfig wlan0 list scan just shows the APs that were found during the last scan. According to the man page wpi(4) does not support background scanning, so it's likely that the list isn't updated automatically after setting the country.
Ok, I changed the country in /etc/rc.conf and rebooted. After I ran sudo ifconfig wlan0 scan in a plain console (so outside of X), it gave the white-coloured message:
Code:
wpi0: fatal firmware error
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

According to the WifiAnalyzer app for Google Android, it uses channel 13.
Great -- so I hope if we can also configure your WiFi card to use channel 13 (which it wasn't before) then you will be able to connect, unless there are also other issues.

I did as you do [...] So, does it mean I have to switch to a different operating system?
So, the good news is that you successfully managed to change country from US to Netherlands. The bad news is that your WiFi card isn't reporting the additional channels I would expect (12, 13, 14). Since these channels were available in Arch GNU/Linux, this cannot be an issue with your card.

I am mindful of wblock@'s comments regarding the service netif restart not playing well with WiFi cards; in fact this has caused my kernel to panic in the past when using a USB WiFi card. tobik's suggestion of making the changes in /etc/rc.conf and rebooting is sensible. However, I think we should try a slightly different configuration. According to the man page for rc.conf(5):
If a wlans_<interface> variable is set, an wlan(4) interface
will be created for each item in the list with the wlandev
argument set to interface. Further wlan cloning arguments
may be passed to the ifconfig(8) create command by setting
the create_args_<interface> variable.

I therefore suggest trying the following in /etc/rc.conf:
Code:
wlans_wpi0="wlan0"
create_args_wpi0="country Netherlands"
ifconfig_wlan0="WPA DHCP"
And the following in /etc/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
        ssid="triple checked this one"
        key_mgmt=WPA-PSK
        psk="triple checked this one too"
}
Then reboot and see where you end up. Outputs of ifconfig wlan0, ifconfig wlan0 list chan and ifconfig wlan0 scan (forcing a foreground scan, mindful of tobik's helpful observation that the wpi(4) driver does not support background scanning) would be useful. If you need to explore further, I see it is possible to generate more detailed debugging output with wlandebug(8) though I will say that I have never needed to do this.
 
OP
M

Megameneer

Member


Messages: 27

Since these channels were available in Arch GNU/Linux, this cannot be an issue with your card.
I need to say that I use FreeBSD on my laptop with an onboard card and Arch GNU/Linux on my desktop with an USB card. So they do not use the same card.
However, when I put in the USB card, changed
Code:
wlans_wpi0="wlan0"
to
Code:
wlans_run0="wlan0"
, rebooted and entered sudo ifconfig wlan0 list chan only display channels 1 to 11. Should I check with a Puppy GNU/Linux bootable CD-ROM if it is also an issue under GNU/Linux?
I therefore suggest trying the following in /etc/rc.conf:
Code:
wlans_wpi0="wlan0"
create_args_wpi0="country Netherlands"
ifconfig_wlan0="WPA DHCP"
Done that...
And the following in /etc/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="triple checked this one"
key_mgmt=WPA-PSK
psk="triple checked this one too"
}
...done that (I also did the line
Code:
ctrl_interface_group=wheel
even though I didn't think it wasn't necessary, but at least I don't have to use sudo anymore)...
Then reboot and see where you end up
...and done that. No connection. I will post the outputs in my following comment.
 

asteriskRoss

Well-Known Member

Reaction score: 161
Messages: 447

In your screenshot, your WiFi card is still showing as configured for US region, though when you changed it by hand using ifconfig wlan0 country Netherlands it you said the command ran successfully. I am confused. I looked at the script that handles wireless network set up (relevant section starts line 1415) which seems to do what the man page for rc.conf(5) suggests and would read the create_args_wpi0 variable. Perhaps you can try again changing the country by hand and checking that it is actually changing:
ifconfig wlan0 down
ifconfig wlan0 country Netherlands
ifconfig wlan0 up
ifconfig wlan0 (post output)
ifconfig wlan0 list chan (post output)
ifconfig wlan0 scan (post output)
 
Top