Wi-Fi on the Banana Pi M2 Zero

This article provides a guide for configuring Wi-Fi on the Banana Pi M2 Zero v1.0 using Armbian, despite the absence of an Ethernet port and without using SPI or any special connectors.

Linux SBC

Configuring Wi-Fi on Banana Pi M2 Zero v1.0 with Armbian

The Banana does not have Ethernet port, so, ususally people configure Wi-Fi using SPI or special connectors. Here is a guide how I have configured Wi-Fi having only SD card. The way is useful only when you are installing clean Armbian system. The idea is to forse the system to configure itself on start:

  1. Download Armbian image and write it into SD card fallowing official instruction.
  2. After writing the image on SD card, go to /etc directory of the SD card (on Windows I've used Eassos DiskGenius to modify EXT3 partition)
  3. Open rc.local file and add next content before exit 0 line:
sleep 10  # Optional delay to ensure other services have started
sudo bash -c 'cat << EOF >> /etc/network/interfaces
iface $(sudo iwconfig | awk "/IEEE/ {print \$1}") inet dhcp
    wpa-driver wext
    wpa-ssid TP-Link_A0DA
    wpa-ap-scan 1
    wpa-proto RSN
    wpa-pairwise CCMP
    wpa-group CCMP
    wpa-key-mgmt WPA-PSK
    wpa-psk 3d6b79ca8723c4798c652d9c5e455258a813af692d80477d627870b070c9236
auto $(sudo iwconfig | awk "/IEEE/ {print \$1}")
EOF'

sudo systemctl restart networking
  1. Modify the commands according to your wifi setup. The main things to modify is Wi-Fi SSID (TP-Link_A0DA) and 3d6b79ca8723c4798c652d9c5e455258a813af692d80477d627870b070c9236 line. The line is something like encrypted Wi-Fi password. On linux it can be got running next command: wpa_passphrase MY-WIFI-NAME MY-WIFI-PASSWORD. The output will be like next:
network={
        ssid="MY-WIFI-NAME"
        #psk="MY-WIFI-PASSWORD"
        psk=3d6b79ca8723c4798c652d9c5e455258a813af692d80477d627870b070c9236
}
  1. Write changes into rc.local of SD card.
  2. Put the card into Banana Pi M2 Zero and turn it on. In few minutes Armbian will start and run commands from rc.local which will modify /etc/network/interfaces configuring the Wi-FI. After that you can find out Banana Pi IP address with a help of your router and connect to it via ssh as usual (ssh root@IP_ADDRESS and default password 1234). Do not forget to remove the commands from rc.local, otherwise they will be run again on next system reboot and will break your network config.
2023-07-08 13:41:03