For networking, our yocto images are currently (status: Nov. 2024) using systemd-networkd which can be quite cumbersome for users without experience. The following tutorials are covering the most important basic network settings.
DHCP / Static IP addresses
In order to enable DHCP or set a static IP address please refer to the systemd-networkd documentation linked above. In case you have configured the IP address being provided as a static IP address by the DHCP server via the system's MAC address and the system does not get the according IP address from the DHCP server, it may be caused by the way some Linux distributions are announcing themselves on the network (UID vs. MAC address), which can be resolved as described here:
[DHCP]
ClientIdentifier=mac
WiFi
Setting up a WiFi connection on a specific WiFi network interface (wlan0
-interface on the following example) can be done as shown below for a BeagleboneBlue Yocto image example:
Edit the file /etc/wpa_supplicant.conf
Comment out the existing and paste the following new content as follows:
[DHCP]
ClientIdentifier=mac
Save the file and exit the editor.
Now edit the file /etc/systemd/network/30-wlan0.network and add the following content:
[Unit]
Description=Start udhcpc DHCP client
After=wpa_supplicant.service
Wants=wpa_supplicant.service
[Service]
Type=oneshot
ExecStart=/sbin/udhcpc -i wlan0
TimeoutSec=30
Restart=on-failure
[Install]
WantedBy=network.target
Now rename the following file so it will not be used by the system anymore:
mv /etc/network/interfaces /etc/network/interfaces.bak
Finally reboot the system:
reboot
WiFi should work now.