How to add WiFi profiles/access points by default

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

cross mob
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi Infineon Team,

We are working on iMX8MMini on Android 11 OS. We are using CYW43455 chip for WiFi and using latest drivers for it.

We have a requirement to add certain WiFi profiles and Access points to be enabled by default in the system.

Could you please guide us on how to do that?

Thanks,
Hrithik

0 Likes
1 Solution
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

seems the connection process must be  executed from High layer:

com.android.server.wifi.ClientModeImpl.broadcastWifiCredentialChanged:5804 com.android.server.wifi.ClientModeImpl.lambda$connect$0:6172 com.android.server.wifi.ClientModeImpl.lambda$connect$0$ClientModeImpl:0
WifiConfigManager: Enable disabled network: "New_AP_Nw" num=0
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiConfigStore: Writing to stores completed in 33 ms.
WifiClientModeImpl: connectToUserSelectNetwork netId 3, uid 0, forceReconnect = true
WifiClientModeImpl: CMD_START_CONNECT my state DisconnectedState nid=3 roam=false
WifiClientModeImpl: No changes in MAC address

 

I think you can compare the /vendor/etc/wifi/wpa_supplicant.conf after pulling out, to see if there exists the network info like:

network={
ssid="My_Network"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
psk=380e4f9997a589919a7dfd3fb8d71846aa663cc42aeecbaa03d33b9f287b6914
priority=2
}

after pushing back, restart the system. then pulling out the file again, make sure the network info is still there, sometimes the conf file will be modified to the default one.

View solution in original post

0 Likes
21 Replies
lock attach
Attachments are accessible only for community members.
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

  check the attached conf file, I think you can add the AP info with the below type.

# Only WPA-PSK is used. Any valid cipher combination is accepted.
network={
ssid="example"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
priority=2
}

0 Likes
lock attach
Attachments are accessible only for community members.
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

Thanks for the response.
I tried your input with PSK generated from wpa_passphrase and also with psk="password" but it doesnt get connected.

Kindly review my attached wpa_supplicant.conf and wpa_supplicant _overlay.conf

Thanks,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Hello:

  have this config for a try,  and if possible, please upload the supplicant log to check the failure position.

network={
ssid="My_Network"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
psk=380e4f9997a589919a7dfd3fb8d71846aa663cc42aeecbaa03d33b9f287b6914
priority=2
}

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

Hi @Zhengbao_Zhang ,

Thanks for the response.

I tried this as well, but still it doesnt get connected. Please find the attached logcat which contains complete bootup logs.

You can grep "wifi" or other relevant keywords.

Kindly help me to resolve this issue.

Thanks,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Hello:

    You can have a try with blow commands, if wpa_cli is included in the system, then input:

 wpa_cli

 after entering the console, input

 scan

wait for 10s, then input scan_results

scan_result

and check the results to see if it includes the AP ssid .

In the first place please make sure the wifi driver has been brought up correctly.

0 Likes
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

I followed the commands you mentioned and could find the AP:

bssid                              / frequency /  signal level                   / flags /                                     ssid

76:08:05:ba:80:c1           5180               -48                 [WPA2-PSK-CCMP][ESS]              My_Network

Kindly let me know what else should i do

Thanks,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

  use below commands to create a connection, and watch the logs to see the results:

you need to modify the psk to your settings.

wpa_cli -i wlan0 remove_net all

wpa_cli -i wlan0 add_network

wpa_cli -i wlan0 set_network 0 ssid \"My_Network\"

wpa_cli -i wlan0 set_network 0 key_mgmt WPA-PSK

wpa_cli -i wlan0 set_network 0 psk \"12345678\"

wpa_cli -i wlan0 set_network 0 pairwise CCMP

wpa_cli -i wlan0 set_network 0 proto RSN

wpa_cli -i wlan0 select_network 0

wpa_cli -i wlan0 enable_network 0

0 Likes
lock attach
Attachments are accessible only for community members.
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

I tried all the commands one by one as you suggested. All the commands gave me OK as response in shell.

