Open sushihangover opened 5 years ago
Are you using 10.15 beta?
I found a post about CoreWLAN that in 10.15 the BSSID returns nil somehow.
@sushihangover I updated the README about this. I did some research on this, seemed from 10.15 apple becomes more strict on privacy so BSSID become not something you can ask for free :(
I am little bit confused if there is workaround for this. I am running Catalina, successfully build project and signed locally as stated in the README:
codesign --force --sign - --entitlements bssid.entitlements --timestamp=none ./.build/x86_64-apple-macosx/debug/bssid
it doesn't work. All channels shows empty BSSID.
Is there some workaround for this? It is not clear for me from these comments above.
@bmansvk As mentioned in README, even signing the app does not work.
A work around for 10.15 is scan and connect via channel number
bssid connect --ssid <ssid> --channel <channelNumber>
Yes I tried this.
Scanned for channel number
No SSID specified, scanning all
ssid: Anicka, bssid: , channel: 10, dBm 0
ssid: sedros.sx, bssid: , channel: 11, dBm -56
ssid: public.sedros.sx, bssid: , channel: 11, dBm -58
ssid: sedros.sx, bssid: , channel: 1, dBm -67
ssid: sedros.sx, bssid: , channel: 44, dBm -70
ssid: public.sedros.sx, bssid: , channel: 1, dBm -70
ssid: public.sedros.sx, bssid: , channel: 44, dBm -71
And tried to connect (also tried to remove saved SSID from network settings before connect):
% ./.build/x86_64-apple-macosx/debug/bssid connect --ssid public.sedros.sx --channel 44
Input WiFi password
Mac successfully connects to specified SSID but not channel 44, only 11 (which connect there by default, chan 11 has better signal than 44). There are same SSIDs on channel 44 with different BSSIDs (multiple APs on channel 44 with same SSID)
It seems that still doesn't work for me. I thought this is because missing BSSID in "scan command".
@bmansvk As mentioned in README, even signing the app does not work.
A work around for 10.15 is scan and connect via channel number
bssid connect --ssid <ssid> --channel <channelNumber>
@bmansvk
Thanks for reporting. I sometimes can reproduce the problem but not every time. Looks like macOS has some other logic to select Wifi even for specified network (ssid and channel in this case). I'll need some further investigation.
Same here on 10.15.5
it's be a dirty hack, but you could use airport -s
and scrape bssids from there in 10.15:
Hi guys, thanks for the comment,
@bmansvk
after I tested this API in some of my friends' places, office... I can only say the behavior is unpredictable.
try interface.associate(to: network, password: password)
When loop to this line, the network for sure is the correct one, but sometime the OS decides to connect to one with strongest signal
Is the app sandboxed? I got my networks to return their bssids by enabling the Outgoing Connections (Client) capability in the App Sandbox section.
@Aklaran Is it a different app or this one? I tried to test it and it returns illegal instruction after enabling sandbox
@braineo This is just in a minimal test app that I spun up, I haven't tried it in this one
@Aklaran Thanks! Seems command line application is not treated equally with an App, I would need to have a pseudo to hold this command line.
@braineo
As a python script kiddie I don't know much of anything - but would this help with pulling BSID on 10.15+ ?
It's saying to enable CoreLocations prior to checking networks
@braineo
As a python script kiddie I don't know much of anything - but would this help with pulling BSID on 10.15+ ?
It's saying to enable CoreLocations prior to checking networks
I've tried this one in another branch, although I made it asking you permissions for location, it still does not work.
The explanation of inheriting sand box from parent Application seems promising, going to try it later
try interface.associate(to: network, password: password)
When loop to this line, the network for sure is the correct one, but sometime the OS decides to connect to one with strongest signal
I'm having the exact problem
This might be fixed in MacOS 13. In Python I am able to get the BSSID using CoreWLAN after granting location services permissions to Python itself. This same approach was not working for Python in earlier version of MacOS.
See this thread for more details: https://github.com/ronaldoussoren/pyobjc/issues/484
Been playing with the Swift code, but I am having trouble getting generate the request for permissions.
Same here, scan shows all blank info (even scanning with sudo
), and connecting via ssid + channel always shows Cannot find specified access point
. Unfortunately this utility and other methods like Apple's airport
utility all fail to let the user do the most basic Fn thing, to be able to connect to a specific BSSID, something which is important in many scenarios such as having to use networks set up by complete morons with multiple AP's with identical names serving different blocks of unbridged IP's. It's Apple's fault, they assume we're all morons who don't need to do things we clearly need to do, because they know better. I'm going to need to start traveling with a Linux machine in addition to or instead of the Mac laptop so I can actually do things without Apple telling me I'm an idiot for needing to do it.
All the returned BSSIDs are null, thus it can not connect to one when supplied (via airport scan)
./.build/x86_64-apple-macosx/debug/bssid scan