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

I can't get wifi list when I use wifi.scan(). #189

Open
2 tasks
kamelorac opened this issue May 23, 2023 · 3 comments
Open
2 tasks

I can't get wifi list when I use wifi.scan(). #189

kamelorac opened this issue May 23, 2023 · 3 comments

Comments

@kamelorac
Copy link

Expected behavior

If I use wifi.scan(), I will get wifi list.
networks = [
{
ssid: '...',
bssid: '...',
mac: '...', // equals to bssid (for retrocompatibility)
channel: ,
frequency: , // in MHz
signal_level: , // in dB
quality: , // same as signal level but in %
security: 'WPA WPA2' // format depending on locale for open networks in Windows
security_flags: '...' // encryption protocols (format currently depending of the OS)
mode: '...' // network mode like Infra (format currently depending of the OS)
},
...
];

Current behavior

If I use wifi.scan(), I get empty wifi list.
networks = [];

Which are the affected features

  • node API
  • CLI

Which is your operating system?

Linux

Environment

Ubuntu 22.0.4

Version of node-wifi

2.0.16

Steps to Reproduce

I am working on electron project.
...
const WiFiControl = require('node-wifi');

WiFiControl.init({
iface: null,
});
const Allnetworks: any[] = [];

WiFiControl.scan((error, networks) => {
if (error) {
console.log('*************');
console.log(error);
} else {
console.log('8888888888888888');
Allnetworks = networks;
}
});
.....
console.log(Allnetworks); // empty []

Solutions

How to solve it?

@AM-51
Copy link

AM-51 commented Aug 5, 2024

Same problem on macbook pro m1, sonoma 14.5

@vuvivian
Copy link

Do you have a solution?

@55Cancri
Copy link

55Cancri commented Dec 9, 2024

this package uses macos airport command. If you run through terminal on later versions of macos, it won't work because its been deprecated: https://www.intuitibits.com/2024/03/14/goodbye-airport/ in favor of sudo wdutil info

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