In the logs, after the final 2 commands, I got the below logs:

EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
wpa_supplicant: wlan0: Trying to associate with SSID 'My_Network'

EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: Associated with 76:08:05:ba:80:c1
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from 76:08:05:ba:80:c1 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4
wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
WifiService: updateInterfaceIpState uid=1073
WifiService: updateInterfaceIpState: ifaceName=wlan0 mode=-1 previous LOHS mode= -1
wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from 76:08:05:ba:80:c1 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
wpa_supplicant: wlan0: WPA: Key negotiation completed with 76:08:05:ba:80:c1 [PTK=CCMP GTK=CCMP]
wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to 76:08:05:ba:80:c1 completed [id=0 id_str=]
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
WifiClientModeImpl: Connected to unknown networkId -1, disconnecting...
wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=76:08:05:ba:80:c1 reason=3 locally_generated=1
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wificond: Regulatory domain changed
wificond: 2.4Ghz frequencies: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462
wificond: 5Ghz non-DFS frequencies: 5180 5200 5220 5240 5560 5720 5745 5765 5785 5805 5825
wificond: 5Ghz DFS frequencies:
wificond: 6Ghz frequencies:
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true

But even after that, it didnt get connected! Please find the complete log as attached.

The only method of connection which works is through the following command in adb shell:
cmd -w wifi connect-network “SSID” wpa2 “password”

Regards,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

 The reason is here:

WifiClientModeImpl: Connected to unknown networkId -1, disconnecting...

seems to return an error from the network manager in the Android system.

Can you help to close the wifi manager by using the below commands?

 svc wifi disable 

and bring up wpa_supplicant manually.

then using the same command mentioned in the last reply.

then check the logs if we can see a disconnection event.

0 Likes

Hi @Zhengbao_Zhang ,

I did not quite understand the step - "bringup wpa_supplicant manual". Could you please elaborate on what to do?

Thanks,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Here is an example, you can change the position of the conf file.

/vendor/bin/hw/wpa_supplicant -Dnl80211 -iwlan0 -c/data/vendor/wifi/wpa/wpa_supplicant.conf -O/data/vendor/wifi/wpa/sockets -B

0 Likes
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

As you guided i tried the below commands in order:

  1. svc wifi disable
  2. /vendor/bin/hw/wpa_supplicant -Dnl80211 -iwlan0 -c/data/vendor/wifi/wpa/wpa_supplicant.conf -O/data/vendor/wifi/wpa/sockets -B
  3. All wpa_cli commands

I got the below logs:

