Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Linux Disconnect Not Working #173

Open
1 of 2 tasks
SuspensionPoint opened this issue Nov 22, 2021 · 4 comments
Open
1 of 2 tasks

[Bug]: Linux Disconnect Not Working #173

SuspensionPoint opened this issue Nov 22, 2021 · 4 comments

Comments

@SuspensionPoint
Copy link

SuspensionPoint commented Nov 22, 2021

Expected behavior

The ReadMe specifies that you must set the interface to null at least.

It then shows that once you set the wifi iface to null, you can then call disconnect() method.

On Linux, I'm setting the iface to null, then calling disconnect on the wifi object.

I expect that the network will be disconnected.

Current behavior

Instead, whenever I'm calling disconnect() on the wifi object I get the following error:

Error: No interface specified.

Does this not work if an interface was set to null? I cannot find any mention of this in the readme or issues.

Thanks

Which are the affected features

  • node API
  • CLI

Which is your operating system?

Linux

Environment

Ubuntu 18.04.5 LTS

Version of node-wifi

2.0.14

Steps to Reproduce

Follow the read me example, then try calling the disconnect method.

Solutions

Perhaps I'm missing a step, but I'm a little lost here.

It seems like the disconnect method would be able to gather the iface of the currently connected network, but I'm not sure.

@friedrith
Copy link
Owner

Sorry for the delay. Can you write the code you are using?

@potatolooper
Copy link

potatolooper commented Jul 27, 2022

I have the same problem in Ubuntu 20.04.
I try to use a disconnect() and give me the same error
MicrosoftTeams-image

The code is working in electron/vue app but in windows 11 work whitout any problem.
i dont know if you need more things

@SuspensionPoint
Copy link
Author

Hey there, sorry for the slow response. I did eventually fix this issue. I'm trying to recall what the exact fix was.

I believe I was encountering an issue where when a new network connection was established, for some reason the iface for the this.wifi instance wasn't being updated to use the new connections iface.

Whenever the new connection was made, I manually would call wifi.init() and pass in the iface for the new connection.

@EllyssonMike
Copy link

I have the same problem on Debian 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants