Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the returned BSSIDs are null #1

Open
sushihangover opened this issue Aug 23, 2019 · 18 comments
Open

All the returned BSSIDs are null #1

sushihangover opened this issue Aug 23, 2019 · 18 comments

Comments

@sushihangover
Copy link

sushihangover commented Aug 23, 2019

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

ssid: AndroidRepeater, bssid: , channel: 2, dBm -24
ssid: XFINITY, bssid: , channel: 149, dBm -86
ssid: xfinitywifi, bssid: , channel: 149, dBm -86
ssid: iPhone, bssid: , channel: 11, dBm -87
ssid: CableWiFi, bssid: , channel: 149, dBm -87

@braineo
Copy link
Owner

braineo commented Aug 24, 2019

Are you using 10.15 beta?

I found a post about CoreWLAN that in 10.15 the BSSID returns nil somehow.

https://forums.developer.apple.com/thread/119490

@braineo
Copy link
Owner

braineo commented Nov 11, 2019

@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 :(

@bmansvk
Copy link

bmansvk commented Jul 1, 2020

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.

@braineo
Copy link
Owner

braineo commented Jul 1, 2020

@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
Copy link

bmansvk commented Jul 1, 2020

Yes I tried this.

  1. 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
  1. 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>

@braineo
Copy link
Owner

braineo commented Jul 22, 2020

@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.

@nagualcode
Copy link

Same here on 10.15.5

@mtrpires
Copy link

it's be a dirty hack, but you could use airport -s and scrape bssids from there in 10.15:

Screen Shot 2020-09-10 at 20 16 44

@braineo
Copy link
Owner

braineo commented Nov 1, 2020

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

@Aklaran
Copy link

Aklaran commented Nov 16, 2020

Is the app sandboxed? I got my networks to return their bssids by enabling the Outgoing Connections (Client) capability in the App Sandbox section.

@braineo
Copy link
Owner

braineo commented Nov 20, 2020

@Aklaran Is it a different app or this one? I tried to test it and it returns illegal instruction after enabling sandbox

@Aklaran
Copy link

Aklaran commented Nov 20, 2020

@braineo This is just in a minimal test app that I spun up, I haven't tried it in this one

@braineo
Copy link
Owner

braineo commented Nov 20, 2020

@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.

@Rukongai
Copy link

@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

https://developer.apple.com/forums/thread/131636

@braineo
Copy link
Owner

braineo commented Dec 24, 2020

@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

https://developer.apple.com/forums/thread/131636

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

@vkedwardli
Copy link

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

@thewade
Copy link

thewade commented Mar 8, 2023

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:
ronaldoussoren/pyobjc#484

Been playing with the Swift code, but I am having trouble getting generate the request for permissions.

@edrozenberg
Copy link

edrozenberg commented Jan 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants