Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Broadcom BCM4312 configuring via wpa_supplicant
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Sun Jul 20, 2014 11:10 pm    Post subject: [Solved] Broadcom BCM4312 configuring via wpa_supplicant Reply with quote

Not sure how to configure wpa_supplicant.. :oops:
read this: https://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=4#doc_chap2
got stuck after realizing I dont know what to put as the driver. I have a Broadcom BCM4312 but im not sure what to write in the wpa_supplicant_eth0=" "
Also, I see a lot of other stuff on the web where theirs are wpa_supplicant_wlan0 instead of eth0. why is that?
and how do i make a ASCII passphrase? http://en.wikipedia.org/wiki/ASCII#ASCII_control_characters
do i type it in binary or something?

Thank you in advanced


Last edited by ShanaXXII on Wed Oct 01, 2014 12:23 pm; edited 2 times in total
Back to top
View user's profile Send private message
Telemin
l33t
l33t


Joined: 25 Aug 2005
Posts: 680
Location: Glasgow, UK

PostPosted: Mon Jul 21, 2014 12:02 pm    Post subject: Reply with quote

hi there,

Don't worry about being confused, we all started off in the same boat as you are now :)

The manual is a bit unhelpful there as there a very few wifi drivers which are not in-kernel these days. Basically all the in kernel drivers use the nl80211 wireless stack, and so you want -Dnl80211. If that doesn't work, then the older "wireless extensions" stack should do the trick. You most likely simply want a setup with:

Code:

# /etc/conf.d/wpa_supplicant

wpa_supplicant_args="-Dnl80211"
#if that fails try
#wpa_supplicant_args="-Dwext"


and

Code:

# /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel  # this line specifies a "control socket", it is not necessary, but it allows any member of wheel to use wpa_cli to control wpa_supplicant behaviour.

network={
  ssid="my_ssid"
  psk="myp4$$phr4$3"
}


-Telemin-
_________________
The Geek formerly known as -Freestyling-
When you feel your problem has been solved please add [Solved] to the topic title.
Please adopt an unanswered post
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Mon Jul 21, 2014 12:45 pm    Post subject: Reply with quote

Telemin wrote:
Code:
# /etc/conf.d/wpa_supplicant

wpa_supplicant_args="-Dnl80211"

Telemin ... /etc/conf.d/wpa_supplicant is only used if the /etc/init.d/wpa_supplicant service is used, which generally isn't the case as most often wpa_supplicant is started via 'net.wlan0'. To provide the same parameter one would do the following:

/etc/conf.d/net
Code:
wpa_supplicant_wlan0="-Dnl80211"

@ShanaXXII ... "eth0" (or whatever your interface is called) is "wired interface", whereas "wlan0" is "wireless interface".

ShanaXXII wrote:
[...] how do i make a ASCII passphrase?

Not sure what you're asking exactly, if the passphrase from the AP is 'psk' then use 'psk=A1B2C3D4E5etc' in wpa_supplicant.conf, if you need to generate a psk *from* an ASCII passphrase then you can do the following ...

Code:
# wpa_passphrase <ESSID> passphrase

HTH & best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Mon Jul 21, 2014 1:00 pm    Post subject: Reply with quote

so this is what my /etc/conf.d/net looks like so far
Code:
 # /etc/conf.d/net

modules="wpa_supplicant"
wpa_supplicant_wlan0="-Dn180211"
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
SSID="TP-LINK_62ECB4"
psk="The password to my wifi"
priority=5
}


and

Code:
 # /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
ssid="TP-LINK_62ECB4"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk="my wifi password"
priority=2
}


is there anything wrong?
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Mon Jul 21, 2014 1:30 pm    Post subject: Reply with quote

ShanaXXII wrote:
is there anything wrong?

ShanaXXII ... yes :) ... you have stuff (from wpa_supplicant.conf) in /etc/conf.d/net ... something like the following should be sufficent ...

/etc/conf.d/net
Code:
modules_wlan0="!plug wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp"
enable_ipv6_wlan0="false"

Also you had "n180211" (digit, one) and not "nl80211" (lower case "el").

For the wpa_supplicant.conf most of the parameters can be left out as wpa_supplicant will generally be able to auto detect them and select the best available.

/etc/wpa_supplicant/wpa_supplicant.conf
Code:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

network={
   ssid="TP-LINK_62ECB4"
   proto=WPA2 # I don't imagine the TP-Link won't support wpa2
   psk="my wifi password"
   priority=2
}

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Mon Jul 21, 2014 4:26 pm    Post subject: Reply with quote

