Failed to enable BBB wifi

#21

In that case, use the v4.19.x-rt branch: today (April 16) that would be 4.19.31-bone-rt-r31

http://repos.rcn-ee.net/latest/stretch-armhf/LATEST-bone-rt

Most of the current startup delay is loading all the usb gadget modules and waiting for the wl18xx SoftAp0 startup.

v4.14.x-rt was very slow on startup…

Regards,

#22

rfkill is a user/rootfs setting.

Regards,

#23

Fixed with: 4.14.109-bone-rt-r21

Regards,

#24

Hello,
To shorten the booting time, I have disabled some backend services as below. Do you know how to disable usb0/usb1 network? Is there any other way to fast booting?
Thanks.

usb0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.7.2 netmask 255.255.255.252 broadcast 192.168.7.3
ether f4:5e:ab:ee:27:28 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.6.2 netmask 255.255.255.252 broadcast 192.168.6.3
ether f4:5e:ab:ee:27:2b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

root@arm:~# cat /boot/uEnv.txt
uname_r=4.19.19-bone-rt-r21
lpj=1990656
optargs=quiet lpj=1990656
enable_uboot_overlays=1
uuid=62a678cb-5b69-49f0-b434-b604592ed83f

root@arm:~# btime
6.319s dev-mmcblk1p1.device
5.537s generic-board-startup.service
1.935s bb-wl18xx-bluetooth.service
1.299s systemd-udev-trigger.service
742ms ssh.service
650ms systemd-journald.service
525ms wpa_supplicant.service
447ms sysstat.service
436ms systemd-logind.service
420ms systemd-tmpfiles-setup-dev.service
403ms systemd-modules-load.service
328ms systemd-random-seed.service
322ms connman.service
267ms systemd-udevd.service
221ms dev-mqueue.mount
209ms sys-kernel-debug.mount
205ms systemd-remount-fs.service
191ms user@0.service
190ms sys-fs-fuse-connections.mount
175ms sys-kernel-config.mount
169ms kmod-static-nodes.service
157ms systemd-user-sessions.service
154ms systemd-tmpfiles-setup.service
151ms systemd-sysctl.service
147ms systemd-journal-flush.service
108ms bluetooth.service
101ms systemd-rfkill.service
101ms systemd-update-utmp.service
51ms systemd-update-utmp-runlevel.service
The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

multi-user.target @9.687s
└─bb-wl18xx-bluetooth.service @7.743s +1.935s
└─bluetooth.service @8.763s +108ms
└─basic.target @2.151s
└─sockets.target @2.151s
└─dbus.socket @2.151s
└─sysinit.target @2.150s
└─systemd-udev-trigger.service @848ms +1.299s
└─systemd-journald.socket @515ms
└─-.slice @439ms
Startup finished in 2.877s (kernel) + 9.755s (userspace) = 12.633s

#25

Here’s a couple questions before i answer that.

Are you using usb0/usb1? Are you using the usb-serial gadget device? (Are you using the usb-flash gadget device?) Are you using the SoftAp0 wifi interface?

These are all tied together internally, so depending on your answer there are certain things that can be done…

Regards,

#26

Hi,
We just use the wifi network and bluetooth. We do not need softap and usb0/usb1 and usb-serial gadget.
B.R.

#27

Okay, just disable generic-board-startup.service then…

sudo systemctl disable generic-board-startup.service

You’ll get a few more seconds, as that script loads an external module and builds a usb gadget driver thru configfs, thus takes a few moments…

Regards,

#28

Just tried but it took longer.

root@arm:~# btime
5.857s dev-mmcblk1p1.device
2.099s bb-wl18xx-bluetooth.service
1.569s systemd-udev-trigger.service
756ms ssh.service
711ms systemd-journald.service
540ms wpa_supplicant.service
422ms systemd-random-seed.service
421ms systemd-tmpfiles-setup-dev.service
343ms connman.service
290ms sys-kernel-config.mount
285ms dev-mqueue.mount
275ms systemd-udevd.service
273ms systemd-modules-load.service
236ms kmod-static-nodes.service
211ms sys-kernel-debug.mount
210ms systemd-journal-flush.service
210ms user@0.service
208ms systemd-logind.service
193ms sys-fs-fuse-connections.mount
166ms systemd-tmpfiles-setup.service
153ms systemd-sysctl.service
136ms bluetooth.service
132ms systemd-remount-fs.service
129ms systemd-rfkill.service
120ms systemd-update-utmp.service
101ms systemd-user-sessions.service
63ms systemd-update-utmp-runlevel.service

The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

