commontorizon / meta-common-torizon

Fork of the TorizonCore OpenEmbedded Distro Layer to create Common TorizonCore
MIT License
9 stars 8 forks source link

systemd-resolved not functioning properly, needs "kick" #13

Closed bw908 closed 7 months ago

bw908 commented 8 months ago

Running on a Pi 4B, with wireless connection only.

I have configured WLAN with an appropriate wpa_supplicant.conf and an entry in /etc/systemd/network telling it to use DHCP for wlan0.

The interface comes up, and gains a correct IP address, but cannot reach the internet. I am able to e.g. ping the router at 192.168.1.1, but ping 8.8.8.8 fails.

Further investigation reveals this is due to a missing /etc/resolv.conf as generated by systemd-resolved, which is not running. journalctl -u systemd-resolved shows no errors or entries, and systemctl status shows it's enabled, but inactive (dead).

systemctl restart systemd-resolved or even just systemd-resolved --status seems to "wake" it up, after which resolv.conf is generated and the network connection becomes usable.

As far as I can tell, we have not made any changes to related areas of the system settings apart from adding the wlan0 entry for systemd-networkd.

microhobby commented 8 months ago

Hey @bw908 thanks for the report, I will take a look at this.

drewmoseley commented 8 months ago

Are we actually using systemd-resolved here? I thought we were using Network Manager as we do with Torizon OS.

microhobby commented 8 months ago

yeah, you are right @drewmoseley. But also I remember that for some reason -dev images are using the connman instead of Network Manager (this is another issue that we should investigate).

@bw908 if you are using the -dev pre-built image you should have the connman, so you can follow this article: https://developer.toradex.com/linux-bsp/application-development/networking-connectivity/toradexs-linux-images-how-to-connect-to-a-wi-fi-network/#interactively

bw908 commented 8 months ago

Ah, if that's the issue (that NetworkManager is missing) then that's probably the thing to poke at for consistency between dev and final images. I will probably just build a non-dev image instead.

microhobby commented 7 months ago

It was fixed by #14

BhupiMAD commented 6 months ago

I was using the pre-released 6.5.0 for rpi4. Everything working as expected but i recently changed my router and the dhcp ip address was configured to be 192.168.0.... but the rpi is still taking the old ip 10.0.0.48. I get that the new image is using network manager, is there some way to force rpi to renew dhcp lease?

drewmoseley commented 6 months ago

You can probably do something like:

nmcli con down id 'Connection Name'
nmcli con up id 'Connection Name'

or just reboot. You can probably also restart the whole network manager service.