Git Product home page Git Product logo

Comments (13)

klich3 avatar klich3 commented on July 29, 2024 3

Hi "matscav" and "f18nfz", in my branch you have both connections one for oldes versions connect directly, and new one with suggest. The Suggest is for new gen Androids oldest one its not working properly because you need authorizations of user.

I thing this project is died and not supported by creator....

from wifiwizard2.

EYALIN avatar EYALIN commented on July 29, 2024 3

@klich3 @f18nfz @matscav @RolfDohrmann
some of the issues have been fixed in my forked repo:
https://github.com/EYALIN/community-cordova-plugin-wifi-wizard

you can install it as an npm package:
cordova plugin add community-cordova-plugin-wifi-wizard --save

from wifiwizard2.

EYALIN avatar EYALIN commented on July 29, 2024 1

@EduardSat i'm using it like this:

  if (+this.device.version > 10) {
                result = await (window as any).WifiWizard2.specifierConnection(wifiNetwork,wifiPassword, networkType, false);
            } else {
                result = await (window as any).WifiWizard2.connect(wifiNetwork, true,wifiPassword, networkType);
            }

regarding the disable, i think it's deprecated from Android 12.

from wifiwizard2.

RolfDohrmann avatar RolfDohrmann commented on July 29, 2024

I made some fixes and I did create another function (suggestConnection) for the new API. You can read more here

If you want to test my code or you need to have this working, here is my repo: 3.3.0 Run cordova plugin add https://github.com/matscav/WifiWizard2#dev

In Android 10+ all you have to do is call WifiWizard2.suggestConnection(SSID, password, algorithm, isHiddenSSID) instead of WifiWizard2.connect(SSID, bindAll, password, algorithm, isHiddenSSID)

Hope this can help anyone!

Hello @matscav,

I have an Ionic project. It works with capacitor. I was able to install your plugin and to call the suggestConnection() method. My hope was that it would connect my test device (Samsung A50, Android 11) to the chosen SSID. This is the code:

WifiWizard2.suggestConnection(SSID, pw, algorithm, isHidden).then( res => { console.log(res); }, err => { console.log(err); } );

I get back as res in the console:

STATUS_NETWORK_SUGGESTIONS_ADDED

This is no error, which is great! However, the test device did not connect to the SSID. Is this the expected behaviour? What would I need to do to connect to the SSID?

Btw, are you still a freelancer? The company in which I work is looking for a plugin developer. Drop me a note if you are interested.

Regards, Rolf

from wifiwizard2.

RolfDohrmann avatar RolfDohrmann commented on July 29, 2024

This is no error, which is great! However, the test device did not connect to the SSID. Is this the expected behaviour? What would I need to do to connect to the SSID?

Ok, I assumed that suggestConnection() is a replacement for connect() which has to be used if Android >= 10. That was wrong. The connection works using a Samsung A50 / Android 11 when using the method specifierConnection().

from wifiwizard2.

RolfDohrmann avatar RolfDohrmann commented on July 29, 2024

Now I want to restore the original connection. My idea is that I use disconnect(). And then the Smartphone maybe reconnects to the original network. Using disconnect():

If I use no SSID then I get this answer: ERROR_DISCONNECT.
If I use the SSID of the currently connected network then I get this answer: DISCONNECT_NET_ID_NOT_FOUND

So I guess this DISCONNECT_NET_ID_NOT_FOUND is the problem.

The documentation explains:
"Unable to determine network ID to disconnect/remove (from passed SSID)"

So I tried getConnectedNetworkId(), which however gives me a result (e.g. 4)

I tried the disable(). I first got the networkId by using getConnectedNetworkId(), then I call disable() using this networkId. The result is:

UNABLE_TO_DISABLE

Documentation: "Android returned failure in disabling network". And I read: "Please note that most newer versions of Android will only allow you to disable networks created by your application"

So what does it mean: "networks created by your application"?

