[Buildroot] How to connect to Wifi on start-up using Buildroot?

Sourabh Hegde hrsourabh011 at gmail.com
Wed Mar 16 22:25:04 UTC 2022


Hello Peter,

In my local Buildroot package folder I don't have
"0001-build-re-enable-options-for-libwpa_client.so-and-.patch"
file.
Can you please let me know how to include this file? This is my first time
applying patches in Buildroot. I have downloaded patch file(tar.bz2). I
assume copying patch file to wpa_supplicant dir and running "make clean &&
make" will apply this patch. Please correct me if I am wrong.

And also I tried below to assign IP address to my board (RPi CM4)

wpa_supplicant -B -Dnl80211 -iwlan0 -cwpa_supplicant.conf
udhcpc -i wlan0

But this gives:

udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: broadcasting discover
.
.
.
Is there any other way to assign IP address to the board?

Your help will be much appreciated.

Thanks in advance

On Tue, 15 Mar 2022 at 21:33, Peter Seiderer <ps.report at gmx.net> wrote:

> On Tue, 15 Mar 2022 21:00:54 +0100, Arnout Vandecappelle <arnout at mind.be>
> wrote:
>
> > On 15/03/2022 14:05, Sourabh Hegde wrote:
> > > Helllo Jan,
> > >
> > > Thanks for the answer.
> > >
> > >  From Buildroot 2021 release "ctrl_interface" is disabled and so I
> have
> >
> >   It's disabled unless BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y
> >
> > > commented out below line in etc/wpa_supplicant.conf file
> > >
> > > # |ctrl_interface=/var/run/wpa_supplicant|
> >
> >   This shouldn't be needed. AFAIK wpa_supplicant ignores the option if
> > CTRL_IFACE is not enabled.
> >
> > > |
> > > |
> > > |And also in my rootfs, there is no "|/var/run/wpa_supplicant|" file.
> >
> >   The file (actually, named pipe) is created when wpa_supplicants starts
> up.
> > /var/run is a tmpfs so it can only be created at runtime.
> >
> > > |
> > > |
> > > |
> > > |I have set below options in menuconfig|
> > > |
> > > |
> > > menuconfig.PNG
> > >
> > > Then doing make clean & make results in below errors:
> > >
> > >  >>> wpa_supplicant 2.10 Installing to staging directory
> > > /usr/bin/install -m 0644 -D
> > >
> /root/raspcm4/sources/output/build/wpa_supplicant-2.10/wpa_supplicant/libwpa_client.so
>
> > >
> /root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libwpa_client.so
> > > /usr/bin/install: cannot stat
> > >
> '/root/raspcm4/sources/output/build/wpa_supplicant-2.10/wpa_supplicant/libwpa_client.so':
>
> > > No such file or directory
> > > make[1]: *** [package/pkg-generic.mk:331 <http://pkg-generic.mk:331>:
> > >
> /root/raspcm4/sources/output/build/wpa_supplicant-2.10/.stamp_staging_installed]
>
> > > Error 1
> > > make: *** [Makefile:23: _all] Error 2
> > >
> > > Can you please let me know what could be the issue and how to resolve
> it?
> >
> >   I've tried to build the same configuration (with current git master)
> and it
> > builds without problems.
>
> Problem introduced on buildroot git master with wpa_supplicant version
> bump [1] and
> fixed with [2]...
>
> Regards,
> Peter
>
> [1]
> https://git.buildroot.net/buildroot/commit/package/wpa_supplicant?id=39381a467cd2cfc15f77d3f9adbf329d2f92e312
> [2]
> https://git.buildroot.net/buildroot/commit/package/wpa_supplicant?id=c4eebf191c781a3ea6b5eb1811cc17ae92ea2fb2
>
> >
> >   Please supply the defconfig and also the full build log (by uploading
> to a
> > pastebin).
> >
> >   Regards,
> >   Arnout
> >
> >
> > >
> > > Thanks in advance
> > > ||
> > >
> > > On Thu, 10 Mar 2022 at 19:03, Jan Havran <havran.jan at email.cz
> > > <mailto:havran.jan at email.cz>> wrote:
> > >
> > >     Hi Sourabh,
> > >
> > >     after enabling RPi firmware you must load the Wifi driver - since
> you are using
> > >     systemd, it should by handled by udev on start I think.
> > >
> > >     So you probably just need to configure /etc/network/interfaces to
> start
> > >     wpa_supplicant
> > >     on wlan0 with /etc/wpa_supplicant.conf file, where you can put
> your credentials.
> > >     Or at least that is what I have done, but I am not using systemd.
> > >
> > >     I did something similar some time ago, you can check it here:
> > >
> https://gitlab.com/sonicpp/gnss-pi/-/commit/caf0317c024e51fc7e322deacd09ec9346d47e26
> > >     <
> https://gitlab.com/sonicpp/gnss-pi/-/commit/caf0317c024e51fc7e322deacd09ec9346d47e26
> >
> > >
> > >     (note that to make "my" credentials public in that commit was an
> intention).
> > >
> > >     P.S.: if you want to have any modifications to be part of your
> image with
> > >     filesystem,
> > >     you can do it by using rootfs overlays for example:
> > >     https://buildroot.org/downloads/manual/manual.html#rootfs-custom
> > >     <https://buildroot.org/downloads/manual/manual.html#rootfs-custom>
> > >
> > >     Regards,
> > >
> > >     Jan Havran
> > >
> > >     V Thu, Mar 10, 2022 at 05:43:27PM +0100, Sourabh Hegde napsal(a):
> > >      > Hello All,
> > >      >
> > >      > 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" :
> > >      > [image: wpa_supplicant.png]
> > >      > [image: firmware.png]
> > >      >
> > >      > 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.
> > >      >
> > >      > Regards,
> > >      >
> > >      > Sourabh
> > >
> > >
> > >
> > >
> > >      > _______________________________________________
> > >      > buildroot mailing list
> > >      > buildroot at buildroot.org <mailto:buildroot at buildroot.org>
> > >      > https://lists.buildroot.org/mailman/listinfo/buildroot
> > >     <https://lists.buildroot.org/mailman/listinfo/buildroot>
> > >
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot at buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
> > _______________________________________________
> > buildroot mailing list
> > buildroot at buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20220316/6fdbc41f/attachment-0001.html>


More information about the buildroot mailing list