- Config WiFi On mini-rootfs systerm
- Config WiFi On Ubuntu & Debian systerm
- Fedora && CentOS wifi configure
- OpenSuse Wifi configure
This is a guide to setup a WiFi environment on your HiKey board.
When HiKey board can boot into mini-rootfs systerm or Ubuntu systerm in Estuary project, you can config WiFi function. If you can not boot into this systerm, you can get more information from DeployManual.txt file.
Config WiFi On mini-rootfs systerm
On serial console, you should see some debug message which can show if the Hikey board have booted into mini-rootfs systerm successfully. You can config this WiFi according to this follow instruction:
|
|
|
|
eg: wpa_passphrase admin admin > /etc/wpa_supplicant.conf
|
|
|
|
|
|
eg:
NOTE: In order to test this WiFi function, you can use “ping www.baidu.com” website to verify it.
Config WiFi On Ubuntu & Debian systerm
On serial console, you should see some debug message which can show if the Hikey board have booted into ubuntu systerm successfully. You can config this WiFi according to this follow instruction:
Supposed the login user is peter.
Find out the wireless device name ##
$ iw dev1234phy#0Interface wlan0ifindex 3type managedThe above output shows that the system has 1 physical WiFi card, designated as phy#0.
The device name is wlan0. The type specifies the operation mode of the wireless device.
managed means the device is a WiFi station or client that connects to an access point.configure the wifi data for the wifi device you selected
12cd /etc/wpa_supplicantvi wpa_supplicant.conthen you should remove all the existed entries parenthesized by’network={‘; those entries are original configures, probably not suitable for your network environment, so you can delete them.
Now, you can configure your own wifi data:wpa_passphrase CTS 88888888 >> /etc/wpa_supplicant/wpa_supplicant.conf
Please note that you should replace the ‘CTS’, ‘88888888’ with your AP configuring parameters. If you want to more info about this command, please refer to wpa_passphrase manual.
To be more security, you can remove the ‘#psk=xxxx’ from the wpa_supplicant.conf;
If your AP is hidden SSID, add this option just following the configure line of ‘ssid=”???”‘ :
scan_ssid=1configure the wifi interface
You must configure a corresponding wifi interface to make wifi enabled during the booting.
12cd /etc/network/interfaces.dcp -Pp wlan0.cfg.template xxxx.cfgYou should replace the ‘xxxx’ as your wifi device name, such as wlan0. Modify the new xxx.cfg, add these configurations:
12auto xxxxiface xxxx inet dhcpYou also need to replace the ‘xxxx’ with your wifi device name. Here, we only use dhcp as the defualt network mode, if you want to
configure others, please do it yourself.
You also need to update the configure relevant to the sys configure file
of sleep_auth, just modify the file path correspond to your wifi device:pre-up echo 0 > /sys/kernel/debug/ieee80211/phy0/wlcore/sleep_authThis configure matchs to wlan0. If your device is not wlan0, please check what is the right path based on the output of the above ‘iw dev xxxx’ (
here, xxxx is the wifi device name), you can find what is the phy index,then replace the phy0 with the correct phy index.If your envinorment has not any wired network device, you can rename the eth3.cfg in
/etc/network/interfaces.das eth3.cfg.template;reboot the system adn verify the wifi status
At first, please reboot the system.
After the system is ready, you can check whether the wifi is ready:Check whether the wireless device is up.
$ ip link show wlan0123: wlan0: (BROADCAST,MULTICAST) mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ff`Look for the word “UP” inside the brackets in the first line of the output.
Enable the wireless device
In the above example, wlan0 is not UP. Execute the following command to bring it up:$ sudo ip link set wlan0 up[sudo] password for peter:
Note: you need root privilege for the above operation.If you run the show link command again, you can tell that wlan0 is now UP.
$ ip link show wlan0123wlan0: (NO-CARRIER,BROADCAST,MULTICAST,UP) mtu 1500 qdisc mq state DOWN mode DEFAULTqlen 1000link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ffCheck the connection status.
$ iw wlan0 link
you can found the connect is ok now.$ ip addr show wlan012345wlan0: mtu 1500 qdisc mq state UP qlen 1000link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ffinet 192.168.1.113/24 brd 192.168.1.255 scope global wlan0inet6 fe80::76e5:43ff:fea1:ce65/64 scope linkvalid_lft forever preferred_lft forever
NOTE: In order to test this WiFi function, you can use “ping www.baidu.com” website to verify it.
Fedora && CentOS wifi configure
Please run ‘iw dev’ to collect the wifi device information as the first step. You at least need to know what is the device name of your wifi.
configure the wpa_supplicant environment
12cd /etc/sysconfigvi wpa_supplicantYou should add your wifi device name and the relative driver in that file, such as
-iwlan0,-Dnl80211;Configure the wpa_supplicant.conf
wpa_passphrase CTS 88888888 >> /etc/wpa_supplicant/wpa_supplicant.conf
Then edit the wpa_supplicant.conf just as what you done in Debian or Ubuntu.Create a wifi connection
You need to create a corresponding wifi connection file in
/etc/sysconfig/network-scripts.
nmcli dev wifi connect CTS password 88888888 wep-key-type key ifname wlan0 name wlan0 hidden yes this command will create the wifi connection in/etc/sysconfig/network-scriptsYou should replace the ‘CTS’ ‘88888888’ with your own wifi AP configurations.
If your wifi device is not ‘wlan0’, please replace it with right name too.
If your AP is not hidden ssid, please remove ‘hidden yes’This command must be sucessful. It will enable the wifi link. sometimes, this command will get failed for conflicting with previous scan, you should run it again in some times.
Since your had configure the password in the above command, the #psk in wpa_supplicant.conf is not needed since it will disclose to the others. It is better to remove that line in /etc/wpa_supplicant/wpa_supplicant.conf. –remove that line ‘#psk=”88888888”‘i
reboot your system and verify it
After your system is booted, check the wifi link and the IP address:
iw wlan0 linkip addr show wlan0When the above are ok, you can do some pings to external website.
OpenSuse Wifi configure
modify the wifi connection file (such as ifcfg-xxx)
12cd /etc/sysconfig/networkcp -Pp template-ifcfg-wlan0 ifcfg-xxxyou should replace xxx with your wifi device name you pick up. Update these configure items with your local AP settings:
12WIRELESS_ESSID='xxxx'WIRELESS_WPA_PSK='yyyyyyyy'The ‘xxxx’ ‘yyyyyyyy’ should be replaced with your wifi SSID and KEY.If your AP is hidden ssid, add this option:
WIRELESS_HIDDEN_SSID='yes'Please note that, the current configuration in ifcfg-xxx is for PSK. If your wifi AP configuration is different, please make the relevant modifications by yourself.
reboot the system and verify it
Same as the operation on other distributions.
All the above configure should be done for the first time. If you change the AP configurations, please update those configure files above with correct options. Otherwise, the wifi should be ok every booting.