HidlServiceManagement: Registered android.hardware.wifi.supplicant@1.3::ISupplicant/default
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
wificond: No handler for scan result notification from interface with index: 6
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
wpa_supplicant: wlan0: Failed to initiate sched scan
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
wpa_supplicant: wlan0: Trying to associate with SSID 'New_AP_Nw'
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: Associated with de:a6:cb:22:ce:64
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from de:a6:cb:22:ce:64 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4
wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
WifiService: updateInterfaceIpState uid=1073
WifiService: updateInterfaceIpState: ifaceName=wlan0 mode=-1 previous LOHS mode= -1
wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from de:a6:cb:22:ce:64 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
wpa_supplicant: wlan0: WPA: Key negotiation completed with de:a6:cb:22:ce:64 [PTK=CCMP GTK=CCMP]
wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to de:a6:cb:22:ce:64 completed [id=0 id_str=]
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
chatty : uid=1010(wifi) /system/bin/wificond identical 2 lines
wificond: No handler for scan result notification from interface with index: 6
WifiService: setWifiEnabled package=com.android.settings uid=1000 enable=true
WifiActiveModeWarden: Starting ClientModeManager
WifiController: DisabledState.exit()
WifiController: EnabledState.enter()
WifiClientModeManager: entering IdleState
android_os_HwBinder: HwBinder: Starting thread pool for getting: android.hardware.wifi@1.0::IWifi/default
android.hardware.wifi@1.0-service: Wifi HAL started
WifiVendorHal: Vendor Hal started successfully
WifiP2pNative: Registering for interface available listener
WifiHAL : wifi_pre_initialize
WifiHAL : --- HAL version: Android-10-FRC2-SDK_29 59.0 (r854927) 2019-12-06 23:33:52 +0530 (Fri, 06 Dec 2019) ---
WifiHAL : Creating socket
WifiHAL : Initialized Wifi HAL Successfully; vendor cmd = 103
WifiHAL : found interface wlan0
WifiHAL : Calling preInit
WifiHAL : Hal preInit
WifiHAL : Failed to register set Hal preInit; result = -95
WifiHAL : wifi_hal_preInit failed
android.hardware.wifi@1.0-service: Adding interface handle for wlan0
02-06 13:47:32.084 351 351 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
02-06 13:47:32.084 351 351 E android.hardware.wifi@1.0-service: Failed to register radio mode change callback
02-06 13:47:32.084 351 351 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
02-06 13:47:32.084 351 351 E WifiHAL : Failed to register debug response; result = -95
02-06 13:47:32.084 351 351 E android.hardware.wifi@1.0-service: Failed to get driver version: UNKNOWN ERROR
02-06 13:47:32.084 351 351 I android.hardware.wifi@1.0-service: Configured chip in mode 3
02-06 13:47:32.084 351 351 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
02-06 13:47:32.090 351 351 I android.hardware.wifi@1.0-service: Adding interface handle for wlan0

It still didnt get connected to the AP.

Also, what does "/vendor/bin/hw/wpa_supplicant -Dnl80211 -iwlan0 -c/data/vendor/wifi/wpa/wpa_supplicant.conf -O/data/vendor/wifi/wpa/sockets -B" command do?

Thanks,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

seems connected already:

wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from de:a6:cb:22:ce:64 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
wpa_supplicant: wlan0: WPA: Key negotiation completed with de:a6:cb:22:ce:64 [PTK=CCMP GTK=CCMP]
wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to de:a6:cb:22:ce:64 completed

 

wpa_supplicant is a tool for wifi usage,  it can be run automatically when OS is up, if you close the wifi function from UI, the process will be killed. so you need to bring it up manually. 

0 Likes
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

Looking at those particular logs, even I thought so.. but it wasnt connected.

I am not sure why it is not getting connected.

Using the command - cmd -w wifi connect-network “SSID” wpa2 “password”, it is properly getting connected.

 

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

   would you please help to capture the successful logs from "cmd -w wifi connect-network “SSID” wpa2 “password"? we can have a compare to see the difference.

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

and you can check the wpa_supplicant.conf in the system to see if the AP info has been added to the conf.

0 Likes
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

Logs of command:

