Skip to content

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

@kamelorac

Description

@kamelorac

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions