This tutorial explains how to connect Beaglebone to WI-FI adapter for Internet connectivity. Before proceeding, we need some basic configuration and also an internet connection. First connect the Internet via Ethernet. In this tutorial I used EDMAX which works with almost any type of WI FI adapter.
Fig. 1: Image of the Wi-Fi adapter
Step 1: Connect to the Internet and turn on BBB. Access BBB with SSH via PC.
Step 2: First of all, update your kernel version for better WI-FI performance. (Ignore if already done)
Step 3: Once the update is complete, restart your system.
Step 4: Set the system time and date by searching the network time protocol. It detects and sets the correct time in the system. Follow the command to set the time:
ntpdate -b -s -u pool.ntp.org
Figure 2: Screenshot of root login to Linux console on Beaglebone Black
Step 5: Install git from debian repository to download it directly by cloning the link. Then check whether it is installed or not by typing the following command:
dpkg -s git
Enter the following command if it is not installed:
sudo apt-get install git
Step 4: Now, download and install the WI-FI reset script. It will reset WI-FI connectivity by enabling and disabling BBB initialization. This step is not necessary if you have the latest Kernel version.
clone
Figure 3: Screenshot of installing Wifi Reset Git Clone from Linux console on Beaglebone Black
Step 5: Run the shell script file named install.sh. Make sure it is located in the wifi-reset directory and also set the permission to execute.
Fig. 4: Screenshot of setting permissions for Wifi Reset git Clone from Linux console on Beaglebone Black
Fig. 5: Screenshot of setting permissions for Wifi Reset Git Clone from Linux console on Beaglebone Black
Step 6: Run the WI-FI reset script following the line:
./install.sh
Fig. 6: Screenshot of installing the Linux console Wi-Fi reset script on the Beaglebone Black
Step7: Now, disconnect the Ethernet connection and power cable from BBB. Plug the WI-FI adapter (i.e. EDIMAX in this tutorial) into the USB port and turn the BBB back on. Access BBB with SSH via PC.
Step 8: Check the wireless adapter configuration with the following command:
iwconfig
Figure 7: Screenshot of Linux console wireless adapter check on Beaglebone Black
Here, wlan0 displays the wireless network information. It is currently off, meaning there is no wireless connectivity to BBB.
Step 9: Change the /etc/network directory and open the network interface file. Edit the WI-FI connection information and save it.
cd /etc/rede
nanointerfaces
Fig. 8: Screenshot saving Linux console Wi-Fi connection information on Beaglebone Black
You can see the following result:
Fig. 9: Screenshot of Wi-Fi connection information in the Linux console on Beaglebone Black
Step 10: Configure WI-FI information and set your WI-FI name and password to access connectivity.
Fig. 10: Screenshot of Wi-Fi name and password in Linux console on Beaglebone Black
Enable the above line (see image above) of WI-FI configuration by removing the '#' sign and write down your wifi ID and password in place of the black part as seen above.
Step 11: Now, open the WI-FI connection by following the command:
ifup wlan0
Fig. 11: Screenshot of Linux console Wi-Fi connection configuration on Beaglebone Black
Note: The response should be different, but you need to wait for DHCPOFFER and link to the Internet address.
Step 12: Finally, you have internet connection using WI-FI module. Check the ping response of any website.
For example, pingengineeringgarage.com
Fig. 12: Screenshot of pinging a website from the Linux console on Beaglebone Black
Note: Press ctrl+C to stop the ping process.
Automatic WI-FI access at startup
We have already installed wifi reset script which automatically connects to WIFI on startup. Let's check if it's working or not.
Restart your system by restart command.
After reboot, get BBB access via SSH and check the ping response again. If it responds, you can access WI-FI Internet connectivity successfully.
If not (which is a rare case), disable WI-FI reset and enable it again using the following commands:
ifdown wlan0
ifup wlan0
Enjoy your wireless connection with Beaglebone black.
Fig. 13: Image of the Beaglebone Black connected to the Wi-Fi router