如何使用 Buildroot 在启动时连接到 Wifi?
我试图在启动后自动将我的 Raspberry Pi CM4 连接到 Wifi。我正在使用基于 Buildroot 的 Linux 发行版。我之前使用过 Yocto,它提供了 systemd-networkd 和 wpa_supplicant 功能来在启动时连接到 wifi。我在 Buildroot 中找到了类似的东西,但在网上找不到任何注释。
到目前为止,我想我已经使用 make menuconfig
启用了必要的配置/驱动程序:
但是现在,我如何设置 wpa_supplicant.conf?任何注释或建议的链接都会有帮助。
有人可以让我知道如何进一步进行吗?
我们将非常感谢您的帮助。
提前致谢。
PS:我正在使用 Buildroot 2022.02 版本,并且还使用 systemd 功能,如果此处缺少任何信息,请告诉我。
I am trying to connect my Raspberry Pi CM4 to Wifi automatically after start-up. I am using Buildroot based Linux distribution. I have worked with Yocto before and it provides systemd-networkd and wpa_supplicant feature to connect to wifi on boot. I am lloking something similar in Buildroot but couldn't find any notes online.
So far, I think I have enabled the necessary config/driver using make menuconfig
:
but now, how can I set-up wpa_supplicant.conf? Any link to notes or suggestion would be helpful.
Can anyone please let me know how to proceed further with it?
Your help will be much appreciated.
Thanks in advance.
P.S: I am using Buildroot 2022.02 release and also using systemd feature and let me know if any info is missing here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试做同样的事情,但最终无法让 wpa_supplicant 与 connman 合作。 Connman 不断抛出“错误 /net/connman/technology/wifi:不支持”,并且我在网上找到的修复程序都不起作用。
相反,我改用 iwd,它是 wpa_supplicant 的现代替代品。
我只需要添加文件
/var/lib/iwd/.psk
内容:
然后一切正常!默认情况下,它将尝试在启动时自动连接。如果断开连接,它会尽可能重新连接。它基本上是我需要的一切,因此我已经放弃尝试让 wpa_supplicant 合作。
附注我还用 connman 测试了 iwd,这似乎也工作得很好。
I tried to do the same thing but ultimately could not get wpa_supplicant to cooperate with connman. Connman kept throwing "Error /net/connman/technology/wifi: Not supported" and none of the fixes I found online worked.
Instead I switched to using iwd, the modern replacement for wpa_supplicant.
I only needed to add the file
/var/lib/iwd/<MyWifiSSID>.psk
with the contents:
Then everything worked! By default it will try to autoconnect at boot. If it disconnects, it reconnects whenever possible. It is basically everything I need, and therefore I have given up trying to get wpa_supplicant to cooperate.
ps. I have also tested iwd with connman on top, which also seems to work quite nice.