Does this mean that the app is able to connect to a network, but is not able to disconnect?

from wifiwizard2.

f18nfz avatar f18nfz commented on July 29, 2024

Hi all,

I just forked this pull request from @klich3: Pull Request

I made some fixes and I did create another function (suggestConnection) for the new API. You can read more here

If you want to test my code or you need to have this working, here is my repo: 3.3.0 Run cordova plugin add https://github.com/matscav/WifiWizard2#dev

In Android 10+ all you have to do is call WifiWizard2.suggestConnection(SSID, password, algorithm, isHiddenSSID) instead of WifiWizard2.connect(SSID, bindAll, password, algorithm, isHiddenSSID)

Hope this can help anyone!

Thanks, but I can't seem to enable WiFi (turn WiFi on) if it's off on Android 10 devices (or where I target SDK>=30 (I've tried your fork too).
(I get the message: Uncaught ReferenceError: enabled is not defined) or VERIFY_ERROR_ENABLE_WIFI
Does the function WifiWizard2.setWifiEnabled(enabled); work with devices running Android 10? Or is this currently impossible as per: https://issuetracker.google.com/issues/128554616?pli=1

Thanks!

from wifiwizard2.

matscav avatar matscav commented on July 29, 2024

Hello,

I only added this function "suggestConnection". Maybe you can put some work on those functions that are not working and give it back to community.

Regards!

from wifiwizard2.

bartek-ddh avatar bartek-ddh commented on July 29, 2024

Now I want to restore the original connection. My idea is that I use disconnect(). And then the Smartphone maybe reconnects to the original network. Using disconnect():

If I use no SSID then I get this answer: ERROR_DISCONNECT. If I use the SSID of the currently connected network then I get this answer: DISCONNECT_NET_ID_NOT_FOUND

So I guess this DISCONNECT_NET_ID_NOT_FOUND is the problem.

The documentation explains: "Unable to determine network ID to disconnect/remove (from passed SSID)"

So I tried getConnectedNetworkId(), which however gives me a result (e.g. 4)

I tried the disable(). I first got the networkId by using getConnectedNetworkId(), then I call disable() using this networkId. The result is:

UNABLE_TO_DISABLE

Documentation: "Android returned failure in disabling network". And I read: "Please note that most newer versions of Android will only allow you to disable networks created by your application"

So what does it mean: "networks created by your application"?

Does this mean that the app is able to connect to a network, but is not able to disconnect?

still a problem in 2023

from wifiwizard2.

EduardSat avatar EduardSat commented on July 29, 2024

@EYALIN
Hello! I'm trying to use your implementation with capacitor and ionic/react. Can yo uhelp with installing your library?
Trying to import your library to use functions from it: import { WifiWizard2 } from 'community-cordova-plugin-wifi-wizard'. Hovewer, i'm getting error: Cannot find module 'community-cordova-plugin-wifi-wizard' or its corresponding type declarations.

from wifiwizard2.

EYALIN avatar EYALIN commented on July 29, 2024

@EduardSat you cannot import it directly.
or you can use the ionic wrapper, or you can use windows.wifiwizard2 (not sure if it's there or inside window.plugins)

hope that in the future I will be able to make it strongly typed.

from wifiwizard2.

EduardSat avatar EduardSat commented on July 29, 2024

@EduardSat you cannot import it directly. or you can use the ionic wrapper, or you can use windows.wifiwizard2 (not sure if it's there or inside window.plugins)

hope that in the future I will be able to make it strongly typed.

@EYALIN . i found the way to use your edited version. However, when i'm trying to connect to wifi using WifiWizard2.suggestConnection(), i'm always getting STATUS_NETWORK_SUGGESTIONS_ERROR. Can you suggest the way to solve that problem? And also i'm getting the error: DISABLE_NETWORK_NOT_FOUND, when i'm calling WifiWizard2.disable('ssid')

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.