Reputation: 723
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:
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
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
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 \
"
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.
Upvotes: 2
Views: 4447
Reputation: 1143
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
.
Upvotes: 0