friedrith / node-wifi

📶 NodeJS tool to manage wifi (connections, scans)
MIT License
397 stars 161 forks source link

Crash on Raspberry Pi 3 #35

Closed IncognitoCore closed 6 years ago

IncognitoCore commented 6 years ago

Implementation code:

wifi.init({
  iface: 'wlan0'
});

wifi.scan((error, discoveredNetworks) => {
  if (error) {
    console.log(error);
  } else {
    console.log(discoveredNetworks);
  }
}

The secondary throws the errorTypeError: Cannot read property 'replace' of undefined at /home/pi/*/node_modules/node-wifi/src/linux-scan.js:23:29. Line which caused the error: ssid: fields[1].replace(/\&\&/g, ':'),.

Output of command nmcli -v:

nmcli tool, version 1.6.2

Output of command nmcli (I am only showing headers here):

eth0: connected to Wired connection 1
wlan0: disconnected
lo: unmanged
IncognitoCore commented 6 years ago

Not forcing 'wlan0' as iface to use solved the issue.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.