Wifi exp board on legato21 (R15)

after investigating a little more it seems that the problem is with the missing hostapd:
/bin/hostapd: not found

this is what stops the wlan0 from being created and the errors with the i2c interface were only happening on attempting the cleanup

if you use the wifi card as client mode by “wifi client start” instead of using it as access point, can it work?

yes it does, I can use the wifi app to setup a client and to start it.
It does brings up the wlan0 interface.

you need to go to “meta-columbia-x/meta-columbia-x-public/recipes/images/mdm9x28-image-minimal.bbappend” and remove the following line and rebuild the yocto image
IMAGE_INSTALL_remove = "hostapd"

OR you can directly use the image of “swi-fx30-catm_4.0.0.beta” which uses
SDK for FX30-CATM (Release R15.0.2.001.BP2 + Legato 21.05.0)

beautiful, will give it a go thank you for the help!

Just have a try on “9999999_9907618_SWI9X06Y_02.36.08.02_00_GENERIC_001.077_000-full.spk” from the Leaf package “swi-fx30-catm_4.0.0.beta”, I can see “hostapd”

root@fx30:~# ls /bin/host*
/bin/hostapd /bin/hostapd_cli /bin/hostname


ati3
Manufacturer: Sierra Wireless, Incorporated
Model: WP7702
Revision: SWI9X06Y_02.36.08.02 c3f5ef jenkins 2021/09/07 08:00:51
IMEI: 352653090012345
IMEI SV:  6
FSN: VU735370312345
+GCAP: +CGSM

OK
ati8
Legato Ver: 21.05.0.0d38bc34_40288ac0b0ffed9ebe2ffce8ae730a91
Yocto Ver:  SWI9X06Y_03.00.03.00 2021-11-26_12:02:26
OS Ver: Linux version 4.14.253 (oe-user@oe-host) ( gcc version 9.3.0 (GCC), GNU ld (GNU Binutils) 2.34.0.20200220) #1 PREEMPT Fri Nov 26 09:52:28 UTC 2021
LK Ver: 1.3.0_1aea4d8ec8
RootFS Ver: SWI9X06Y_03.00.03.00 2021-11-26_12:02:26
UserFS Ver: unknown
MCU Ver: 002.015

OK

the problem is that we would rather try to solve the problem with the most recent release instead of chasing our tale on a previous one which we are not going to use.
The problem indeed seems related with the missing hostapd from the bin directory, and as you noted caused by this being removed when building the yocto project for the target.

@jyijyi the AP interface is up and running but we are now facing an issue with the bridging as we would like to use the device as a bridge between eth0 and wlan0 interfaces.
I see this has already been done and it works with the previous release R14 (LE19), but with the new release R15 (LE21) it seems that the bridging fails and I am not sure what is the reason for this.

wifiService[1438] | Configuration file: /tmp/hostapd.conf
wifiService[1438] | rfkill: Cannot open RFKILL control device
wifiService[1438] | nl80211: Failed to add interface wlan0 into bridge br0: Operation not supported

Now, for some reason the wifiService on the previous release R14 didn`t run this command, I thought it could be related to the new recipe version of hostapd or wpa_supplicant, so I have used the 2.6 version (R14) while this is the 2.9 version on the R15 release.
hostapd v2.6
wpa_supplicant v2.6

Still the problem persists and we can`t figure out what is the problem, any idea?
your help is much appreciated.

did you rebuild the yocto image to include the hostapd in R15?

yes the hostapd now is fine, we can bring up the wlan0 interface but we are having a problem with the bridging to eth0.

just to fill in with the whole logs, this is where it fails:
Nov 24 14:35:13 fx30 user.info Legato: INFO | wifiService[1439] | WIFIAP_HOSTAPD_START
Nov 24 14:35:13 fx30 user.info Legato: INFO | wifiService[1439] | Configuration file: /tmp/hostapd.conf
Nov 24 14:35:13 fx30 user.info Legato: INFO | wifiService[1439] | rfkill: Cannot open RFKILL control device
Nov 24 14:35:14 fx30 user.info Legato: INFO | wifiService[1439] | nl80211: Failed to add interface wlan0 into bridge br0: Operation not supported
Nov 24 14:35:14 fx30 user.info Legato: INFO | wifiService[1439] | nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Nov 24 14:35:14 fx30 user.info Legato: INFO | wifiService[1439] | nl80211 driver initialization failed.
Nov 24 14:35:14 fx30 user.info Legato: INFO | wifiService[1439] | wlan0: interface state UNINITIALIZED->DISABLED
Nov 24 14:35:14 fx30 user.info Legato: INFO | wifiService[1439] | wlan0: AP-DISABLED

