For historical reference, if you were following some earlier MaaXBoard training articles, you may have come across instructions for creating a Wi-Fi AP (Access Point). These instructions do create an AP, but we have found that newer iOS and Android mobile devices will not connect to the AP. Note that some older mobile devices as well as any host computer (Linux, Windows, MacOS) would connect. For your reference only, the instructions that will set up a Wi-Fi AP, but will not work for modern iOS and Android devices are as follows.
Create a Wi-Fi AP
root@maaxboard:~# nmcli dev wifi hotspot ifname wlan0 con-name HotSpotAP ssid wifi_testAP password 12345678
Delete the Wi-Fi AP
root@maaxboard:~# nmcli con del MyHostspot
The remainder of this project is dedicated to configuring the MaaXBoard as a Wi-Fi AP so that all devices can connect to it.
Download the archive MaaXBoardWiFiAP.zip to your host computer. Note that Hackster.io has placed the download link at the very end of this project.
Unzip the archive.
The unzip process should have created a directory called AP that contains four files.
We are going to put the AP folder on the MicroSD card that is used to boot the MaaXBoard with Debian Linux. This MicroSD card has two partitions: the first partition, known as the boot partition, is formatted as FAT which is easily read by any modern operating system. The second partition, known as the root file system (or rootfs) is formatted as EXT4 which can only be ready by UNIX-like operating systems such as Linux. If you are working on a Windows or MacOS host computer, place the AP folder in the boot partition. If you are working on a Linux host computer, you can put the AP folder either in the boot partition or in a specific location within the rootfs partition.
Let's just assume that you put the files on the boot partition.
Transfer the MicroSD card back to the MaaxBoard, connect an Ethernet cable to the MaaXBoard, and power on the board.
Perform the remainder of these instructions on the MaaXBoard command line. You can use keyboard+mouse+monitor, SSH, or the Linux console, to enter the commands.
From my host computer (Ubuntu GNU/Linux) I am going to SSH in to the MaaXBoard.
[flint@ZBook] $ ssh root@192.168.1.64
root@192.168.1.64's password: avnet
Confirm where our root login directory is.
root@maaxboard:~# pwd
The expected answer should be /root
If you are logged in to a different account, then your PWD (Present Working Directory) may be /home/UserName
Back up the original /etc/udhcpd.conf file by renaming it.
root@maaxboard:/etc# mv /etc/udhcpd.conf /etc/udhcpd.conf.backup
Move the AP folder from where you placed it originally to where we need it
root@maaxboard:~# mv /boot/AP /root/AP
Change directory to where we moved the AP folder
root@maaxboard:~# cd AP
View the contents of the directory with permissions viewable.
root@maaxboard:~/AP# ls -al
The four files we care about should look something like this:
-rwxr-xr-x 1 root root 221 Feb 5 2021 hostapd.conf
-rwxr-xr-x 1 root root 4259 Feb 5 2021 udhcpd.conf
-rwxr-xr-x 1 root root 928 Feb 5 2021 wifi_ap_start.sh
-rwxr-xr-x 1 root root 785 Feb 5 2021 wifi_stop.sh
If the two Bourne shell scripts (the.sh files) are not executable, then change their permissions with this command:
root@maaxboard:~/AP# chmod +x *.sh
Now it's time to get to work on the Wi-Fi radio by shutting down any existing services
root@maaxboard:~/AP# ./wifi_stop.sh
Expected result is:
Terminating DHCP
Terminating hostapd
Terminating wpa_supplicant
root 3483 1 0 13:45 ? 00:00:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
wlan0 has been disconnected on STA mode and AP mode !
And now we start up the Wi-Fi radio in Host AP mode.
root@maaxboard:~/AP# ./wifi_ap_start.sh
Expected results is:
Configuration file: /etc/hostapd_mx8.conf
rfkill: Cannot open RFKILL control device
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr 26:9d:3a:2b:50:2b and ssid "wifi_testAP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
udhcpd: started, v1.30.1
Use your mobile device or a second host computer to connect to the newly formed Wi-Fi AP.
SSID wifi_testAP
Password 12345678
If everything is working as anticipated, your mobile device will connect to the AP. You can test the connection by running a speedtest or by using a web browser. The MaaXBoard has automatically bridged the Wi-Fi AP with the Ethernet LAN.
Comments