EBC Exercise 06 Setting Up Wifi

From eLinux.org
Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder

See https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshots/31280#network-1 for current instructions on the Wifi.


Here are details on how to set up Wifi:

Make sure you have registered the MAC address of the Wifi-Dongle. (This is different that the MAC address of the Beagle.)

bone$ ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether c8:a0:30:a6:26:e8 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic eth0
       valid_lft 2591768sec preferred_lft 2591768sec
7: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 82:77:16:86:16:94 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic wlan0
       valid_lft 3403sec preferred_lft 3403sec
    inet6 fe80::8077:16ff:fe86:1694/64 scope link
       valid_lft forever preferred_lft forever

The MAC address for the wifi is 82:77:16:86:16:94

Next configure the Wifi (wpa_supplicant). Do this by editing the file /etc/wpa_supplicant/wpa_supplicant-wlan0.conf and put the following in it.

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev


and then restart network with:

beon$ /etc/init.d/networking restart

Connect to network:

beon$ sudo wpa_cli -i wlan0 reconfigure

Test by pinging google:

bone $ping -c2 google.com


Here's how to set up wifi on the Bone.

bone$ connmanctl
Error getting VPN connections: The name net.connman.vpn was not provided by any
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
*AR RHIT-OPEN            wifi_987bf3d2e45e_524849542d4f50454e_managed_none
    BeagleBone-DF34      wifi_987bf3d2e45e_426561676c65426f6e652d44463334_managed_psk
    eduroam              wifi_987bf3d2e45e_656475726f616d_managed_ieee8021x
    DIRECT-da-HP M132 LaserJet wifi_987bf3d2e45e_4449524543542d64612d4850204d313332204c617365724a6574_managed_psk

Here is a list of all the access points the Bone can see. Let's pick RHIT-OPEN and connect to it.

connmanctl> connect wifi_987bf3d2e45e_524849542d4f50454e_managed_none

If you get a "Not registered" error when trying to connect, run this:

connmanctl> agent on

Fortunately connmanctl has TAB completion, so you don't have to type the whole name, just type a few characters and then hit TAB. Once connected you can configure it so it will stay connected.

connmanctl> config wifi_987bf3d2e45e_524849542d4f50454e_managed_none --autoconnect yes

Then you can quit.

connmanctl> quit

See if you can hit google.

bone$ ping -c2 www.google.com
PING www.google.com ( 56(84) bytes of data.
64 bytes from ord36s02-in-f4.1e100.net ( icmp_seq=1 ttl=53 time=9.56 ms
64 bytes from ord36s02-in-f4.1e100.net ( icmp_seq=2 ttl=53 time=14.5 ms

--- www.google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 9.563/12.045/14.528/2.484 ms

It looks good.

More Details

Yes can see help in connmanctl.

bone$ connmanctl
connmanctl> help
state                                 Shows if the system is online or offline
technologies                          Display technologies
clock                                 Get System Clock Properties
help                                  Show help
exit                                  Exit
quit                                  Quit

thumb‎ Embedded Linux Class by Mark A. Yoder