WifiConfigManager: Cannot find network with networkId -1 or configKey "New_AP_Nw"WPA_PSK
WifiConfigManager: Cannot find network with configKey "New_AP_Nw"WPA_PSK
WifiConfigManager: Enable disabled network: "New_AP_Nw" num=0
WifiConfigStore: Writing to stores completed in 63 ms.
ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcastMultiplePermissions:1143 android.content.Context.sendBroadcastWithMultiplePermissions:2150 com.android.server.wifi.ClientModeImpl.broadcastWifiCredentialChanged:5804 com.android.server.wifi.ClientModeImpl.lambda$connect$0:6172 com.android.server.wifi.ClientModeImpl.lambda$connect$0$ClientModeImpl:0
WifiConfigManager: Enable disabled network: "New_AP_Nw" num=0
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiConfigStore: Writing to stores completed in 33 ms.
WifiClientModeImpl: connectToUserSelectNetwork netId 3, uid 0, forceReconnect = true
WifiClientModeImpl: CMD_START_CONNECT my state DisconnectedState nid=3 roam=false
WifiClientModeImpl: No changes in MAC address
WifiClientModeImpl: Connecting with 02:ac:72:bc:79:b7 as the mac address
wificond: Scan is not started. Ignore abort request
wpa_supplicant: wlan0: Trying to associate with SSID 'New_AP_Nw'
WifiService: allowAutojoin=true uid=0
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: Associated with de:a6:cb:22:ce:64
wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from de:a6:cb:22:ce:64 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4
wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from de:a6:cb:22:ce:64 (ver=2)
wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
wpa_supplicant: wlan0: WPA: Key negotiation completed with de:a6:cb:22:ce:64 [PTK=CCMP GTK=CCMP]
wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to de:a6:cb:22:ce:64 completed [id=0 id_str=%7B%22configKey%22%3A%22%5C%22New_AP_Nw%5C%22WPA_PSK%22%2C%22creatorUid%22%3A%220%22%7D]
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
ConnectivityService: registerNetworkAgent NetworkAgentInfo{ ni{[type: WIFI[], state: UNKNOWN/IDLE, reason: (unspecified), extra: , failover: false, available: true, roaming: false]} network{101} nethandle{437197393933} lp{{InterfaceName: wlan0 LinkAddresses: [ ] DnsAddresses: [ ] Domains: null MTU: 0 Routes: [ ]}} nc{[ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps OwnerUid: 0 SSID: "New_AP_Nw" RequestorUid: -1 RequestorPackageName: null]} Score{20} everValidated{false} lastValidated{false} created{false} lingering{false} explicitlySelected{true} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} partialConnectivity{false} acceptPartialConnectivity{false} clat{mBaseIface: null, mIface: null, mState: IDLE} }
WifiHAL : Getting APF capabilities, halHandle = 0xb400ef7289fac400
WifiHAL : createRequest: APF get capabilities request
WifiHAL : Request Response failed for APF, result = -95
WifiVendorHal: getApfCapabilities(l.1413) failed {.code = ERROR_UNKNOWN, .description = unknown error}
ConnectivityService: [101 WIFI] EVENT_NETWORK_INFO_CHANGED, going from UNKNOWN to UNKNOWN
wpa_supplicant: wlan0: CTRL-EVENT-DRIVER-STATE HANGED
WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.973) failed {.code = ERROR_UNKNOWN, .description = unknown error}
WifiScoreReport: Cannot start external scoring netId=101 currentNetId=101 sessionId=1017
WifiMemoryStoreImpl: Set cluster G9867c49338114f68 for Wc0544eb331eada65: SUCCESS
WifiNl80211Manager: Scan result ready event
WifiNative: Scan result ready event
EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
WificondScannerImpl: Filtering out 25 scan results.
WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.973) failed {.code = ERROR_UNKNOWN, .description = unknown error}
WifiMemoryStoreImpl: Set cluster G9867c49338114f68 for W9867c49338114f68: SUCCESS
PreferenceGroup: Found duplicated key: "StandardWifiEntry:New_AP_Nw,2". This can cause unintended behaviour, please use unique keys for every preference.
ConnectivityService: [101 WIFI] EVENT_NETWORK_INFO_CHANGED, going from UNKNOWN to CONNECTED
ConnectivityService: Adding iface wlan0 to network 101
WifiClientModeImpl: Received signal strength thresholds: []
WifiVendorHal: stopRssiMonitoring(l.2100) failed {.code = ERROR_NOT_AVAILABLE, .description = }
IptablesRestoreController: -A idletimer_raw_PREROUTING -i wlan0 -j IDLETIMER --timeout 15 --label 1 --send_nl_msg 1
IptablesRestoreController: -A idletimer_mangle_POSTROUTING -o wlan0 -j IDLETIMER --timeout 15 --label 1 --send_nl_msg 1
ConnectivityService: Switching to new default network: NetworkAgentInfo{ ni{[type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: , failover: false, available: true, roaming: false]} network{101} nethandle{437197393933} lp{{InterfaceName: wlan0 LinkAddresses: [ fe80::ac:72ff:febc:79b7/64,192.168.51.12/24 ] DnsAddresses: [ /192.168.51.215 ] Domains: null MTU: 0 ServerAddress: /192.168.51.215 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576 Routes: [ fe80::/64 -> :: wlan0 mtu 0,192.168.51.0/24 -> 0.0.0.0 wlan0 mtu 0,0.0.0.0/0 -> 192.168.51.215 wlan0 mtu 0 ]}} nc{[ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -55 OwnerUid: 0 SSID: "New_AP_Nw" RequestorUid: -1 RequestorPackageName: null]} Score{20} everValidated{false} lastValidated{false} created{true} lingering{false} explicitlySelected{true} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} partialConnectivity{false} acceptPartialConnectivity{false} clat{mBaseIface: null, mIface: null, mState: IDLE} }
View : requestLayout() improperly called by com.android.keyguard.AlphaOptimizedLinearLayout{11b3a94 V.E...... ......ID 3,0-18,22 #7f0a04f2 app:id/wifi_group} during layout: running second layout pass
ConnectivityService: Sending CONNECTED broadcast for type 1 [101 WIFI] isDefaultNetwork=true
Netd : Error adding route ::/0 -> fe80::dca6:cbff:fe22:ce64 wlan0 to table 1006: File exists
ConnectivityService: [101 WIFI] validation passed
GnssNetworkConnectivityHandler: updateNetworkState, state=CLOSED, connected=true, network=101, capabilities=[ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -55 AdministratorUids: [] SSID: "New_AP_Nw" RequestorUid: -1 RequestorPackageName: null], apn: , availableNetworkCount: 1
WifiMemoryStoreImpl: Set cluster G9867c49338114f68 for Wc0544eb331eada65: SUCCESS

Regarding wpa_supplicant.conf, I am actually pulling the wpa_supplicant.conf from the system and pushing it back into the system after doing the relevant changes. And then rebooting the device for getting the effect.

The two files which I am changing is /data/vendor/wifi/wpa/wpa_supplicant.conf and /vendor/etc/wifi/wpa_supplicant.conf

Regards,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

seems the connection process must be  executed from High layer:

com.android.server.wifi.ClientModeImpl.broadcastWifiCredentialChanged:5804 com.android.server.wifi.ClientModeImpl.lambda$connect$0:6172 com.android.server.wifi.ClientModeImpl.lambda$connect$0$ClientModeImpl:0
WifiConfigManager: Enable disabled network: "New_AP_Nw" num=0
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false
WifiConfigStore: Writing to stores completed in 33 ms.
WifiClientModeImpl: connectToUserSelectNetwork netId 3, uid 0, forceReconnect = true
WifiClientModeImpl: CMD_START_CONNECT my state DisconnectedState nid=3 roam=false
WifiClientModeImpl: No changes in MAC address

 

I think you can compare the /vendor/etc/wifi/wpa_supplicant.conf after pulling out, to see if there exists the network info like:

network={
ssid="My_Network"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
psk=380e4f9997a589919a7dfd3fb8d71846aa663cc42aeecbaa03d33b9f287b6914
priority=2
}

after pushing back, restart the system. then pulling out the file again, make sure the network info is still there, sometimes the conf file will be modified to the default one.

0 Likes
Hrithik
Level 3
Level 3
25 sign-ins 25 replies posted First solution authored

Hi @Zhengbao_Zhang ,

I followed the steps you mentioned and the wpa_supplicant changes are present after the reboot.

"seems the connection process must be executed from High layer" --> You mean this connection profile must be added in Android framework?

Also, then how does cmd -w wifi connect-network command work? Im little confused here.
Actually all the forums in internet says that wpa_supplicant changes are good enough to add profile.

Regards,
Hrithik

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

"seems the connection process must be executed from High layer" --> You mean this connection profile must be added in Android framework?

The Android Framework will disconnect the connection as we saw in the logs, actually, the association from wpa_supplicant is successful already.

you can add a IP address on the interface wlan0, like:
 ifconfig wlan0 192.168.1.10 when the AP net address is  192.168.1.1.

do a Ping act to see if the association exists already.

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

 what is the status now ?

0 Likes