cyw43438 concurrent station and AP mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KrRa_4499631
Level 1
Level 1

Hi,

I'm trying to setup a cyw43438 chip to run in station and AP mode simultaneously using wpa_supplicant and hostapd.

I can successfully start an AP (ssid: MyAP) on channel 11 and ping clients which are connected to it.

While the AP is running I setup station mode and try to connect to a network (ssid: dpkra) which is using channel 1.

When doing this the client(s) connected to MyAP will drop the connection and the chip fails to connect to the dpkra network. I can make it connect to dpkra by closing MyAP or changing it to use the same channel as dpkra.

According to iw list the chip only supports using one channel so the issue is probably that both wpa_supplicant and hostapd are trying to control which channel to use.

# iw list

...

valid interface combinations:

* #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,

   total <= 3, #channels <= 2

* #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,

   total <= 4, #channels <= 1

...

In controlled environments I can of course set the channels to the same value, but how is this supposed to be handled in real life scenarios where I don't have control over the "dpkra" network.

I would expect the driver to move MyAP to channel 1 when trying to connect to dpkra. This is the behaviour I have seen on another WiFi chip.
Or do I have to restart hostapd each time and make sure it is using the same channel as the network I want to connect to? this could become a bit messy if roaming between different APs.

Configuration
--------------------

Add AP interface

# iw dev wlan0 interface add uap0 type __ap addr $MAC

# hostapd /etc/hostapd.conf &

# cat /etc/hostapd.conf

interface=uap0

ieee80211n=1

ctrl_interface=/var/run/hostapd

ssid=MyAP

hw_mode=g

ht_capab=[SHORT-GI-20][MAX-AMSDU-3839][DSSS_CCK-40]

channel=11

rts_threshold=2346

fragm_threshold=2346

beacon_int=100

wmm_enabled=1

country_code=US

auth_algs=1

wpa_key_mgmt=WPA-PSK

wpa=2

wpa_psk=****

wpa_pairwise=CCMP

# wpa_supplicant -i wlan0 -B -D nl80211 -c /etc/wpa_supplicant.conf

# cat /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

update_config=1

network={

        ssid="dpkra"

        scan_ssid=1

        psk=****

}

Versions

-------------

hostapd v2.7

wpa_supplicant v2.7

