friedrith / node-wifi

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

random error while scanning wifi networks #72

Closed bennymeg closed 5 years ago

bennymeg commented 5 years ago

Hi, I am trying to scan for all the available networks around me, unfortonetly, most of the times I receive the following error: "can't read property 'match' of undefined". Some of the times it works currectly.

Currently the only thing I do is setting the interface to null on the init() function (so the interface is selected randomly) and invoking the scan() function. wifi.init({ iface: null }); wifi.scan();

Any idea what might gone wrong?

bennymeg commented 5 years ago

OK, I managed to find and fix the bug. It seems that my network card sometimes return only part of the data you expect, and the code break when you try yo parse the data.

In example, it might return only those fields: [ 'SSID 1 : xxx', ' Network type : xxx, ' Authentication : xxx', ' Encryption : xxx ' ]

I fixed the issue and I will submit a PR soon. Benny.

friedrith commented 5 years ago

Fix included in version 2.0.7

friedrith commented 3 years ago

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