BBGG: created flash image with working setup, now wlan (hostapd) is not coming up

I have a test machine in which I try things out, and when it works I create a flash image with the script beaglebone-black-make-microSD-flasher-from-eMMC.sh in /opt/scripts/tools/eMMC.

Strange thing is, that on the test machine, wifi works as an access point, and on the machine that I am flashing no wifi accesspoint comes up.

Any ideas?
flashed machine version.sh, no wifi accesspoint:

git:/opt/scripts/:[a335abcf87d2ef5fd96e7de83cdf3f0ff5a4da2b]
eeprom:[A335BNLTGG1A202006000438]
model:[SeeedStudio_BeagleBone_Green_Gateway]
dogtag:[BeagleBoard.org Debian Image 2020-02-03]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BBGG-WL1835-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.kernel]
UBOOT: Loaded Overlay:[M-BB-BBGG-00A0.kernel]
UBOOT: Loaded Overlay:[wl1835_bt]
kernel:[4.19.94-ti-r71]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20220119.0-0~buster+20220125]
pkg:[bb-usb-gadgets]:[1.20220112.3-0~buster+20220112]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~buster+20211222]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev gpio pwm eqep remoteproc admin spi iio i2c docker tisdk weston-launch xenomai bluetooth cloud9ide]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   22.821442] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   42.114581] remoteproc remoteproc0: wkup_m3 is available
[   42.152702] remoteproc remoteproc0: powering up wkup_m3
[   42.152734] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[   42.153488] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   43.587767] remoteproc remoteproc1: 4a334000.pru is available
[   43.591134] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   43.587767] remoteproc remoteproc1: 4a334000.pru is available
[   43.587962] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[   43.591134] remoteproc remoteproc2: 4a338000.pru is available
[   43.591281] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[    1.040051] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    1.053596] gpio-of-helper ocp:cape-universal: ready
END

test machine:

git:/opt/scripts/:[a335abcf87d2ef5fd96e7de83cdf3f0ff5a4da2b]
eeprom:[A335BNLTGG1A202006000415]
model:[SeeedStudio_BeagleBone_Green_Gateway]
dogtag:[BeagleBoard.org Debian Image 2020-02-03]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-00002-g3d8c979660 (Nov 01 2019 - 09:14:23 -0500)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g3d8c979660]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-BBGG-WL1835-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[M-BB-BBGG-00A0]
kernel:[4.19.221-bone74]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20220119.0-0~buster+20220125]
pkg:[bb-usb-gadgets]:[1.20220112.3-0~buster+20220112]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~buster+20211222]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev gpio pwm eqep remoteproc admin spi iio i2c docker tisdk weston-launch xenomai bluetooth cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    1.494234] remoteproc remoteproc0: wkup_m3 is available
[    1.649412] remoteproc remoteproc0: powering up wkup_m3
[    1.649436] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[    1.649688] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   22.377465] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   36.958715] Bluetooth: hci0: change remote baud rate command in firmware
dmesg | grep pru
dmesg | grep pinctrl-single
[    0.990692] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    1.004112] gpio-of-helper ocp:cape-universal: ready
END

Hi @Johan_Henselmans so there is one big difference, those tests are running different kernels…

“flash machine” = A… is 4.19.94-ti-r71, and it has my wl1835_bt overlay, so Bluetooth should be working…

UBOOT: Loaded Overlay:[wl1835_bt]
kernel:[4.19.94-ti-r71]

“test machine” = B… is 4.19.221-bone74 and i bet bluetooth is broken…

kernel:[4.19.221-bone74]

Anywho, i’d expect hostapd to rry…

is there anything under?

journalctl -f | grep hostapd

Regards,

journalctl -f | grep hostapd does not show up anything.

I tested the machine with several configurations. Now both are on 4.19.221-bone74, but I can change that back to 4.19.94-ti-r71.

I think the problem is before hostapd is even started. In the process status on the flashed machine I see

root     16325  0.0  0.4   4440  2368 ?        Ss   07:38   0:00 /bin/bash -e /usr/bin/bb-wl18xx-wlan0
root     16355  0.1  0.4   4440  2436 ?        S    07:38   0:00 /bin/bash -e /usr/bin/bb-wl18xx-tether

I tried to run bb-wl18xx-wlan0 by hand:
the first time it stuck on trying to create a mac address:

