Setting up WiFi with BeagleBone Black

Setting up WiFi on BeagleBone Black

This was the day I decided to go wireless with my Beaglebone Black(BBB) so that I could log into my BBB wirelessly. This will also be helpful for projects that require internet connectivity using WiFi.

This post describes the procedure to setup the WiFi for the below kernel version.

1. Install the Firmware for the WiFi USB Adapter

If you are using kernel 3.8, then the procedure will differ, and hence I would suggest you look at the article shared by Adafruit.

I am using a Samsung-WIS12ABGNX USB adapter to connect the BeagleBone to the WiFi. So, let’s get started.

First, update your OS and install the drivers for the WiFi adapter on your BBB as shown below.

Power down your BBB, connect the WiFi adapter to its USB port and then power on the BBB. Now the BBB should be able to recognize the WiFI adapter and load the drivers on start up. This can be checked using the ‘dmesg’ command as shown below.

2. Install ConnMan Package

Now, make sure that you have the ConnMan package installed. You can check this as shown below.

If you cannot see the connman package as shown above, then you haven’t installed it. Hence, I’d suggest you install it by using the below command. And make sure you are connected to the internet through ethernet. After installing the connman package, unplug the ethernet cable and use USB cable to ssh into the BeagleBone.

Once the installation completes reboot your BBB and you should be able to find the connman package in the lib directory as well. Now you have the connman package installed, let us proceed with configuring the WiFi adapter connected to the BBB and connect to the WiFi.

3. Setup WiFi on BBB

First, let us check the available services and their properties as shown below.

You can see above, that WiFi service is available since the WiFI adapter being connected, however, the properties shows that the WiFi adapter is not powered on and is not connected to the router.

Now, go into an interactive mode for executing further connman commands as shown below, if you’re not as root then use sudo,

This is just to show you that, we are not connected to the internet yet. As you can see below, I tried to ping the google server, but it fails.

Ok, coming back to the configuration, let’s go ahead and enable the WiFi as shown below.

4. Scan and Connect to the Access Point

Perform a scan (wait for the scan to complete and then check for services) to view available access points to connect to as shown below.

From the above, It can be seen that “Vinay1990” is my home router and I will connect to it after enabling the wireless agent by running the command as shown below.

Let’s connect to the access point using the commands shown below, if this is the first time, then it will prompt for a password.

Configure a static IP for your BeagleBone as shown below.

In the above, 192.168.1.123 is the static IP assigned to the BBB and the 192.168.1.1 is the gateway IP address. Let’s go out of the interactive mode and check if we are connected to the internet by pinging the google server as shown below.

From above, It can be seen that we have successfully connected to the internet and able to reach the google server. For more information on the usage of the connmanctl command, you can check out the connmanctl command manual page. You can now go ahead and start building wireless or IoT applications on your BBB. Enjoy 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *