I'm not really sure that this is a wpa_supplicant problem, but around about the time the extension was updated to version 1.0, I started to have problems to connect using a script.
Unfortunately, at about the same time, I changed my laptop, obliging me to use the wl-modules-3.0.21-tinycore extension.
Basically my script will no longer connect first time and I'm obliged to do this: [run script]
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
$ ps aux | grep udhcpc
4023 root udhcpc -b -i eth1 -x hostname boxdell -p /var/run/udhcpc.eth1.pid
$ sudo kill 4023
$ sudo udhcpc -b -i eth1 -x hostname boxdell -p /var/run/udhcpc.eth1.pid
udhcpc (v1.20.2) started
Sending discover...
Sending select for 192.168.1.29...
Lease of 192.168.1.29 obtained, lease time 86400
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.1.1
adding dns 192.168.1.1
This is using "02:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n" hardware and I've tried with two different wireless access points.
No amount of "sleep" commands in the script help - does anybody see the same behaviour?