In previous post we already cover about how we can Enable the Wi-Fi. Until then, we still unable to use them in our linux. In this part, we shall cover how to configure and connect to Wi-Fi hotspot using some tools we will enable and configure these tools using configuration file.
Here we go:
$ make menuconfig
- Enable wireless tools, dhcpcd and dropbear
networking application:
- Target packages
- – Networking applications
[] dhcpcd [] dropbear
[*] wireless tools
- Enable libpjsip
- Target packages
- – Libraries
- – – Networking
- – – – [*] libpjsip
- create password for root user (important to access via ssh):
System configuration —>
() Root password
To configure wireless we will use and configure wpa_supplicant we will use rootfs overlay which we already setup at the post before:
Editing wpa_supplicant.conf:
$ wpa_passphrase SSID pass
network={
ssid=”SSID”
#psk=”PASSword”
psk=9d62b9cb3ca9f032bffd7257f8453acfcee2d91d600501a05f491fcc04a8d075
}
add the configuration above to /etc/wpa_supplicant.conf at our target rootfs:
$ mkdir board/tryingrootfs/beagleboneblack/rootfs-overlay/etc/
$ vi board/tryingrootfs/beagleboneblack/rootfs-overlay/etc/wpa_supplicant.conf
[i]
network={
ssid=”SSID”
#psk=”PASSword”
psk=9d62b9cb3ca9f032bffd7257f8453acfcee2d91d600501a05f491fcc04a8d075
}
[esc]
[:wq]
$ mkdir -p board/tryingrootfs/beagleboneblack/rootfs-overlay/etc/init.d
$ vi board/tryingrootfs/beagleboneblack/rootfs-overlay/etc/init.d/S99wlan
[i]
!/bin/sh
echo Starting WLAN
/usr/bin/wlan_up &
[:wq]
change the mode of the file so it’s executable:
$ chmod +x board/tryingrootfs/beagleboneblack/rootfs-overlay/etc/init.d/S99wlan
$ mkdir -p board/tryingrootfs/beagleboneblack/rootfs-overlay/usr/bin
$ vi board/tryingrootfs/beagleboneblack/rootfs-overlay/usr/bin/wlan_up
[i]
!/bin/sh
until iwconfig | grep wlan0; do sleep 5; echo ” tick “; done
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf -Dwext -B dhclient
udhcpc -i wlan0
[:wq]
$ chmod +x board/tryingrootfs/beagleboneblack/rootfs-overlay/usr/bin/wlan_up
Create our image:
$ make
Then write the image to micro sd-card and test if our beaglebone can connect to the Wi-Fi we describe in wpa_supplicant.conf.