brcmfmac driver: backported from Linux version v4.14.77-2019_0503-0-g1dfe0a6 (https://community.cypress.com/docs/DOC-17441)

Firmware: brcmfmac43430-sdio.bin version 7.45.98.83

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

The CSA for channel change is sent by the AP before moving to another channel.

PFA the Sniffer logs.

View solution in original post

0 Likes
10 Replies
VinayakS_26
Moderator
Moderator
Moderator
100 replies posted 50 replies posted 25 replies posted

The AP and STA needs will be brought up in the same channel. The AP will follow the STA if the sta channel where to be changed. This leads to a drop in connection with client connected to AP unless AP does a CSA(channel switch anouncement) to the clients.

I'm glad to hear that the AP is supposed to follow the STA.

I however still have troubles getting it to work. Do I need a special config or do you have any pointers how to debug this further?

The sequence I tried was:

  1. Start MyAP on channel 6
  2. Connect PC to MyAP
  3. Start ping to verify connection between MyAP and PC works
  4. Try to connect to dpkra (channel 1) using wpa_cli, see the output below. After this point I stopped getting ping responses.
    If I make the PC disconnect and connect from MyAP I get a few ping responses through and then it stops again possible each time wpa_supplicant tries to connect to dpkra.
    Each time ping stalls I can only get the connection working again by disconnecting and connecting manually. Then it will work for a few seconds and stall again.
    wpa_cli keeps failing to connect. Using a wifi scanner on my smartphone I could still see the MyAP access point on channel 6.
  5. Close MyAP by stopping hostapd. Shortly after doing this wpa_supplicant was able to connect to dpkra.


Output from wpa_cli:
# wpa_cli

wpa_cli v2.7

Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Selected interface 'wlan0'

Interactive mode

> enable network 0

OK

> reassociate

OK

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=64:66:b3:d0:5a:b0 status_code=16

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=64:66:b3:d0:5a:b0 status_code=16

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16

<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="dpkra" auth_failures=1 duration=10 reason=CONN_FAILED

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="dpkra"

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=64:66:b3:d0:5a:b0 status_code=16

<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="dpkra" auth_failures=2 duration=23 reason=CONN_FAILED

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="dpkra"

<3>Trying to associate with SSID 'dpkra'

<3>CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16

<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="dpkra" auth_failures=3 duration=46 reason=CONN_FAILED

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS                                   <----- At this point I stopped hostapd ----->

wpa_state=SCANNING

address=00:15:bc:24:44:a0

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="dpkra"

<3>Trying to associate with SSID 'dpkra'

<3>Associated with 64:66:b3:d0:5a:b0

<3>CTRL-EVENT-CONNECTED - Connection to 64:66:b3:d0:5a:b0 completed [id=0 id_str=]

<3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0

0 Likes

Could you create the STA first in the primary interface and then the AP.

Could you list the steps that you followed to create the AP.?

Br

VinayakS_26

The outcome is the same when I start STA first. After starting hostapd STA drops the connection and is unable to reconnect.

hostapd seems to force which channel to use. The AP shows up on channel 11.

The PC can connect to the AP and gets an ip but I cannot ping between PC and AP.

This is the commands I run to start the AP:

# iw dev wlan0 interface add uap0 type __ap

# ifconfig uap0 192.168.2.10 netmask 255.255.255.0 up

# /usr/sbin/hostapd -B /etc/hostapd.conf

# /usr/sbin/udhcpd /etc/dhcpd.conf

# cat /etc/dhcpd.conf

interface uap0

start 192.168.2.11

end 192.168.2.254

opt dns 192.168.2.10

opt router 192.168.2.10

opt subnet 255.255.255.0

opt domain local

opt lease 86400

0 Likes

VinayakS_26

Any updates on this? I still haven't managed to get it to work

0 Likes

I have a similar problem, when trying to create an AP and STA in a Linux (Orange Pi Zero 2+). I am able to create either AP or STA, but not them both at the same time. Second, then I am trying to use both, I am getting lots of kernel errors related to brcmfmac43430-sdio driver.

  • Kernel version: 5.3.7 mainline
  • Firmware version: 7.45.98.83 (r714225 CY) FWID 01-e539531f

Log output:

6.903175 brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1

6.947328 brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.xunlong,orangepi-zero-plus2.txt failed with error -2

7.093658 brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1

7.113026 brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: May  2 2019 02:39:18 version 7.45.98.83 (r714225 CY) FWID 01-e539531f

64.614010 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

261.514924 ieee80211 phy0: brcmf_vif_set_mgmt_ie: vndr ie set error : -52

261.519892 ieee80211 phy0: brcmf_vif_set_mgmt_ie: vndr ie set error : -52

262.053332 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

262.055162 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

262.055397 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

262.693121 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

262.797716 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

262.902280 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

263.006801 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

263.111347 ieee80211 phy0: brcmf_cfg80211_change_iface: iface validation failed: err=-16

1229.012082 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1229.013632 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1229.805502 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1229.806492 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1230.999579 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1231.003268 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1232.694427 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1232.697127 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1242.397746 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1242.398855 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1295.681717 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1295.682709 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

1306.374665 ieee80211 phy0: brcmf_c_set_joinpref_default: Set join_pref error (-52)

1306.375848 ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

Best regards

Jørn Gustav Larsen

AnyCon ApS

Could you provide the kernel crash log. Also please create a seperate thread for this issue.

Could you try with kernel 4.14 and see if this issue is persisting?

0 Likes

Hi,

Did you make any changes to the nvram?

Could you post the nvram that you are using here.

0 Likes

This is the NVRAM I use. We are currently in the process of obtaining the correct parameters for PA-calibration.

# cat /lib/firmware/brcm/brcmfmac43430-sdio.txt

# NVRAM file for CYW43438KUBG

# 2.4 GHz, 20 MHz BW mode

# The following parameter values are just placeholders, need to be updated.

manfid=0x2d0

prodid=0x0727

vendid=0x14e4

devid=0x43e2

boardtype=0x0727

boardrev=0x1101

boardnum=22

macaddr=00:15:BC:24:44:A0

sromrev=11

boardflags=0x00404201

boardflags3=0x08000000

xtalfreq=37400

nocrc=1

ag0=255

aa2g=1

ccode=US

pa0itssit=0x20

extpagain2g=0

#PA parameters for 2.4GHz, measured at CHIP OUTPUT

pa2ga0=-168,7161,-820

AvVmid_c0=0x0,0xc8

cckpwroffset0=5

# PPR params

maxp2ga0=84

txpwrbckof=6

cckbw202gpo=0

legofdmbw202gpo=0x66111111

mcsbw202gpo=0x77711111

propbw202gpo=0xdd

# OFDM IIR :

ofdmdigfilttype=18

ofdmdigfilttypebe=18

# PAPD mode:

papdmode=1

#papdvalidtest=3

il0macaddr=00:15:BC:24:44:A0

wl0id=0x431b

deadman_to=0xffffffff

# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG

muxenab=0x1

# CLDO PWM voltage settings - 0x4 - 1.1 volt

#cldo_pwm=0x4

0 Likes
lock attach
Attachments are accessible only for community members.

The CSA for channel change is sent by the AP before moving to another channel.

PFA the Sniffer logs.

0 Likes