aboozaid / react-native-tethering

A React Native module for working with Wi-Fi and Hotspot. Compatible with Expo.
https://react-native-tethering.onrender.com/
MIT License
17 stars 2 forks source link

connectToLocalNetwork is never resolved on success #18

Closed matze10000 closed 11 months ago

matze10000 commented 1 year ago

With connectToLocalNetwork the Promise is never resolved in case of success (wifi is connected). The errors work.

aboozaid commented 1 year ago

Could you please provide more details such as:

matze10000 commented 1 year ago

Sorry for the late reply. The test device is a Pixel 3 XL with Android 11. Test app is a fresh current React-Native version 0.71.10 with "@react-native-tethering/wifi": "^1.0.0" and "react-native-wifi-reborn": "^4.8.3" to test against.

After successful connection, the following code is no longer called, (no Error logs, the Connection is successful) :

await TetheringManager.connectToLocalNetwork({ ssid: 'XXX', password: 'XXX', isHidden: false, }); ToastAndroid.show('WiFi Connected', ToastAndroid.SHORT); //never executed console.log('WiFi Connected'); //never executed

aboozaid commented 1 year ago

Can you test it on another phone which running Android 11 or above and let me know?

matze10000 commented 1 year ago

I could now test with a Pixel 6 / Android 13. There the problem does not occur, the following code is executed. The problem still exists with Pixel 3 XL with Android 11.

target wifi: WiFi-Repeater1

adb log:

