node-wifi icon indicating copy to clipboard operation
node-wifi copied to clipboard

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

Open kamelorac opened this issue 1 year ago • 1 comments

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?

kamelorac avatar May 23 '23 03:05 kamelorac