Git Product home page Git Product logo

Comments (20)

matteocappello94 avatar matteocappello94 commented on July 29, 2024 1

@jainsuneet when you install from GitHub cordova plugin add https://github.com/cloudsurfers-it/wifiwizard2.git#plus #{branch-name} to select a branch.

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024 1

You can try connect to specify network knowing SSID and Pass. Try new method.

Maybe solve your problem.

https://github.com/klich3/WifiWizard2#dev

@klich3 So I finally found the issue that why it was not able to connect to an open network. builder.setWpa2Passphrase(newPass); is the standard wpa2 connection. If I disable this line then open network connection works. Other functions like disconnect and remove are not at all working for API >= 29.

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

Please install it with cordova plugin add https://github.com/tripflex/WifiWizard2 or ionic cordova plugin add https://github.com/tripflex/WifiWizard2 if you are using Ionic framework.

NPM release is older than GitHub master repository and there isn't Android 10 support on it.

from wifiwizard2.

klich3 avatar klich3 commented on July 29, 2024

You have one pull request for add new method for support Android 10. See it and, add it if you wanna...
Regards

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

Please install it with cordova plugin add https://github.com/tripflex/WifiWizard2 or ionic cordova plugin add https://github.com/tripflex/WifiWizard2 if you are using Ionic framework.

NPM release is older than GitHub master repository and there isn't Android 10 support on it.

@klich3 @matteocappello94 I am using the current master version and I still get an error 'WiFi not available' on connect()

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

Please install it with cordova plugin add https://github.com/tripflex/WifiWizard2 or ionic cordova plugin add https://github.com/tripflex/WifiWizard2 if you are using Ionic framework.
NPM release is older than GitHub master repository and there isn't Android 10 support on it.

@klich3 @matteocappello94 I am using the current master version and I still get an error 'WiFi not available' on connect()

Target Android 10, WifiWizard2 can't enable Wifi interface if it's disabled. To use it Wifi interface needs to be on.
https://developer.android.com/about/versions/10/privacy/changes#enable-disable-wifi

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

Please install it with cordova plugin add https://github.com/tripflex/WifiWizard2 or ionic cordova plugin add https://github.com/tripflex/WifiWizard2 if you are using Ionic framework.
NPM release is older than GitHub master repository and there isn't Android 10 support on it.

@klich3 @matteocappello94 I am using the current master version and I still get an error 'WiFi not available' on connect()

Target Android 10, WifiWizard2 can't enable Wifi interface if it's disabled. To use it Wifi interface needs to be on.
https://developer.android.com/about/versions/10/privacy/changes#enable-disable-wifi

@matteocappello94 The Wifi interface is on. It works without any issue on targetsdk 28 but with 29 it is throwing error 'WiFi not available'. Event location access is also provided.

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

@jainsuneet I'm using this version https://github.com/cloudsurfers-it/WifiWizard2/tree/plus (fork of this master with some little improvement for my work) targeting API 29 and Cordova without any problems.
Post a snipped of your code please.
Are you sure you have updated correctly the plugin? try to remove it with cordova plugin rm wifiwizard2 and re-install it from this repository master or from my "plus" branch.

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

https://github.com/cloudsurfers-it/WifiWizard2/tree/plus

@matteocappello94 With your version I am getting below error while installing

cordova plugin add https://github.com/cloudsurfers-it/WifiWizard2/tree/plus

Failed to fetch plugin https://github.com/cloudsurfers-it/WifiWizard2/tree/plus via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
CordovaError: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: https://github.com/cloudsurfers-it/WifiWizard2/tree/plus.
npm ERR! package.json npm can't find a package.json file in your current directory.

Here is the snippet of my code to connect to the WiFi

window.WifiWizard2.connect('SSID_Name', true).then((data) => {
    alert(JSON.stringify('success'))
}).catch((error) => {
    alert(JSON.stringify(error))
})

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

cordova plugin add https://github.com/cloudsurfers-it/wifiwizard2.git#plus

@matteocappello94 With your repo is also the same error 'WiFi not available'

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

@jainsuneet with Android Studio, you can debug with breakpoints .java class and methods of WifiWizard2 to verify where error occur.
Try to pass all args to the connect method, for example:
WifiWizard2.connect("NETWORK_NAME", true, "12345678", "WPA", false, true)
last argument withPattern it's only present on my "plus" branch. Let you list on Android 10 Wifi connection popup multiple networks, which are selected with RegEx pattern.

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

@jainsuneet LOCATION permission is granted, but location interface is enabled?

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

@jainsuneet LOCATION permission is granted, but location interface is enabled?

@matteocappello94 yes location interface is also enabled and also I cannot pass others args because the wifi is an open network.

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

@jainsuneet WIFI_NOT_ENABLED returned from verifyWifiEnabled() method of WifiWizard2.java
This method call wifiManager.isWifiEnabled() to check Wifi interface state. You have to debug this method with Android Studio to find your error on your device. If you are using Cordova, open Android project directly with Android Studio.

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

