2

I am trying to establish WiFi connection on my Avenger96 (based on 96Boards STM32MP157) board. Goal is to automatically setup WiFi connection during boot time so that there is no need to manually configure WiFi after every boot.

Steps I have done:

  1. Added network section in wpa_supplicant.conf-sane as shown below: poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant:

    ctrl_interface_group=0
    update_config=1
    
    network={
            ssid="WiFi"
            #psk="xxxx"
            psk=bcc0f1e055c895febe6f4766e90a7972334b2dac4dda015876a185a8bd577a04
    }
    
    

I generated psk using making use of wpa_passphrase, a command line tool which generates the minimal configuration needed by wpa_supplicant as:

$ wpa_passphrase WiFi xxxx
  1. Script to initialize the wpa_supplicant and configure WiFi at boot up. I created a custom script “setup-wifi.sh” at the following path /meta/recipes-core/initscripts/initscripts-1.0/setup-wifi.sh:

    ifconfig wlan0 10.233.174.16   #Set the static IP address, should be unique
    wpa_passphrase WiFi  xxxx> /etc/wpa_supplicant.conf
    route add default gw 10.233.174.254  #Router IP address
    wpa_supplicant -B -i   wlan0    -c    /etc/wpa_supplicant.conf
    echo “nameserver 8.8.8.8” >> /etc/resolv.conf
    echo “nameserver 10.233.174.254” >> /etc/resolv.conf
    : exit 0
    
    
  2. Edited the "initscript bitbake recipe" at /meta/recipes-core/initscripts/initscripts-1.0.bb that incorporates the “setup-wifi.sh” and installs it in /etc/initscripts directory after build.

    file://setup-wifi.sh \
    "
    do_install () {
    install -m 0755    ${WORKDIR}/setup-wifi.sh     ${D}${sysconfdir}/init.d
    
    update-rc.d -r ${D} setup-wifi.sh start 99 2 3 4 5 .
    }
    
    MASKED_SCRIPTS = " \
    setup-wifi \
    "
    
    
  3. Included IMAGE_INSTALL_append = " wpa-supplicant iw dhcp-client" and CORE_IMAGE_EXTRA_INSTALL += " packagegroup-base-wifi kernel-modules" in the build/local.conf file. Also, DISTRO_FEATURES_append = " wifi" in my custom recipe. Next, ran bitbake and booted the board using the image.

But, on boot up WiFi is not configured and when I try to connect it manually, I get the following error:

unknown global field 'passphrase must be 8..63 characters'

And when I check the connection using # iw dev wlan0 link, it shows "Not connected".

Can anyone please let me know what I am missing here and how to resolve this? Your help will be much appreciated.

Thanks in advance!

P.S: I am using Ubuntu 20.04 and Yocto Dunfell branch as build system.

Preeti
  • 535
  • 1
  • 6
  • 30
  • 1
    I got confused by the error `unknown global field 'passphrase must be 8..63 characters'`. If the passphrase is correct, then I think some configuration file consists of exactly the same string `passphrase must be 8..63 characters` instead of some useful value and hence the error `unknown global field 'passphrase must be 8..63 characters` . You can search and validate the same `grep -rn "characters" /etc/` – Gaurav Pathak Jan 04 '22 at 08:27
  • Hi @Preeti, if the comment answered your question then please add the solution as an answer to the question and then you can mark that as accepted answer, if you want I can add the comment as answer and you can mark it. Please try to add answers and accept the answers that resolved your query to make it helpful for others like you and me. – Gaurav Pathak Jan 04 '22 at 11:42
  • 1
    Hi Gaurav, sorry for the late reply. Issue is resolved. You can add the comment as answer and I will mark it as answer. Thanks for your help. – Preeti Jan 04 '22 at 20:51

1 Answers1

0

The error unknown global field 'passphrase must be 8..63 characters' is confusing.

If the passphrase is correct, then I think some configuration file consists of exactly the same string passphrase must be 8..63 characters instead of some useful value and hence the error unknown global field 'passphrase must be 8..63 characters.

You can search and validate the same using grep -rn "characters" /etc/ and remove the string from the configuration file that contains passphrase must be 8..63 characters.

Gaurav Pathak
  • 1,065
  • 11
  • 28