Wi-Fi/BT
The Luckfox Pico Zero is equipped with the AIC8800DC module, supporting the WiFi AX protocol (WiFi 6), and compatible with 2.4GHz WiFi and Bluetooth 5.2/BLE.By default, the development board uses an external antenna. To switch to the onboard chip antenna, simply pull up GPIO pin 123. The steps are as follows:
echo 123 > /sys/class/gpio/export
cd /sys/class/gpio/gpio123
echo out > direction
echo 1 > value
1. WiFi
1.1 Buildroot Connection WiFi
-
Edit the WiFi configuration file using
viornanoeditornano /etc/wpa_supplicant.confctrl_interface=/var/run/wpa_supplicantap_scan=1update_config=1network={ssid="luckfox"psk="12345678"key_mgmt=WPA-PSK}-
ssid: Name of the wireless networkpsk: Password of the wireless networkModify according to your actual wireless network name and password. No need to change other settings.
-
-
If you want to switch WiFi networks, you need to restart the
wpa_supplicantservice:killall -9 wpa_supplicantwpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -
Connect to the wireless network.
udhcpc -i wlan0
-
Note: These settings will be lost after reboot. To persist the configuration, you’ll need to write a startup script (for onboard antenna).
#!/bin/shGPIO_NUM=123WPA_CONF="/etc/wpa_supplicant.conf"echo_log() {echo "[wifi-autostart] $1"}case "$1" instart)echo_log "Exporting and setting GPIO${GPIO_NUM} high..."[ ! -d "/sys/class/gpio/gpio${GPIO_NUM}" ] && echo "${GPIO_NUM}" > /sys/class/gpio/exportecho out > "/sys/class/gpio/gpio${GPIO_NUM}/direction"echo 1 > "/sys/class/gpio/gpio${GPIO_NUM}/value"echo_log "Starting wpa_supplicant..."killall -q wpa_supplicantwpa_supplicant -B -i wlan0 -c "${WPA_CONF}"echo_log "Requesting IP address via udhcpc..."udhcpc -i wlan0echo_log "WiFi setup complete.";;stop)echo_log "Stop command received. Stopping wpa_supplicant..."killall -q wpa_supplicant;;*)echo "Usage: $0 {start|stop}"exit 1;;esac -
According to the above configuration method, the settings will be lost after reboot. Therefore, you need to create a startup script to reapply them (for external antenna use).
nano /etc/init.d/S99wlan0#!/bin/shcase $1 instart)wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.confudhcpc -i wlan0;;stop);;*)exit 1;;esacchmod +x /etc/init.d/S99wlan0reboot
1.3 WiFi Speed Test
-
On the virtual machine or host
iperf3 -s -i 10 -p 5001-s: Specifies that iperf3 runs in server mode-i: Sets the report interval to 10 seconds-p: Specifies the server port as 5001
-
On the development board
iperf3 -c 192.168.10.176 -p 5001 -f m -i 2 -t 24- -c: Specifies client mode and sets the server IP address to 192.168.10.176
- -p: Specifies the server port as 5001
- -f: Sets the report format. m indicates Mbps (megabits per second)
- -i: Sets the reporting interval (in seconds)
- -t: Specifies the test duration (in seconds)
2. Bluetooth
2.1.1 Connect Headphones to the Development Board
- Start the Bluetooth audio service (A2DP Source):
bluealsa -p a2dp-source &
Before establishing a Bluetooth audio connection, the BlueALSA audio service must be started. Otherwise, although device pairing may succeed, the remote device (such as headphones or speakers) will disconnect automatically due to the absence of an audio endpoint (A2DP Endpoint).
- Enable Bluetooth and complete pairing using the
bluetoothctltool:
power on # Enable the Bluetooth controller
pairable on # Set the device to pairable mode
scan on # Scan for nearby Bluetooth devices
scan off # Stop scanning
pair <MAC> # Pair with the target device


- During the initial pairing process, the device may disconnect once briefly. This occurs because the PIN/key confirmation has not been fully completed. In this case, you need to manually trigger the headphones to re-enter pairing mode (for example, for AirPods: open and close the charging case lid again).


- Run the following command to check whether the Bluetooth audio device has been recognized by the system:
bluealsa-aplay -L
- If the target device appears in the output, it indicates that the A2DP device has been successfully registered.
- Use the ALSA interface to output audio via BlueALSA:
aplay -D bluealsa:DEV=AC:12:2F:6C:EB:17,PROFILE=a2dp eason.wav
2.1.2 Connect the Phone to the Development Board
- Start the Bluetooth audio service (A2DP Sink):
killall bluetoothd
/usr/libexec/bluetooth/bluetoothd --compat &
bluealsa -p a2dp-sink &
bluealsa-aplay -D hw:0,0 --profile-a2dp &
Before establishing a Bluetooth audio connection, the BlueALSA audio service must be started. Otherwise, although device pairing may succeed, the remote device (such as headphones or speakers) will disconnect automatically due to the absence of an audio endpoint (A2DP Endpoint).
- Enable Bluetooth and complete pairing using the
bluetoothctltool:
power on # Enable the Bluetooth controller
pairable on # Set the device to pairable mode
discoverable on # Enable discoverable mode

- Go to the Bluetooth settings on your phone. The default device name is BlueZ 5.65. Tap it to connect.

- During the first pairing process, PIN/passkey confirmation is required. Please tap Pair on your phone.

- Return to the board terminal and enter yes when prompted to complete the pairing process.




- After the phone shows a successful connection, open a music player app. The board terminal will display music information, and audio should start playing.


Luckfox Pico Pi supports direct headphone output. Other models require an external speaker.