06-20 15:29:09.562 1497 1891 D WifiConfigStore: Writing to stores completed in 7 ms. 06-20 15:29:09.563 1497 1837 D WifiMemoryStoreImpl: Remove cluster G345309e5bcbf0f04: SUCCESS deleted: 2 06-20 15:29:09.570 1497 1891 D SupplicantStaIfaceHal: Remove cached HAL data for config id 186 06-20 15:29:09.579 1497 1891 D WifiConfigStore: Writing to stores completed in 4 ms. 06-20 15:29:08.388 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:09.584 1497 1837 D ConnectivityService: requestNetwork for uid/pid:10353/24519 NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] 06-20 15:29:09.584 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:09.585 1497 1891 D UntrustedWifiNetworkFactory: got request NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] with score 0 and providerId 0 06-20 15:29:09.585 1497 1941 D Ethernet: got request NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] with score 0 and providerId 0 06-20 15:29:09.585 1497 1940 D WIFI_AWARE_FACTORY: got request NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] with score 0 and providerId 0 06-20 15:29:09.585 1497 1891 D WifiNetworkFactory: got request NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] with score 0 and providerId 0 06-20 15:29:09.587 1497 1891 V WifiNetworkFactory: Approved access point found in matching scan results. Triggering connect WiFi-Repeater1/00:23:13:05:8b:be 06-20 15:29:09.588 1497 1891 E WifiConfigManager: Cannot find network with configKey "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.588 1497 1891 E WifiNetworkFactory: Network not present in config manager 06-20 15:29:09.588 1497 1891 E WifiConfigManager: Cannot find network with configKey "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.588 1497 1891 E WifiConfigManager: Cannot find network with networkId -1 or configKey "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.588 1497 1891 E WifiConfigManager: Cannot find network with networkId -1 or configKey "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.604 1497 1891 E WifiConfigManager: Cannot find network with configKey "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.605 1497 1891 D WifiConfigManager: Enable disabled network: "WiFi-Repeater1" num=0 06-20 15:29:09.631 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:09.632 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:09.632 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=3c:37:12:e5:41:1d reason=3 locally_generated=1 06-20 15:29:09.633 1170 1170 E cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_use_userconfig 06-20 15:29:09.635 1497 1891 D WifiClientModeImpl: ClientModeImpl: Leaving Connected state 06-20 15:29:09.636 1497 1891 D WifiCountryCode: Reading country code from telephony 06-20 15:29:09.637 1497 1891 D WifiCountryCode: Set telephony country code to: 06-20 15:29:09.637 1497 1891 D WifiCountryCode: updateCountryCode to 00 06-20 15:29:09.637 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=00 06-20 15:29:09.638 1497 1891 D WifiCountryCode: Succeeded to set country code to: 00 06-20 15:29:09.638 1497 1891 D WifiClientModeImpl: Start Disconnecting Watchdog 338 06-20 15:29:09.639 1497 1891 D WifiConfigManager: Enable disabled network: "WiFi-Repeater1" num=0 06-20 15:29:09.639 1497 1891 E WifiPermissionsUtil: isDeviceOwner: packageName is null, returning false 06-20 15:29:09.645 1497 1891 D WifiConfigStore: Writing to stores completed in 3 ms. 06-20 15:29:09.646 1497 1891 E WifiVendorHal: stopRssiMonitoring(l.2100) failed {.code = ERROR_NOT_AVAILABLE, .description = } 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: stopIpClient IpClientWithPreConnection: false 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: java.lang.Throwable 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopIpClient(ClientModeImpl.java:1070) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopDhcpSetup(ClientModeImpl.java:1085) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.handleNetworkDisconnect(ClientModeImpl.java:2765) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.access$5600(ClientModeImpl.java:164) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl$ConnectModeState.processMessage(ClientModeImpl.java:4288) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:992) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:809) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at android.os.Handler.dispatchMessage(Handler.java:106) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at android.os.Looper.loop(Looper.java:223) 06-20 15:29:09.647 1497 1891 V WifiClientModeImpl: at android.os.HandlerThread.run(HandlerThread.java:67) 06-20 15:29:09.649 2137 29015 D DhcpClient: doQuit 06-20 15:29:09.585 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:09.649 1497 1910 D ConnectivityService: [498 WIFI] EVENT_NETWORK_INFO_CHANGED, going from CONNECTED to DISCONNECTED 06-20 15:29:09.649 1497 1910 D ConnectivityService: [498 WIFI] disconnected, was satisfying 40 06-20 15:29:09.649 1497 1891 I WifiClientModeImpl: disconnectedstate enter 06-20 15:29:09.650 1497 1891 D WifiClientModeImpl: connectToUserSelectNetwork netId 229, uid 10353, forceReconnect = false 06-20 15:29:09.653 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, DISCONNECTED) 06-20 15:29:09.653 1497 1891 D WifiNetworkAgent: NetworkAgent: NetworkAgent channel lost 06-20 15:29:09.654 1497 1891 D WifiClientModeImpl: CMD_START_CONNECT my state DisconnectedState nid=229 roam=false 06-20 15:29:09.654 2137 29015 D ApfFilter: (wlan0): shutting down 06-20 15:29:09.662 2137 29015 D DhcpClient: DHCP Packet Handler stopped 06-20 15:29:09.662 2137 29015 D DhcpClient: onQuitting 06-20 15:29:09.668 1497 1522 I GnssNetworkConnectivityHandler: Network connection lost. Available networks count: 0 06-20 15:29:09.668 1497 1522 I GnssNetworkConnectivityHandler: updateNetworkState, state=CLOSED, connected=false, network=498, capabilities=[ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=318000Kbps LinkDnBandwidth>=318000Kbps SignalStrength: -65 OwnerUid: 1000 AdministratorUids: [] SSID: "dealino.de" RequestorUid: -1 RequestorPackageName: null], apn: , availableNetworkCount: 0 06-20 15:29:09.669 2170 2284 W QCNEJ : |CORE| network lost: 498 06-20 15:29:09.670 2170 2284 W QCNEJ : |CORE| onLost: unbind the process to WIFI 06-20 15:29:09.672 28512 28617 V NativeCrypto: Read error: ssl=0x7dafa33b98: I/O error during system call, Software caused connection abort 06-20 15:29:09.673 24519 24601 D RNWifiTethering: onLost 06-20 15:29:09.678 28512 13129 V NativeCrypto: SSL shutdown failed: ssl=0x7dafa33b98: I/O error during system call, Broken pipe 06-20 15:29:09.678 28512 13129 E WakeLock: GCM_HB_ALARM release without a matched acquire! 06-20 15:29:09.679 28512 13129 W WakeLock: GCM_HB_ALARM counter does not exist 06-20 15:29:09.679 18591 18649 I CarrierServices: [40007] glt.handleMessage: RcsEngineImpl[DUAL_REG]:[e9198652-94f5]>Handler: handleMessage processing message:[NOTIFY_UPTIME_IGNORE_STATE_CHANGED] with [non-null]:RcsEngineImpl reference 06-20 15:29:09.680 1497 1910 D ConnectivityService: Sending DISCONNECTED broadcast for type 1 [498 WIFI] isDefaultNetwork=true 06-20 15:29:09.681 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:09.686 28512 13129 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_CONN_ALARM type: 2 triggerAtMillis: 2163720443] 06-20 15:29:09.687 28512 13129 E WakeLock: GCM_CONN_ALARM release without a matched acquire! 06-20 15:29:09.687 18591 18649 I CarrierServices: [40007] gix.g: RCS Configuration storage in Bugle is disabled by p/h flag, using ProvisioningEngineStateCacheUtil.getProvisioningConfigurationForGivenSimIfExist() 06-20 15:29:09.687 28512 13129 W WakeLock: GCM_CONN_ALARM counter does not exist 06-20 15:29:09.688 943 943 V ContextHubHal: sendMessageToHub 06-20 15:29:09.691 955 1050 D CHRE : @ 2163721.604: Parsed nanoapp message from host: app ID 0x476f6f676c00100b, endpoint 0x28, msgType 112, payload size 14 06-20 15:29:09.691 955 1050 I CHRE : @ 2163721.605: [NanoMinion] received MSG Type 0x70, Version 1, 10 bytes 06-20 15:29:09.691 955 1050 I CHRE : @ 2163721.605: [AR] context-signal: has_bt=0, bt=0, has_wifi=1, wifi=0 06-20 15:29:09.692 18591 18651 I CarrierServices: [40009] fuc.c: Connected state: [2], networkType: [null] 06-20 15:29:09.693 13751 13810 I BugleTransport: RCS Configuration is empty. Enabled transport is Dual Reg [CONTEXT ratelimit_period="5 SECONDS" ] 06-20 15:29:09.694 10552 13920 I DeviceStatusMonitor: DeviceStatusMonitor.handleBroadcast():123 onReceive() : Action = android.net.conn.CONNECTIVITY_CHANGE 06-20 15:29:09.694 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:09.696 970 970 D vendor.google.wifi_ext@1.0-service-vendor: Successfully SetMacAddress. 06-20 15:29:09.696 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:09.697 1497 1891 D WifiClientModeImpl: ConnectedMacRandomization SSID(WiFi-Repeater1). setMacAddress(3e:c6:60:d5:7a:8e) from aa:33:dd:a1:5d:c3 = true 06-20 15:29:09.697 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:09.698 1497 1891 I WifiClientModeImpl: Connecting with 3e:c6:60:d5:7a:8e as the mac address 06-20 15:29:09.699 1161 1161 W wificond: Scan is not started. Ignore abort request 06-20 15:29:09.699 1497 1891 D SupplicantStaIfaceHal: connectToNetwork "WiFi-Repeater1"WPA_PSK-0 06-20 15:29:09.699 10552 13920 I DeviceStatusMonitor: DeviceStatusMonitor.getCurrentNetworkState():195 getCurrentNetworkState(): no networks 06-20 15:29:09.704 1497 1891 I SupplicantStaIfaceHal: addSupplicantStaNetwork via HIDL 06-20 15:29:09.704 10552 13920 I DeviceStatusMonitor: DeviceStatusMonitor.notifyIfNetworkChanged():180 notifyIfNetworkChanged: newState = NO_CONNECTION, airplaneModeOn = false, notifyAnyway = false 06-20 15:29:09.707 10552 10552 I NetworkInfoNotification: NetworkInfoNotification$Listener.onReceive():98 onNetworkLost: networkState = NO_CONNECTION, isAirplaneModeOn = false 06-20 15:29:09.708 10552 13924 I NetworkInfoNotification: NetworkInfoNotification$Listener.onReceive():98 onNetworkLost: networkState = NO_CONNECTION, isAirplaneModeOn = false 06-20 15:29:09.708 10552 13923 I NetworkInfoNotification: NetworkInfoNotification$Listener.onReceive():98 onNetworkLost: networkState = NO_CONNECTION, isAirplaneModeOn = false 06-20 15:29:09.717 1497 1531 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10123; state: DISABLED 06-20 15:29:09.717 1497 1532 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10123; state: ENABLED 06-20 15:29:09.718 970 29012 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0x6a 06-20 15:29:09.723 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, DISCONNECTED) 06-20 15:29:09.724 922 922 D Zygote : Forked child process 13925 06-20 15:29:09.726 1497 1532 I ActivityManager: Start proc 13925:com.google.android.settings.intelligence/u0a123 for broadcast {com.google.android.settings.intelligence/com.google.android.settings.intelligence.modules.routines.impl.WifiBroadcastReceiver} 06-20 15:29:09.727 2211 2211 D GRIL-S : [1348]> UPDATE_DEVICE_STATE DeviceState: Usb:1, Wifi: 0, Wifi AP: 0, Earpiece: 0, Bluetooth: 0, Wireless charging: 0, Screen: 1, Camera: 0, 0, 0, 0, Motion: 1, Bluetooth tethering: 0, Voice: 0, Wifi 2.4G: 0, Radio: 0, Bluetooth connected: 0, Bluetooth media: 0 06-20 15:29:09.733 13925 13925 E gs.intelligenc: Not starting debugger since process cannot load the jdwp agent. 06-20 15:29:09.748 2211 3115 D GRIL-S : [1348]< UPDATE_DEVICE_STATE 06-20 15:29:09.762 13925 13925 I gs.intelligenc: The ClassLoaderContext is a special shared library. 06-20 15:29:09.793 13925 13925 D NetworkSecurityConfig: No Network Security Config specified, using platform default 06-20 15:29:09.794 13925 13925 D NetworkSecurityConfig: No Network Security Config specified, using platform default 06-20 15:29:09.798 13925 13925 W gs.intelligenc: Accessing hidden field Ljava/util/Collections$SynchronizedCollection;->mutex:Ljava/lang/Object; (greylist-max-o, reflection, denied) 06-20 15:29:09.798 13925 13925 W gs.intelligenc: Accessing hidden method Ljava/util/Collections$SynchronizedSet;->(Ljava/util/Set;Ljava/lang/Object;)V (greylist-max-o, reflection, denied) 06-20 15:29:09.798 13925 13925 W gs.intelligenc: Accessing hidden method Ljava/util/Collections$SynchronizedCollection;->(Ljava/util/Collection;Ljava/lang/Object;)V (greylist-max-o, reflection, denied) 06-20 15:29:09.799 13925 13925 I TetheringManager: registerTetheringEventCallback:com.google.android.settings.intelligence 06-20 15:29:09.867 28512 28512 D BoundBrokerSvc: onBind: Intent { act=com.google.android.contextmanager.service.ContextManagerService.START pkg=com.google.android.gms } 06-20 15:29:09.867 28512 28512 D BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.contextmanager.service.ContextManagerService.START pkg=com.google.android.gms } 06-20 15:29:10.573 28512 13652 E WakeLock: GCM_HB_ALARM release without a matched acquire! 06-20 15:29:10.573 28512 13652 W WakeLock: GCM_HB_ALARM counter does not exist 06-20 15:29:10.574 28512 13652 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_CONN_ALARM type: 2 triggerAtMillis: 2163730460] 06-20 15:29:10.575 28512 13652 E WakeLock: GCM_CONN_ALARM release without a matched acquire! 06-20 15:29:11.159 3016 3109 D DeviceStateHelper: Audo mode: 0 06-20 15:29:11.162 3016 3109 D DeviceStateHelper: Audo mode: 0 06-20 15:29:11.213 955 1050 D VSC : @ 2163723.126: [WO] isFlat() nearest_rotation: 0, flat_angle: 65 06-20 15:29:11.213 955 1050 D VSC : @ 2163723.126: [WO] orientation angle 7, orientation 0 06-20 15:29:11.458 970 29012 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0x6b 06-20 15:29:11.460 29014 29014 I wpa_supplicant: wlan0: Trying to associate with SSID 'WiFi-Repeater1' 06-20 15:29:11.490 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTING) 06-20 15:29:11.506 970 29012 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xa5 06-20 15:29:11.508 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:11.508 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true 06-20 15:29:11.516 29014 29014 I wpa_supplicant: wlan0: Associated with 00:23:13:05:8b:be 06-20 15:29:11.517 29014 29014 I wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from 00:23:13:05:8b:be (ver=2) 06-20 15:29:11.517 29014 29014 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4 06-20 15:29:11.517 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0 06-20 15:29:11.524 29014 29014 I wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from 00:23:13:05:8b:be (ver=2) 06-20 15:29:11.524 29014 29014 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4 06-20 15:29:11.526 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTING) 06-20 15:29:11.534 29014 29014 I wpa_supplicant: wlan0: WPA: Key negotiation completed with 00:23:13:05:8b:be [PTK=CCMP GTK=CCMP] 06-20 15:29:11.535 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to 00:23:13:05:8b:be completed [id=0 id_str=%7B%22configKey%22%3A%22%5C%22WiFi-Repeater1%5C%22WPA_PSK-0%22%2C%22creatorUid%22%3A%2210353%22%7D] 06-20 15:29:11.537 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true 06-20 15:29:11.542 1497 1891 D ConnectivityService: registerNetworkAgent NetworkAgentInfo{ ni{[type: WIFI[], state: UNKNOWN/IDLE, reason: (unspecified), extra: , failover: false, available: true, roaming: false]} network{499} nethandle{2146594377741} lp{{InterfaceName: wlan0 LinkAddresses: [ ] DnsAddresses: [ ] Domains: null MTU: 0 Routes: [ ]}} nc{[ Transports: WIFI Capabilities: NOT_METERED&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=144000Kbps LinkDnBandwidth>=144000Kbps Specifier: <WifiNetworkAgentSpecifier [WifiConfiguration=, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> OwnerUid: 10353 SSID: "WiFi-Repeater1" RequestorUid: 10353 RequestorPackageName: com.wifi_tether]} Score{20} everValidated{false} lastValidated{false} created{false} lingering{false} explicitlySelected{false} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} partialConnectivity{false} acceptPartialConnectivity{false} clat{mBaseIface: null, mIface: null, mState: IDLE} } 06-20 15:29:11.545 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTING) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: stopIpClient IpClientWithPreConnection: false 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: java.lang.Throwable 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopIpClient(ClientModeImpl.java:1070) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopDhcpSetup(ClientModeImpl.java:1085) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.startIpClient(ClientModeImpl.java:6545) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.access$6900(ClientModeImpl.java:164) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl$ObtainingIpState.enter(ClientModeImpl.java:5133) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.invokeEnterMethods(StateMachine.java:1037) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.performTransitions(StateMachine.java:879) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:819) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at android.os.Handler.dispatchMessage(Handler.java:106) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at android.os.Looper.loop(Looper.java:223) 06-20 15:29:11.546 1497 1891 V WifiClientModeImpl: at android.os.HandlerThread.run(HandlerThread.java:67) 06-20 15:29:11.547 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTING) 06-20 15:29:11.554 1497 1910 D ConnectivityService: [499 WIFI] EVENT_NETWORK_INFO_CHANGED, going from UNKNOWN to UNKNOWN 06-20 15:29:11.581 1497 1891 W WifiScoreReport: Ignoring stale/invalid external score sessionId=-1 currentSessionId=4995 score=60 06-20 15:29:11.589 2137 13961 D ApfFilter: (wlan0): begin monitoring 06-20 15:29:11.628 886 2004 E Netd : no such netId 499 06-20 15:29:11.645 2137 29015 D DhcpClient: Broadcasting DHCPDISCOVER 06-20 15:29:11.705 1170 1170 I cnss-daemon: wlan_service_core_minfreq: RESET 06-20 15:29:11.705 1170 1170 E cnss-daemon: wlan_service_core_minfreq: reset: handle not valid 06-20 15:29:11.706 2137 29015 D DhcpClient: Received packet: 3e:c6:60:d5:7a:8e OFFER, ip /192.168.178.179, mask /255.255.255.0, DNS servers: /192.168.178.1 , gateways [/192.168.178.1], lease time 864000, domain fritz.box 06-20 15:29:11.708 2137 29015 D DhcpClient: Got pending lease: android.net.networkstack.DhcpResults@3af493a DHCP server /192.168.178.1 Vendor info null lease 864000 seconds Servername 06-20 15:29:11.714 2137 29015 D DhcpClient: Broadcasting DHCPREQUEST ciaddr=0.0.0.0 request=192.168.178.179 serverid=192.168.178.1 06-20 15:29:11.807 2137 29015 D DhcpClient: Received packet: 3e:c6:60:d5:7a:8e ACK: your new IP /192.168.178.179, netmask /255.255.255.0, gateways [/192.168.178.1] DNS servers: /192.168.178.1 , lease time 864000 06-20 15:29:11.808 2137 29015 D DhcpClient: Confirmed lease: android.net.networkstack.DhcpResults@3820348 DHCP server /192.168.178.1 Vendor info null lease 864000 seconds Servername 06-20 15:29:11.816 886 2004 E Netd : no such netId 499 06-20 15:29:11.818 1497 1910 E ConnectivityService: Exception in networkAddRouteParcel for non-gateway: android.os.ServiceSpecificException: Machine is not on the network (code 64) 06-20 15:29:11.818 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTING) 06-20 15:29:11.819 886 2004 E Netd : no such netId 499 06-20 15:29:11.820 1497 1910 E ConnectivityService: Exception in networkAddRouteParcel for gateway: android.os.ServiceSpecificException: Machine is not on the network (code 64) 06-20 15:29:11.820 1497 1910 D ConnectivityService: Setting DNS servers for network 499 to [] 06-20 15:29:11.825 2137 29015 D DhcpClient: Scheduling renewal in 431999s 06-20 15:29:11.825 2137 29015 D DhcpClient: Scheduling rebind in 755999s 06-20 15:29:11.825 2137 29015 D DhcpClient: Scheduling expiry in 863999s 06-20 15:29:11.842 1497 1910 D ConnectivityService: Setting DNS servers for network 499 to [/192.168.178.1] 06-20 15:29:11.849 1497 1837 D WifiMemoryStoreImpl: Set cluster Gd9c178398232e5d6 for W9baf832dcb876dbb: SUCCESS 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: Connected to network ID: -1 SSID: "WiFi-Repeater1" PROVIDER-NAME: null BSSID: 00:23:13:05:8b:be FQDN: null HOME-PROVIDER-NETWORK: false PRIO: 0 HIDDEN: false PMF: falseCarrierId: -1 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: NetworkSelectionStatus NETWORK_SELECTION_ENABLED 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: hasEverConnected: false 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: ephemeral trusted fromWifiNetworkSpecifier 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: macRandomizationSetting: 1 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: mRandomizedMacAddress: 02:00:00:00:00:00 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: randomizedMacExpirationTimeMs: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: KeyMgmt: WPA_PSK Protocols: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: AuthAlgorithms: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: PairwiseCiphers: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: GroupCiphers: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: GroupMgmtCiphers: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: SuiteBCiphers: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: PSK/SAE: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: Enterprise config: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: ocsp: 0 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: IP config: 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: IP assignment: UNASSIGNED 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: Proxy settings: UNASSIGNED 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: cuid=-1 luid=-1 lcuid=0 allowAutojoin=true noInternetAccessExpected=false mostRecentlyConnected=false 06-20 15:29:11.850 1497 1891 D WifiNetworkFactory: recentFailure: Association Rejection code: 0 06-20 15:29:11.852 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, CONNECTED) 06-20 15:29:11.855 1497 1910 D ConnectivityService: [499 WIFI] EVENT_NETWORK_INFO_CHANGED, going from UNKNOWN to CONNECTED 06-20 15:29:11.857 1497 1910 D DnsManager: sendDnsConfigurationForNetwork(499, [192.168.178.1], [fritz.box], 1800, 25, 8, 64, 0, 0, , []) 06-20 15:29:11.857 1497 1910 D ConnectivityService: Adding iface wlan0 to network 499 06-20 15:29:11.870 28512 31138 I ChimeraSrvcProxy: NullBinder for android.net.action.RECOMMEND_NETWORKS triggering remote TransactionTooLargeException due to Service without Chimera impl 06-20 15:29:11.870 28512 31138 I .gms.persisten: oneway function results will be dropped but finished with status OK and parcel size 1056768 06-20 15:29:11.874 1497 2167 D WifiMemoryStoreImpl: Set cluster G345309e5bcbf0f04 for Wabb208c755a92956: SUCCESS 06-20 15:29:11.877 1497 2163 D WifiMemoryStoreImpl: Set cluster Gd9c178398232e5d6 for Wd9c178398232e5d6: SUCCESS 06-20 15:29:11.881 1497 2167 D WifiMemoryStoreImpl: Set cluster G345309e5bcbf0f04 for W345309e5bcbf0f04: SUCCESS 06-20 15:29:11.882 1497 1910 D ConnectivityService: Setting DNS servers for network 499 to [/192.168.178.1] 06-20 15:29:11.882 1497 1910 D DnsManager: sendDnsConfigurationForNetwork(499, [192.168.178.1], [fritz.box], 1800, 25, 8, 64, 0, 0, , []) 06-20 15:29:11.900 1497 1891 D WifiClientModeImpl: Received signal strength thresholds: [] 06-20 15:29:11.900 1497 1910 D ConnectivityService: NetReassign [8156 : null → 499] 06-20 15:29:11.901 1497 1891 E WifiVendorHal: stopRssiMonitoring(l.2100) failed {.code = ERROR_NOT_AVAILABLE, .description = } 06-20 15:29:11.901 2137 13960 D NetworkMonitor/499: Network would not satisfy default request, not validating 06-20 15:29:11.903 1497 1910 D ConnectivityService: [499 WIFI] validation passed 06-20 15:29:11.903 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:11.903 24519 24601 W ConnectivityManager.CallbackHandler: callback not found for CALLBACK_PRECHECK message 06-20 15:29:11.904 1497 1910 D ConnectivityService: Setting DNS servers for network 499 to [/192.168.178.1] 06-20 15:29:11.904 1497 1910 D DnsManager: sendDnsConfigurationForNetwork(499, [192.168.178.1], [fritz.box], 1800, 25, 8, 64, 0, 0, , []) 06-20 15:29:11.905 1497 1910 D ConnectivityService: releasing NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] (release request) 06-20 15:29:11.905 24519 24601 W ConnectivityManager.CallbackHandler: callback not found for CALLBACK_CAP_CHANGED message 06-20 15:29:11.905 1497 1910 D ConnectivityService: no live requests for [499 WIFI]; disconnecting 06-20 15:29:11.906 1497 1910 D ConnectivityService: [499 WIFI] disconnected, was satisfying 1 06-20 15:29:11.906 1497 1891 D WifiNetworkAgent: NetworkAgent: NetworkAgent channel lost 06-20 15:29:11.906 1497 1891 I WifiNetworkFactory: App released connected request, cancelling NetworkRequest [ REQUEST id=8156, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <WifiNetworkSpecifier [, SSID Match pattern=PatternMatcher{LITERAL: WiFi-Repeater1}, BSSID Match pattern=Pair{00:23:13:05:8b:be ff:ff:ff:ff:ff:ff}, SSID="WiFi-Repeater1", BSSID=00:23:13:05:8b:be]> Uid: 10353 AdministratorUids: [] RequestorUid: 10353 RequestorPackageName: com.wifi_tether] ] 06-20 15:29:11.906 1497 1891 I WifiNetworkFactory: Disconnecting from network on reset 06-20 15:29:11.909 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.909 1497 1891 D SupplicantStaIfaceHal: Remove cached HAL data for config id 229 06-20 15:29:11.909 1497 1891 D WifiConnectivityHelper: Firmware supported feature set: 9bda915fd 06-20 15:29:11.910 1497 1891 D WifiConnectivityHelper: Firmware roaming supported with capabilities: max num blacklist bssid=16 max num whitelist ssid=4 06-20 15:29:11.913 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.913 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.915 1497 1837 D WifiMemoryStoreImpl: Remove cluster G345309e5bcbf0f04: SUCCESS deleted: 2 06-20 15:29:11.916 24519 24601 D RNWifiTethering: onLost 06-20 15:29:11.917 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.918 1497 2797 D WifiMemoryStoreImpl: Set cluster G345309e5bcbf0f04 for Wabb208c755a92956: SUCCESS 06-20 15:29:11.922 28512 13129 I GCoreUlr: Batch Location Update aborted because not connected 06-20 15:29:11.926 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:23:13:05:8b:be reason=3 locally_generated=1 06-20 15:29:11.927 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:11.927 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:11.928 970 29012 I WifiHAL : Fate Tx-Rx: Packet fate stats stop received 06-20 15:29:11.928 1497 1891 D WifiClientModeImpl: ClientModeImpl: Leaving Connected state 06-20 15:29:11.928 1497 1891 D WifiCountryCode: Reading country code from telephony 06-20 15:29:11.930 1170 1170 E cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_use_userconfig 06-20 15:29:11.931 1497 1891 D WifiCountryCode: Set telephony country code to: 06-20 15:29:11.931 1497 1891 D WifiCountryCode: updateCountryCode to 00 06-20 15:29:11.932 1497 1910 D ConnectivityService: NetReassign [no changes] 06-20 15:29:11.932 29014 29014 I wpa_supplicant: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=00 06-20 15:29:11.932 1497 1891 D WifiCountryCode: Succeeded to set country code to: 00 06-20 15:29:11.932 1497 1891 D WifiClientModeImpl: Start Disconnecting Watchdog 339 06-20 15:29:11.932 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.933 1497 1891 E WifiVendorHal: stopRssiMonitoring(l.2100) failed {.code = ERROR_NOT_AVAILABLE, .description = } 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: stopIpClient IpClientWithPreConnection: false 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: java.lang.Throwable 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopIpClient(ClientModeImpl.java:1070) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.stopDhcpSetup(ClientModeImpl.java:1085) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.handleNetworkDisconnect(ClientModeImpl.java:2765) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl.access$5600(ClientModeImpl.java:164) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.server.wifi.ClientModeImpl$ConnectModeState.processMessage(ClientModeImpl.java:4288) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:992) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:809) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at android.os.Handler.dispatchMessage(Handler.java:106) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at android.os.Looper.loop(Looper.java:223) 06-20 15:29:11.933 1497 1891 V WifiClientModeImpl: at android.os.HandlerThread.run(HandlerThread.java:67) 06-20 15:29:11.934 1497 1891 E WifiConfigManager: Cannot find network with networkId 229 06-20 15:29:11.934 2137 29015 D DhcpClient: doQuit 06-20 15:29:11.934 1497 1891 I WifiClientModeImpl: disconnectedstate enter 06-20 15:29:11.935 2137 29015 D ApfFilter: (wlan0): shutting down 06-20 15:29:11.935 1497 1891 E WifiScoringParams: Invalid frequency(-1), using 5G as default rssi array 06-20 15:29:11.936 2170 2265 I QCNEJ/CndHalConnector: -> SND notifyRatConnectionStatusChanged(rat = 1, DISCONNECTED) 06-20 15:29:11.940 2137 29015 D DhcpClient: DHCP Packet Handler stopped 06-20 15:29:11.941 2137 29015 D DhcpClient: onQuitting 06-20 15:29:11.945 886 977 E Netd : Removing unknown address fe80::3cc6:60ff:fed5:7a8e/64 from ifindex 30 06-20 15:29:12.526 1497 1522 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false 06-20 15:29:12.730 13925 13925 W rules.WifiRx: FenceState currentState is not true

aboozaid commented 1 year ago

Logs seems okay could you please do some debug on that function which handle the promise resolve? https://github.com/aboozaid/react-native-tethering/blob/9f3eb11bfc9b6e3d163fdd6c3d53bd06018a3508/packages/wifi/android/src/main/java/com/reactnativetethering/wifi/WifiTethering.kt#L139

wtlyu commented 3 months ago

We are facing the same issue here.

The test device is a Redmi Android 30 system.

The problem is that isAlreadyConnected always return false while ssid can successfully retrieved in that line you mentioned above.

In our research, it seems that getNetworkInfo has been deprecated since Android 29.

@aboozaid