khayyam wrote:

/etc/conf.d/net
Code:
modules_wlan0="!plug wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp"
enable_ipv6_wlan0="false"


/etc/wpa_supplicant/wpa_supplicant.conf
Code:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

network={
   ssid="TP-LINK_62ECB4"
   proto=WPA2 # I don't imagine the TP-Link won't support wpa2
   psk="my wifi password"
   priority=2
}

best ... khay


okay. So I changed my /etc/conf.d/net and etc/wpa_supplicant/wpa_supplicant.conf
How do i know if i have wireless connection or if wireless connection has started? and how do i start it?
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Mon Jul 21, 2014 9:30 pm    Post subject: Reply with quote

ShanaXXII wrote:
okay. So I changed my /etc/conf.d/net and etc/wpa_supplicant/wpa_supplicant.conf
How do i know if i have wireless connection or if wireless connection has started? and how do i start it?

ShanaXXII ... you should now be able to start the service ... if you created the symlink to net.lo

Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
# /etc/init.d/net.wlan0 start

If you want the the wireless connection to start when booting you can add it to the 'default' runlevel

Code:
rc-update add net.wlan0 default

Assuming there are no errors you should then be able to either test, or use, the network

Code:
# wpa_cli status
# iwconfig wlan0
# ping -c 1 204.187.15.12
# ping -c 1 forums.gentoo.org

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Mon Jul 21, 2014 9:52 pm    Post subject: Reply with quote

khayyam wrote:
Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
# /etc/init.d/net.wlan0 start


it gave me:
Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
# /etc/init.d/net.wlan start
* Caching service dependencies ... [ok]
* Bringing up interface wlan0
*  ERROR: interface wla0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.wlan0 failed to start


I have a Broadcom BCM4312 802.11b/g LP-PHY
and in my genkernel, i put
Code:
Device Drivers->
Network Device support->
Wireless LAN->
<*> Broadcom 43xx wireless support (mac80211 stack)
[*] Support for low-power (LP-PHY) devices
<*> Broadcom IEEE802.11n embedded FULLMAC WLAN Driver


is there something im missing>?
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Mon Jul 21, 2014 10:06 pm    Post subject: Reply with quote

ShanaXXII ...