@jainsuneet WIFI_NOT_ENABLED returned from verifyWifiEnabled() method of WifiWizard2.java
This method call wifiManager.isWifiEnabled() to check Wifi interface state. You have to debug this method with Android Studio to find your error on your device. If you are using Cordova, open Android project directly with Android Studio.

@matteocappello94 I am getting 'WiFi not available', I can scan for the wifi ssids and it works but the connection is failing.

The not available is coming from

public void onUnavailable() {
    super.onUnavailable();
    Log.d(TAG, "WiFi not available");
    callbackContext.error("WiFi not available");
}

which is within if(API_VERSION >= 29) block

from wifiwizard2.

matteocappello94 avatar matteocappello94 commented on July 29, 2024

@jainsuneet appear popup window when you try to connect? If you can try with a Wifi network with password using method with all args like this:
WifiWizard2.connect("NETWORK_NAME", true, "12345678", "WPA", false, true)
This works for me without any problems.
I've to try to connect to an open network to check if the problem still also present with my app or not.

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

@jainsuneet appear popup window when you try to connect? If you can try with a Wifi network with password using method with all args like this:
WifiWizard2.connect("NETWORK_NAME", true, "12345678", "WPA", false, true)
This works for me without any problems.
I've to try to connect to an open network to check if the problem still also present with my app or not.

@matteocappello94 Yes now I tried with Password as well.
WifiWizard2.connect("NETWORK_NAME", true, "12345678", "WPA", false, true)

Still it throws the same error 'WiFi not available'. Even I am getting the popup with Wifi Network details but after that comes the error.

But if I connect like this WifiWizard2.connect("NETWORK_NAME", true, "12345678", "WPA", false) then it works:

Is there any way that I can connect to an open WiFi? it will be really helpful.

from wifiwizard2.

klich3 avatar klich3 commented on July 29, 2024

You can try connect to specify network knowing SSID and Pass. Try new method.

Maybe solve your problem.

https://github.com/klich3/WifiWizard2#dev

from wifiwizard2.

klich3 avatar klich3 commented on July 29, 2024

You can try connect to specify network knowing SSID and Pass. Try new method.
Maybe solve your problem.
https://github.com/klich3/WifiWizard2#dev

@klich3 So I finally found the issue that why it was not able to connect to an open network. builder.setWpa2Passphrase(newPass); is the standard wpa2 connection. If I disable this line then open network connection works. Other functions like disconnect and remove are not at all working for API >= 29.

Thanks, now for default is set as NONE for Open networks. Others Methods are Depricated on >= Api 29

from wifiwizard2.

jainsuneet avatar jainsuneet commented on July 29, 2024

You can try connect to specify network knowing SSID and Pass. Try new method.
Maybe solve your problem.
https://github.com/klich3/WifiWizard2#dev

@klich3 So I finally found the issue that why it was not able to connect to an open network. builder.setWpa2Passphrase(newPass); is the standard wpa2 connection. If I disable this line then open network connection works. Other functions like disconnect and remove are not at all working for API >= 29.

Thanks, now for default is set as NONE for Open networks. Others Methods are Depricated on >= Api 29

@klich3 With your latest commit on the dev branch I am getting lot of errors and the build is getting failed. Can you please help to resolve the issue.

> Task :app:compileDebugJavaWithJavac FAILED
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2008: error: empty character literal
        if(Algorithm.matches("/WPA3/gim") && PASS != '')
                                                     ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2008: error: unclosed character literal
        if(Algorithm.matches("/WPA3/gim") && PASS != '')
                                                      ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2008: error: ';' expected
        if(Algorithm.matches("/WPA3/gim") && PASS != '')
                                                        ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:1988: error: 'try' without 'catch', 'finally' or resource declarations
      try {
      ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2056: error: 'catch' without 'try'
      } catch (Exception e) {
        ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2060: error: illegal start of type
    }else{
     ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2060: error: ';' expected
    }else{
         ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2061: error: <identifier> expected
      callbackContext.error("SPECIFIER_INVALID_API_VERSION");
                           ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2061: error: illegal start of type
      callbackContext.error("SPECIFIER_INVALID_API_VERSION");
                            ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2062: error: <identifier> expected
      Log.d(TAG, "WifiWizard2: 211 - specifierConnection invalid Android API Version is below as needed.");
           ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2062: error: <identifier> expected
      Log.d(TAG, "WifiWizard2: 211 - specifierConnection invalid Android API Version is below as needed.");
               ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2062: error: illegal start of type
      Log.d(TAG, "WifiWizard2: 211 - specifierConnection invalid Android API Version is below as needed.");
                 ^
App\src-cordova\platforms\android\app\src\main\java\android\wifiwizard2\WifiWizard2.java:2064: error: class, interface, or enum expected
  }
  ^
13 errors
```

from wifiwizard2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.