multi-user.target @1min 32.826s
└─bb-wl18xx-bluetooth.service @1min 30.717s +2.099s
└─bluetooth.service @1min 31.918s +136ms
└─basic.target @2.667s
└─sockets.target @2.651s
└─dbus.socket @2.636s
└─sysinit.target @2.588s
└─systemd-udev-trigger.service @1.003s +1.569s
└─systemd-udevd-control.socket @660ms
└─-.slice @520ms
Startup finished in 3.348s (kernel) + 1min 32.919s (userspace) = 1min 36.268s

[ 5.153301] systemd-journald[226]: Received request to flush runtime journal from PID 1
[ 10.815657] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 10.822923] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’
[ 10.826460] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 10.826486] cfg80211: failed to load regulatory.db
[ 11.682048] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
[ 11.810505] wlcore: loaded
[ 12.382101] wlcore: PHY firmware version: Rev 8.2.0.0.242
[ 12.424534] wlcore: firmware booted (Rev 8.9.0.0.79)
[ 12.436834] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 16.759250] wlan0: authenticate with 2c:b2:1a:44:40:92
[ 16.768836] wlan0: send auth to 2c:b2:1a:44:40:92 (try 1/3)
[ 16.804821] wlan0: authenticated
[ 16.809048] wlan0: associate with 2c:b2:1a:44:40:92 (try 1/3)
[ 16.992051] wlan0: RX AssocResp from 2c:b2:1a:44:40:92 (capab=0xc11 status=0 aid=2)
[ 17.005048] wlan0: associated
[ 17.459931] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 17.474322] wlcore: Association completed.
[ 95.113310] Bluetooth: Core ver 2.22
[ 95.113505] NET: Registered protocol family 31
[ 95.113512] Bluetooth: HCI device and connection manager initialized
[ 95.113540] Bluetooth: HCI socket layer initialized
[ 95.113553] Bluetooth: L2CAP socket layer initialized
[ 95.113604] Bluetooth: SCO socket layer initialized
[ 95.149115] Bluetooth: HCI UART driver ver 2.3
[ 95.149132] Bluetooth: HCI UART protocol H4 registered
[ 95.149359] Bluetooth: HCI UART protocol LL registered
[ 95.149366] Bluetooth: HCI UART protocol ATH3K registered
[ 95.149466] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 95.449112] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 95.449125] Bluetooth: BNEP filters: protocol multicast
[ 95.449157] Bluetooth: BNEP socket layer initialized

#29

Hum, i guess force loading those modules helped speed up wifi loading…

Well next I’d remove your custom uuid option for rootfs, as that get’s decoded by the initramfs which you can also remove to get a few moments…

Then you can remove the /boot/initrd* file and you should get another speedup…

Regards,

#30

So this was caused by our service file for bluetooth requiring generic-board-startup.sevice:

I don’t remember the hard requirements for that, but you could try editing: /lib/systemd/system/bb-wl18xx-bluetooth.service

and change:

After=getty.target bluetooth.service generic-board-startup.service 
After=getty.target bluetooth.service

But retest and verify bluetooth still works…

Regards,

#31

Hello,

1,What’s the procedure to remove “initramfs”?
2, I tried to remove generic-board-startup.service in /lib/systemd/system/bb-wl18xx-bluetooth.service, but it seems bluetooth still start up slowly. Even I disable bb-wl18xx-bluetooth.service, still start up slowly. multi-user.target/getty.target is waiting for something up till time out. Is there any way to remove the dependency on generic-board-startup.service for multi-user.target/getty.target?

root@arm:~# btime
6.070s dev-mmcblk1p1.device
1.248s systemd-udev-trigger.service
771ms ssh.service
744ms systemd-fsck-root.service
710ms systemd-journald.service
512ms wpa_supplicant.service
340ms connman.service
337ms systemd-modules-load.service
332ms systemd-tmpfiles-setup-dev.service
300ms dev-mqueue.mount
287ms sys-kernel-debug.mount
243ms sys-fs-fuse-connections.mount
224ms kmod-static-nodes.service
208ms systemd-logind.service
206ms systemd-udevd.service
200ms user@0.service
194ms systemd-tmpfiles-clean.service
175ms systemd-sysctl.service
169ms systemd-update-utmp.service
163ms systemd-remount-fs.service
151ms systemd-journal-flush.service
147ms sys-kernel-config.mount
135ms systemd-user-sessions.service
123ms systemd-tmpfiles-setup.service
88ms systemd-random-seed.service
70ms systemd-rfkill.service
60ms systemd-update-utmp-runlevel.service

The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

multi-user.target @1min 30.644s
└─getty.target @1min 30.643s
└─serial-getty@ttyS0.service @5.235s
└─dev-ttyS0.device @5.206s

Startup finished in 1.203s (kernel) + 1min 30.745s (userspace) = 1min 31.948s

#32

First make sure you’ve removed all references to UUID in /boot/uEnv.txt

Next just delete these files and reboot…

sudo rm -rf /boot/initrd*

Regards,