there is some odd output in the above ('net.wlan", "wla0") I'll assume you typed this by hand and that these are typos. So, lets see what the name of your wireless interface actualy is, this way we know if the device is recognised and the drivers are available ... can you post the output of 'ifconfig -a' (as it looks like your typing this by hand just provide the names of the interfaces on the left column).

here I have ...

Code:
# ifconfig -a | awk '/^[[:alpha:]]/{print $1}'
lo
wlan0

That is the 'loopback' (lo) interface, and the wireless interface (wlan0) ... the ethernet (wired network) driver currently isn't loaded. I suspect that you're using udev and the wireless device has been renamed 'wlp2s0' (or similar).

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Mon Jul 21, 2014 10:19 pm    Post subject: Reply with quote

khayyam wrote:
can you post the output of 'ifconfig -a' (as it looks like your typing this by hand just provide the names of the interfaces on the left column).

here I have ...

Code:
# ifconfig -a | awk '/^[[:alpha:]]/{print $1}'
lo
wlan0

best ... khay


okay. Idk how to copy text in terminal sorry. :oops:
but here:
Code:
# ifconfig -a
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
             inet ***.***.**.*** netmask 255.255.255.0 broadcast ***.***.**.***
             inet6 fe80::baac:6fff:fe6d:c625 prefixlen 64 scopeid 0x20<link>
             ether b8:ac:6f:6d:c6:25 txqueuelen 1000 (Ethernet)
             RX packets 15090 bytes 18392099 (17.5MiB)
             RX errors 0 dropped 0 overruns 0 frame 0
             TX packets 11274 bytes 1435579 (1.3 MiB)
             TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
            inet 127.0.0.1 netmask 255.0.0.0
            inet6 ::1 prefixlen 128 scopeid 0x10<host>
            loop txqueuelen 0 (Local Loopback)
            RX packets 48 bytes 3456 (3.3 Kib)
            RX errors 0 dropped 0 overruns 0 frame 0
            TX packets 48 bytes 3456 (3.3 KiB)
            TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Mon Jul 21, 2014 10:58 pm    Post subject: Reply with quote

ShanaXXII ... ok, so there is no wireless interface, this means that either the driver isn't loaded or the kernel/driver is missing something (possibly firmware).

I've not had any experience with this particular card, so I'm not sure what exactly needs to be done here (or even if the in kernel driver is the best option ... as there is also net-wireless/broadcom-sta). I'll assume that the in kernel driver will work so assuming you haven't installed net-wireless/b43-fwcutter and got the required firmware please try the following (you will need to have network for this so if you have no ethernet then you will need to use a boot disk that supports your wireless card):

Code:
# cd /usr/src
# wget -O broadcom-wl-4.178.10.4.tar.bz2 http://downloads.openwrt.org/sources/broadcom-wl-4.178.10.4.tar.bz2
# tar -xjvf broadcom-wl-4.178.10.4.tar.bz2
# cd broadcom-wl-4.178.10.4/linux
# emerge net-wireless/b43-fwcutter
# b43-fwcutter -w /lib/firmware wl_apsta.o
# modprobe -r b43
# modprobe b43
# ifconfig -a

Hopefully this will be enough to get the card working, if not then post the relevant sections from 'dmesg'.

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Mon Jul 21, 2014 11:21 pm    Post subject: Reply with quote

khayyam wrote:
Code:
# cd /usr/src
# wget -O broadcom-wl-4.178.10.4.tar.bz2 http://downloads.openwrt.org/sources/broadcom-wl-4.178.10.4.tar.bz2
# tar -xjvf broadcom-wl-4.178.10.4.tar.bz2
# cd broadcom-wl-4.178.10.4/linux
# emerge net-wireless/b43-fwcutter
# b43-fwcutter -w /lib/firmware wl_apsta.o
# modprobe -r b43
# modprobe b43
# ifconfig -a


I did everything in the above. when I did
# modprobe -r b43 it gave me an error saying:
modprobe: FATAL: Module b43 is builtin.
I continued and did the rest and my # ifconfig -a:
Code:
# ifconfig -a
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
             inet ***.***.**.*** netmask 255.255.255.0 broadcast ***.***.**.***
             inet6 fe80::baac:6fff:fe6d:c6:25 prefixlen 64 scopeid 0x20<link>
             ether b8:ac:6f:6d:c6:25 txqueuelen 1000 (Ethernet)
             RX packets 74277 bytes 91611121 (87.3MiB)
             RX errors 0 dropped 0 overruns 0 frame 0
             TX packets 47955 bytes 5296953 (5 MiB)
             TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
            inet 127.0.0.1 netmask 255.0.0.0
            inet6 ::1 prefixlen 128 scopeid 0x10<host>
            loop txqueuelen 0 (Local Loopback)
            RX packets 48 bytes 3456 (3.3 Kib)
            RX errors 0 dropped 0 overruns 0 frame 0
            TX packets 48 bytes 3456 (3.3 KiB)
            TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


:/
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Tue Jul 22, 2014 12:07 am    Post subject: Reply with quote

khayyam, I did a # iwconfig and it gave me this:
Code:
# iwconfig
lo no wireless extensions.

enp4s0 no wireless extensions.

wlan0 IEEE 802.11bg ESSID:"TP-LINK_62ECB4"
          Mode:Managed Frequency:2.442 GHz Access Point: 64:70:02:62:EC:B4
          Bit Rate=5.5 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off      Fragment thr:off
          Encryption key:off
          Power Management: off
          Link Quality=70/70 Signal Level=22 dBm
          Rx invalid nwid:0  Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0   Invalid misc:17     Missed beacon:0

I also got errors when booting. stuff like
Code:
* net.wlan0 has started but is inactive
* failed to start start-stop daemon /usr/sbin/wpa_supplicant
* failed to start wpa_supplicant
* ERROR: wpa_supplicant failed to start

not sure if this is helpful or not :/
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Tue Jul 22, 2014 2:31 am    Post subject: Reply with quote

ShanaXXII wrote:
Code:
wlan0 IEEE 802.11bg ESSID:"TP-LINK_62ECB4"
          Mode:Managed Frequency:2.442 GHz Access Point: 64:70:02:62:EC:B4
          Bit Rate=5.5 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off      Fragment thr:off
          Encryption key:off
          Power Management: off
          Link Quality=70/70 Signal Level=22 dBm
          Rx invalid nwid:0  Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0   Invalid misc:17     Missed beacon:0

ShanaXXII ... that shows you connected.

ShanaXXII wrote:
I also got errors when booting. stuff like
Code:
* net.wlan0 has started but is inactive
* failed to start start-stop daemon /usr/sbin/wpa_supplicant
* failed to start wpa_supplicant
* ERROR: wpa_supplicant failed to start

Ummm .... I'm confused, because the above shows the connection established. This could just be a typo somewhere in your configuration but I don't know why it fails but you still get connected ... is that the exact error, you don't also have wpa_supplicant in the runlevel?

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Tue Jul 22, 2014 11:55 am    Post subject: Reply with quote

khayyam wrote:

ShanaXXII wrote:
I also got errors when booting. stuff like
Code:
* net.wlan0 has started but is inactive
* failed to start start-stop daemon /usr/sbin/wpa_supplicant
* failed to start wpa_supplicant
* ERROR: wpa_supplicant failed to start

Ummm .... I'm confused, because the above shows the connection established. This could just be a typo somewhere in your configuration but I don't know why it fails but you still get connected ... is that the exact error, you don't also have wpa_supplicant in the runlevel?

best ... khay


U are right, I do have wireless connection :). Thank you.
but i still have the errors when booting up. It hangs there for about 10 secs or so. and I said something about deleting var/run/wpa_suppllcant/wlan0 if its not needed

