djtaz
Posts: 6
Joined: Wed Apr 27, 2016 10:37 am

Pi3 Centos Wireless Issues

Wed Apr 27, 2016 10:59 am

Hi Guys ,
So this is my first post here and im looking for a bit of help (sorry) but i have tried quite a few things and im a tad lost at this stage.

I installed Centos 7 on my Pi3 (https://wiki.centos.org/SpecialInterest ... spberryPi3) - all well and good and it booted perfectly though no Wlan0 interface on it which is something i needed, so i worked around it , did a bit of searching , found that if 3 files were added it would bring up the Wlan0 interface.

Anyway, i tried the files and guides i found on the forums around the place and it killed Centos each time i tried so i finally got the files directly from the latest version of Raspbian and that seemed to work well for me
  • /boot/bcm2710-rpi-3-b.dtb
    /usr/lib/firmware/brcm/brcmfmac43430-stdio.bin
    /usr/lib/firmware/brcm/brcmfmac43430-stdio.txt
Anyway , i can now see my wlan0 interface and i can see it attempting to connect to my wifi network i have called 'Test'
I have 2 other Pi3's running raspbian on it and they all work ok , but i keep getting the error on the Centos one when i run the following command
sudo wpa_supplicant -i wlan0 -Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf
which seems to return
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect

Code: Select all

[root@centos-rpi3 ~]# sudo wpa_supplicant -i wlan0 -Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: Failed to initiate AP scan
wlan0: Trying to associate with SSID 'Test'
wlan0: Associated with 10:6f:3f:26:b5:e1
wlan0: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK
wlan0: WPA: Could not verify EAPOL-Key MIC - dropping packet
wlan0: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK
wlan0: WPA: Could not verify EAPOL-Key MIC - dropping packet
wlan0: Authentication with 10:6f:3f:26:b5:e1 timed out.
wlan0: CTRL-EVENT-DISCONNECTED bssid=10:6f:3f:26:b5:e1 reason=3 locally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Test" auth_failures=1 duration=10
wlan0: CTRL-EVENT-DISCONNECTED bssid=10:6f:3f:26:b5:e1 reason=3 locally_generated=1
wlan0: Failed to initiate AP scan
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="Test"
wlan0: Trying to associate with SSID 'Test'
wlan0: Associated with 10:6f:3f:26:b5:e1
wlan0: WPA: Key negotiation completed with 10:6f:3f:26:b5:e1 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 10:6f:3f:26:b5:e1 completed [id=0 id_str=]
wlan0: CTRL-EVENT-DISCONNECTED bssid=10:6f:3f:26:b5:e1 reason=3
wlan0: Trying to associate with SSID 'Test'
wlan0: Associated with 10:6f:3f:26:b5:e1
wlan0: CTRL-EVENT-DISCONNECTED bssid=10:6f:3f:26:b5:e1 reason=3
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Test" auth_failures=1 duration=10
wlan0: Failed to initiate sched scan

my /etc/wpa_supplicant/wpa_supplicant.conf is pretty basic and i kept the WPA pass basic so i knew it was simple (the other PI's connect ok)

Code: Select all

# reading passphrase from stdin
network={
        ssid="Test"
        psk="abcdef1234"
        key_mgmt=WPA-PSK
}
i did set up a /etc/sysconfig/network-scripts/ifcfg-wlan0 file as it didnt exist.

Code: Select all

DEVICE=wlan0
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.43.20
GATEWAY=192.168.43.1
TYPE=Wireless

If anyone has any advice or suggestions it would be great as i cant see much else on this side of things on forums anywhere.
If anyone else is testing i got the 3 files directly off the latest raspbian image but PM and i can put them on a webserver for easier wget options.

djtaz
Posts: 6
Joined: Wed Apr 27, 2016 10:37 am

Re: Pi3 Centos Wireless Issues

Wed May 04, 2016 10:58 am

I gave up on wireless and went with cable though im sure this is just something silly im missing !

Ben21684
Posts: 3
Joined: Fri May 06, 2016 9:33 am

Re: Pi3 Centos Wireless Issues

Fri May 06, 2016 9:54 pm

Hello,

do you have any new experience how to get plan running with CentOS on the Pi 3?

regards Ben

driedcypress
Posts: 3
Joined: Fri Feb 20, 2015 4:05 pm

Re: Pi3 Centos Wireless Issues

Fri Oct 21, 2016 10:29 am

I'm very late to the party but have you tried entering the HWADDR parameter into your ifcfg-wlan0?
if you can see the device with 'ip a' take the 'link/ether' line and chop out your MAC address and add the entry to /etc/sysconfig/network-scripts/ifcfg-wlan0
HWADDR=10:c3:7b:a1:ea:01

I also noticed you use the wpa_passphrase differently to me,
wpa_passphrase [SSID] [PSK] >> /etc/wpa_supplicant/wpa_supplicant.conf
systemctl restart wpa_supplicant

and I've always ran this
wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
but found that it's unnecessary after several installations.

I've had difficulties in the past bringing wi-fi up, I generally run

ifup wlan0
dhclient wlan0 # to obtain an IP.

once I've connected successfully the connection survives a reboot.

I'm going to test this out today, I'll let you know if I make progress. I've found that the C7 images are much faster than the raspbians. Are you also aware that the Fedora25 arm images boot straight onto the RPI3 with no modifications?

driedcypress
Posts: 3
Joined: Fri Feb 20, 2015 4:05 pm

Re: Pi3 Centos Wireless Issues

Fri Oct 21, 2016 11:50 am

Okay, so a few more steps than I thought.

on my workstation:

Code: Select all

# download image
wget http://mirror.centos.org/altarch/7/isos/armhfp/CentOS-Userland-7-armv7hl-Minimal-1603-RaspberryPi3.img.xz

# write image to SD card - be sure to change /dev/sdg to correct location
xzcat CentOS-Userland-7-armv7hl-Minimal-1603-RaspberryPi3.img.xz | dd of=/dev/sdg status=progress bs=4M
on the RPI:

Code: Select all

#Boot up the pi with ethernet connected, login as user: root password: centos either locally or via SSH.

# install firmware for wifi
curl --location https://github.com/RPi-Distro/firmware-nonfree/raw/54bab3d6a6d43239c71d26464e6e10e5067ffea7/brcm80211/brcm/brcmfmac43430-sdio.bin > /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin

curl --location https://github.com/RPi-Distro/firmware-nonfree/raw/54bab3d6a6d43239c71d26464e6e10e5067ffea7/brcm80211/brcm/brcmfmac43430-sdio.txt > /usr/lib/firmware/brcm/brcmfmac43430-sdio.txt

#restore selinux context for firmware
restorecon -Frv  /usr/lib/firmware/brcm/

#stop network manager
systemctl stop NetworkManager
systemctl disable NetworkManager

#enable network
systemctl enable network

#configure wpa_supplicant
vi /etc/sysconfig/wpa_supplicant
# comment out all lines and add this:
INTERFACES="-i wlan0"
DRIVERS="-D wext"
OTHER_ARGS="-u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid"

#create ifcfg for wlan0
vi /etc/sysconfig/network-scripts/ifcfg-wlan0
# add
BOOTPROTO=dhcp
DEFROUTE=yes
DEVICE=wlan0
KEY_MGMT=WPA-PSK
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
KEY_MGMT=WPA-PSK
NAME=wlan0
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
TYPE=Wireless
USERCTL=yes
WPA_ALLOW_WPA=yes
WPA_ALLOW_WPA2=yes
ZONE=trusted
NM_CONTROLLED="no"
HWADDR=

#disable NetworkManager control of devices
#amend NM_CONTROLLED="yes" to NM_CONTROLLED="no" in both ifcfg files.

#add HWADDR entries to ifcfg-wlan0 and ifcfg-eth0
ip a
# copy the link/ether mac address for each device into the appropriate files
# for example
HWADDR=b8:27:eb:51:aa:7c

# enter the HWADDR for ifcfg-eth0 and reboot, the wlan0 device will now be visible and then add the HWADDR to ifcfg-wlan0

# restore selinux context for ifcfg files
restorecon -Frv /etc/sysconfig/network-scripts

#configure your wireless access point
wpa_passphrase [SSID] [PSK] >> /etc/wpa_supplicant/wpa_supplicant.conf

# to prevent an error later on
touch /etc/sysconfig/network

# ensure wpa_supplicant is enabled
systemctl enable wpa_supplicant

# ensure you get a DHCP lease on boot
chmod +x /etc/rc.d/rc.local
echo "dhclient wlan0" >> /etc/rc.d/rc.local
Reboot the raspberry pi and all should be well.

I've tested this multiple times and it works consistently.

driedcypress
Posts: 3
Joined: Fri Feb 20, 2015 4:05 pm

Re: Pi3 Centos Wireless Issues

Fri Oct 21, 2016 2:30 pm

I just made this into a shell script for EASY wifi setup. The script will complete all configuration changes listed above, reboot for the final steps and remove all traces of it's existence, in total there will be two reboots and your RPI will come online with both eth0 and wlan0 active.

OPTION-1:
copy this bash script and name it wifi-setup.sh
https://gist.github.com/anonymous/91193 ... 3db0f3b70f

then copy to the RPI

Code: Select all

scp wifi-setup.sh root@[rpi-ip-address]:/root/
ssh to the raspberry pi as root or complete these steps on the local console

Code: Select all

chmod +x wifi-setup.sh
./wifi-setup.sh
OPTION-2:
use CURL directly on the RPI

Code: Select all

curl https://gist.githubusercontent.com/anonymous/9119317cdf0c141cb50c523db0f3b70f/raw/d4c2bedcf4799783ca0bf5f54a52e82241faea93/wifi-setup-c7-rpi3.sh >> wifi-setup.sh
chmod +x wifi-setup.sh
./wifi-setup.sh
You can either pass your SSID and PSK as arguments to script like this

Code: Select all

./wifi-setup.sh [SSID] [PSK]
Or you will be promped for input if you run without the arguments.

Enjoy!

Return to “Other”