This works great after I log in. I have my network info in wpa_supplicant.conf.
If I put those same commands in /etc/init.d/startlegato.sh between these two lines:
mount -o bind $LEGATO_MNT /legato
test -x $LEGATO_START && $LEGATO_START
The WiFi doesn’t seem to work, and I get these log statements:
Linux swi-mdm9x28-wp 3.18.140 #1 PREEMPT Tue Oct 8 00:58:07 UTC 2019 armv7l GNU/Linux
Cypress chip MMC recognition may have been overwritten
wlan0 interface was not created by Cypress drivers
Successfully initialized wpa_supplicant
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
wlan0: Failed to initialize driver interface
as if you are on a DV4 board as I am you should fail in trying to set wl_reg_on to the Cypress wifi
chip as the sysfs entries are created by the expander driver in the mangOH modules:
which has definitely not been insmod/modprob’ed by Legato as you are trying to load the
Cypress modules even before Legato has started fully (it is startlegato.sh that you are modifying).
I guess you could create a S99/S98 initscript that could make sure that the expander driver has created the proper gpio entry and then start the wifi as you want outside of Legato.
I am curious what you are trying to do and why you decided to not let Legato start wifi.
We currently have the wifiService in a stop state by default, you could change the config settings to set it to start by default and it will probably be
start by default as the data channel service (DCS) will start it automatically: https://docs.legato.io/latest/legatoServicesDCS.html
To use DCS to auto-start things, please remove the “{ start: manual }” from:
Let me know if you have any further questions/problems.
Nick,
Actually, the cypwifi README.md actually needs updating as it was based on Legato versions earlier
than 19.04 which had the Tiwifi IoT card as the default way to start wifi on wlan0 and thus Cypress
had to use wlan1. Since, 19.04 Legato allows other Wifi chips besides TI Wifi (Note, they all must be
based on wlan0 - you cannot have multiple wifi interfaces - you would need to apply the Legato
patches if you wanted that). Cypwifi is changing soon as the Linux kernel backports for cypwifi
will be integrated with Bluez 5.52 backport kernel changes, so I think we will wait for that
complete before updating the README.
The wifi passphrases/creds are stored in secure storage in Legato releases after Legato 19.04.
Thus, if you set the SSID/protocol/passphrase… on your target it should persist.