:/
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Tue Jul 22, 2014 12:10 pm    Post subject: Reply with quote

ShanaXXII wrote:
U are right, I do have wireless connection :). Thank you.

ShanaXXII ... good and you're welocme :)

ShanaXXII wrote:
but i still have the errors when booting up. It hangs there for about 10 secs or so. and I said something about deleting var/run/wpa_suppllcant/wlan0 if its not needed

can you provide the output of 'rc-status'

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Tue Jul 22, 2014 3:40 pm    Post subject: Reply with quote

khayyam wrote:
can you provide the output of 'rc-status'
best ... khay

okay:
Code:
 # rc-status
Runlevel: default
 wpa_supplicant [stopped]
 dhcpcd              [started]
 net.eth0             [stopped]
 netmount           [stopped]
 local                   [started]
Dynamic Runlevel: hotplugged
 net.wlan0           [started]
Dynamic Runlevel: needed
Dynamic Runlevel: manual
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Tue Jul 22, 2014 9:32 pm    Post subject: Reply with quote

ShanaXXII wrote:
Code:
 # rc-status
Runlevel: default
 wpa_supplicant [stopped]

ShanaXXII ... wpa_supplicant is in the default runlevel and should be removed ... net.wlan0 will start wpa_supplicant so by having both wpa_supplicant and net.wlan0 start there would be a conflict, that was probably the cause of the above error.

Code:
# rc-update del wpa_supplicant default

Everything should now be error free ... if not let me know.

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Wed Jul 23, 2014 12:56 am    Post subject: Reply with quote

Yes, everything is working fine now khay. Thank you very much :)
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Wed Jul 23, 2014 12:46 pm    Post subject: Reply with quote

One last question: if i wanted to connect to another wireless connection. Do I have to erase the setup i had with this wireless connection -> /etc/wpa_supplicant/wpa_supplicant.conf.
or can i just start another bracket and write it there?
e.g.
Code:
network={
              ssid="TP-LINK_62ECB4"
              proto=.....
              ...........
              ......
}

network={
               ssid="rogers...."
                  ......
}
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2949

PostPosted: Wed Jul 23, 2014 1:05 pm    Post subject: Reply with quote

ShanaXXII ... yes, you can have as many 'network' blocks as needed, you can also provide names for these networks with 'id_str='. If one or other network isn't available wpa_supplicant well select one that is (based on 'priority=').

There are many ways to go about switching networks, I use wpa_cli but you might want to add the 'qt4' useflag and use wpa_gui (your user will need to be in the wheel group).

best ... khay
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 219
Location: Canada

PostPosted: Wed Oct 01, 2014 12:26 pm    Post subject: Reply with quote

Solution:
Code:
# cd /usr/src
# wget -O broadcom-wl-4.178.10.4.tar.bz2 http://downloads.openwrt.org/sources/broadcom-wl-4.178.10.4.tar.bz2
# tar -xjvf broadcom-wl-4.178.10.4.tar.bz2
# cd broadcom-wl-4.178.10.4/linux
# emerge net-wireless/b43-fwcutter
# b43-fwcutter -w /lib/firmware wl_apsta.o
# modprobe -r b43
# modprobe b43
# ifconfig -a

Code:
# nano -w /etc/conf.d/net
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp"
enable_ipv6_wlan0="false"

Code:
# nano -w /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

ap_scan=1

network={
   ssid="wifi_name"
   proto=WPA2
   psk="wifi_password"
   priority=2
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum