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

Unable to detect SSID after update to MacOS Sonoma 14.4 (23E214)

Open akanksha-atrey opened this issue 1 year ago • 7 comments

Expected behavior

The package was detecting networks as expected.

Current behavior

After updating to MacOS Sonoma 14.4, the package is not detecting any networks.

Which are the affected features

  • [X] node API
  • [ ] CLI

Which is your operating system?

MacOS

Environment

MacOS Sonoma 14.4 (23E214)

Version of node-wifi

2.0.16

Steps to Reproduce

try {
    await wifi.init({ iface: null });
    const networks = await wifi.scan();

    console.log(`Found the following SSIDs: ${networks}`)

    return networks;
} catch (error) {
    console.error('Error scanning networks:', error);
}

Solutions

Is this a bug or a local issue?

akanksha-atrey avatar Mar 29 '24 18:03 akanksha-atrey

The same problem occurred. This is caused by the airport command used by node-wifi being deprecated in MacOS Sonoma. https://github.com/friedrith/node-wifi/blob/1a4364e67c9789555a00656d35287f0cebb3add8/src/macOS/scan/command.js#L2

iogi avatar Apr 18 '24 02:04 iogi

Yes, I realized that. I figured out a hack using pyobjc modules for CoreWLAN/CoreLocation. Not a pretty way of doing it, but does the job for the time being.

akanksha-atrey avatar Apr 18 '24 13:04 akanksha-atrey

I did some research at lunch and found a hint here: https://github.com/friedrith/node-wifi/issues/195#issuecomment-2063874988

Then I found this: https://stackoverflow.com/questions/78153143/assistance-in-extracting-fields-and-formatting-using-pyobjc-and-corewlan

Maybe there is a way to use this here?

shaguarger avatar Apr 25 '24 12:04 shaguarger

I just wanted to chime in and mention that I am also experiencing this issue on my end. After updating to MacOS Sonoma 14.4 (23E214), my system is unable to detect the SSID. Any insights or workarounds would be greatly appreciated.

aljaramillo avatar Jun 11 '24 09:06 aljaramillo

Obviously trickier but I managed to work around this by writing a native module that calls this method https://developer.apple.com/documentation/corewlan/cwinterface/scanfornetworks(withssid:)?language=objc

It's blocking so be sure to wrap it in a promise/callback, I used a Napi::Promise

deanylev avatar Oct 14 '24 03:10 deanylev

Yes, I realized that. I figured out a hack using pyobjc modules for CoreWLAN/CoreLocation. Not a pretty way of doing it, but does the job for the time being.

how to do?

vuvivian avatar Nov 07 '24 09:11 vuvivian

FYI: There is a way with system profiler. We did a PR in another repo.

https://github.com/sebhildebrandt/systeminformation/pull/937

shaguarger avatar Nov 07 '24 10:11 shaguarger