Skip to main content

Wi-Fi/BT

The Luckfox Pico Pi is equipped with the AIC8800DC module, supporting the WiFi AX protocol (WiFi 6), and compatible with 2.4GHz WiFi and Bluetooth 5.2/BLE.

1. WiFi

1.1 Buildroot Connection WiFi

  1. Edit the WiFi configuration file using vi or nano editor

    nano /etc/wpa_supplicant.conf 

    ctrl_interface=/var/run/wpa_supplicant
    ap_scan=1
    update_config=1

    network={
    ssid="luckfox"
    psk="12345678"
    key_mgmt=WPA-PSK
    }
    • ssid: Name of the wireless network

      psk: Password of the wireless network

      Modify according to your actual wireless network name and password. No need to change other settings.

  2. If you want to switch WiFi networks, you need to restart the wpa_supplicant service:

    killall -9 wpa_supplicant 
    wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
  3. Connect to the wireless network.

    udhcpc -i wlan0

1.2 Ubuntu Connection WiFi

  1. Edit the WiFi configuration file using vi or nano editor

    sudo su 
    nano /etc/wpa_supplicant.conf

    ctrl_interface=/var/run/wpa_supplicant
    ap_scan=1
    update_config=1

    network={
    ssid="luckfox"
    psk="12345678"
    key_mgmt=WPA-PSK
    }
    • ssid: Name of the wireless network

      psk: Password of the wireless network

      Modify according to your actual wireless network name and password. No need to change other settings.

  2. You need to restart the development board

    reboot
  3. Connect to the wireless network.

    udhcpc -i wlan0

1.3 WiFi Speed Test

  1. 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
  2. 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 Buildroot

2.1.1 Connect Headphones to the Development Board

  1. Start the Bluetooth audio service (A2DP Source):

    bluealsa -p a2dp-source &
    [TIP]

    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).

  2. Enable Bluetooth and complete pairing using the bluetoothctl tool:

    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

  3. 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).

  4. 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.
  5. 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

  1. 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 &
    [TIP]

    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).

  2. Enable Bluetooth and complete pairing using the bluetoothctl tool:

    power on        # Enable the Bluetooth controller
    pairable on # Set the device to pairable mode
    discoverable on # Enable discoverable mode
  3. Go to the Bluetooth settings on your phone. The default device name is BlueZ 5.65. Tap it to connect.

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

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

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

    [TIP]

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

2.2 Ubuntu 22.04

  1. Perform network time synchronization before installing or upgrading packages:

    sudo su 
    ntpd -d
    apt update
  2. Install Bluetooth-related tools:

    apt install bluez
    apt install pulseaudio-module-bluetooth
  3. Start the necessary services:

    hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep&
    pulseaudio --start
  4. Connect a mobile phone to the development board:

    bluetoothctl
    power on # Enable the controller
    discoverable on # Make the controller discoverable
    pairable on # Set the controller as pairable
    # When the phone searches for Bluetooth devices, "luckfox" will appear
    # If a PIN code prompt appears, enter "yes"
  5. Additional bluetoothctl operations:

    scan on              # Scan for devices
    scan off # Stop scanning
    pair <MAC address> # Pair with a specific MAC address
    paired-devices # List paired Bluetooth devices
    connect <MAC address>
    remove <MAC address> # Remove a paired device