SeeedStudio_BeagleBone_Green_Gateway)
        firmware="/lib/firmware/ti-connectivity/wl1271-nvs.bin"
        if [ "x${USE_INTERNAL_WL18XX_MAC_ADDRESS}" = "xyes" ] ; then
                set_wlan_0_mac_from_wl18xx
        else
                if [ "x${USE_WL18XX_MAC_ADDRESS}" = "x" ] ; then
                        set_wlan_0_mac_from_cpsw_0
                else
                        set_wlan_0_mac_from_bb_wl18xx
                fi
        fi

So I changed

USE_INTERNAL_WL18XX_MAC_ADDRESS=no

in /etc/default/bb-wl18xx.
Then an address seemed to be created: something got written in /boot/initrd.img-4.19* (I tried several versions).
But then it seemed to be stuck
Here is the current setup:

# USE_WL18XX_IP_PREFIX: default IP block of SoftAP0 interface
USE_WL18XX_IP_PREFIX="192.168.8"

# USE_INTERNAL_WL18XX_MAC_ADDRESS: use internal mac address; set to no to disable.
USE_INTERNAL_WL18XX_MAC_ADDRESS=no

# USE_WL18XX_MAC_ADDRESS: use custom mac address, for when work wifi starts sending deauthentication packet spam.
#USE_WL18XX_MAC_ADDRESS="EC:11:27:B:14:97"

# USE_WL18XX_POWER_MANAGMENT: (sudo iwconfig wlan0 power [on/off]). on = boot default, off is more reliable for accessing idle systems over time
USE_WL18XX_POWER_MANAGMENT=off

# USE_PERSONAL_SSID: set custom ssid
#USE_PERSONAL_SSID="xxxxxxx"

# USE_PERSONAL_PASSWORD: set ssid password
#USE_PERSONAL_PASSWORD="xxxxxxx"

# USE_GENERATED_DNSMASQ: use generated version of /etc/dnsmasq.d/SoftAp0; set to no so user can modify /etc/dnsmasq.d/SoftAp0
USE_GENERATED_DNSMASQ=yes

# USE_GENERATED_HOSTAPD: use generated version of /etc/hostapd.conf; set to no so user can modify /etc/hostapd.conf
USE_GENERATED_HOSTAPD=yes

# USE_APPENDED_SSID: appends mac address after SSID (aka -WXYZ, BeagleBone-WXYZ)
USE_APPENDED_SSID=yes

# USE_PERSONAL_COUNTRY: (default is US, but note enabled (#) with comment)
USE_PERSONAL_COUNTRY=NL

I just restarted both machines: they are now both at 4.19.94-ti-r71.

BTW: I also noticed that dnsmasq is not starting, because of confiruation erros in
/etc/dnsmasq SoftAp0.
I turned off the usb network interfaces, as I do not need them, and they confused the MDNS setup, and now /etc/dnsmasq.d/SoftAp0 shows itself as this:

interface=SoftAp0
interface=usb0
port=53
dhcp-authoritative
domain-needed
bogus-priv
expand-hosts
cache-size=2048
dhcp-range=SoftAp0,192.168.8.50,192.168.8.150,60m
dhcp-range=usb0,.1,.1,20m
listen-address=127.0.0.1
listen-address=192.168.8.1
listen-address=
dhcp-option-force=interface:SoftAp0,option:dns-server,192.168.8.1
dhcp-option-force=interface:SoftAp0,option:mtu,1500
dhcp-option=usb0,3
dhcp-option=usb0,6
dhcp-leasefile=/var/run/dnsmasq.leases

When I remove all the usb stuff and the empty listen-address= dnsmasq does start.

Duh, I had disabled generic-board-startup as I did not need usb networking and there were some discussions about a faster boot after disabling generic-board-startup. Apparently that also prevented bb-wl18xx-wlan0 from creating a proper interface. I still do not understand why my original machine did not have any problems with that setup, but at least hostapd is coming up.
After that I disabled the usb interfaces in
/etc/default/bb-boot
with

USB_NETWORK_DISABLED=yes
USB_IMAGE_FILE_DISABLED=yes
USB_CONFIGURATION=disable

Now dnsmasq is also coming up properly, although there are still settings in the automatically created configuration for usb0 and usb1 in /etc/dnsmaq.d/SoftAp0

Regards,
Johan Henselmans