in the start-up script is just passing the hostapd.conf to the hostapd, which is the same command for the old legato version as well.

WIFIAP_HOSTAPD_START)
echo “WIFIAP_HOSTAPD_START”
(/bin/hostapd /tmp/hostapd.conf -i${IFACE} - B) && exit 0

if we remove the first line from the hostapd.conf, the configuration works fine.

This is what the hostapd.conf looks like:
driver=nl80211
wmm_enabled=1
beacon_int=100
dtim_period=2
rts_threshold=2347
fragm_threshold=2346
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=AP_VU050687491510
channel=6
max_num_sta=10
country_code=US
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wpa_passphrase=xxxxxx
hw_mode=g

while if we add the first line to be:
bridge=br0
driver=nl80211
wmm_enabled=1
beacon_int=100
dtim_period=2
rts_threshold=2347
fragm_threshold=2346
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=AP_VU050687491510
channel=6
max_num_sta=10
country_code=US
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wpa_passphrase=xxxxxx
hw_mode=g

it will fail.

if we deploy the old version R14, it will work all right, so we basically rebuild the same apps with the older R14 release, the configuration file is:
bridge=br0
driver=nl80211
wmm_enabled=1
beacon_int=100
dtim_period=2
rts_threshold=2347
fragm_threshold=2346
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=AP_VU050687491510
channel=6
max_num_sta=10
country_code=US
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wpa_passphrase=xxxxxxx
hw_mode=g

and it brings up the interface without any problem.
we were wondering if you have seen this problem before and if you know if this is related to the drivers or hostapd version (which we have already tried to downgrade) and the wpa_supplicant (same)

we believe this is related to the drivers for the wl18xx but not sure where to look to be honest…

no idea, i have never gone so deep in the WIFI.
BTW, I guess you want to share WIFI data to ethernet, will you consider NAT?

well, yes if we can get what we need… :slight_smile:
how do you setup the NAT instead?
I think we did give it a try but didn`t go past that…

Here is a script for sharing cellular data (rmnet_data0) to ethernet interface (eth0) by NAT in FX30.
cfg_gateway_eth0_auto.sh (7.1 KB)

You might change it to share the wifi data (wlan0) to ethernet interface (eth0).

Other user says it should be working fine:

I have tried with this but can`t get it to work, the eth0 and wlan0 are already up and running so my setup is a lot easier.
wlan0 has a DHCP already enabled and is correctly assigning the IP to the client, eth0 is set to static, the client is connecting with a static IP.
These are the
eth0 Link encap:Ethernet HWaddr 00:14:3E:9D:BA:57
inet addr:192.168.13.31 Bcast:192.168.13.255 Mask:255.255.255.0
inet6 addr: fe80::214:3eff:fe9d:ba57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1600 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74056 (72.3 KiB) TX bytes:3936 (3.8 KiB)

wlan0 Link encap:Ethernet HWaddr 64:69:4E:77:D5:2E
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6669:4eff:fe77:d52e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:618 errors:0 dropped:0 overruns:0 frame:0
TX packets:656 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:72055 (70.3 KiB) TX bytes:87715 (85.6 KiB)

The client connected through wlan0 has IP 192.168.1.11 (dhcp) while the client connected on eth0 has 192.168.13.10 (static). I would like the two to communicate with each other, this below is the setup for the iptables:

iptables --flush
iptables -I INPUT -j ACCEPT
iptables --table nat --flush
iptables --table nat --delete-chain
sysctl -w net.ipv4.ip_forward=1
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -m state --state NEW -j ACCEPT
iptables -A INPUT -m udp -p udp --sport 67:68 --dport 67:68 -j ACCEPT

After this from the shell of the fx30 I can still ping both clients but the client on the eth0 can`t ping the client on the wlan0 and viceversa.

For the FX30 connected WIFI connection through wlan0 with IP 192.168.1.11, can the FX30 browse internet?
For the client connected on eth0 has 192.168.13.10 (static), can it browse internet?

The wlan0 is setup as an AP not as a client.

so your cellular data is shared to wifi as AP, then you should also share cellular data to ethernet client eth0 instead of sharing the wifi AP data wlan0 to eth0.

nope, the cellular data is independent from the wlan0 and eth0, which should be bridged together. The two clients (eth0 and wlan0) are communicating with each other and with an app which then send data over the cellular network.