# Obtaining BSSID

**URL:** <https://community.particle.io/t/obtaining-bssid/19117>\
**Category:** General\
**Created:** [January 15, 2016, 1:39pm UTC](https://community.particle.io/t/obtaining-bssid/19117 "2016-01-15T13:39:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindseed](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@blindseed](https://community.particle.io/u/blindseed)\
**Post date:** [January 15, 2016, 1:39pm UTC](https://community.particle.io/t/obtaining-bssid/19117/1 "2016-01-15T13:39:19Z")

</div>

Hi all

i’ve been playing around with the photon and am finding it very interesting.  
i’ve been looking around and am finding libraries related to scanning the surrounding network and the getting the BSSID.  
however, i’m just trying to obtain information of my connected WiFi network and was wondering if there was any way to obtain the BSSID of the connected SSID.

thanks lots

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [January 16, 2016, 1:25am UTC](https://community.particle.io/t/obtaining-bssid/19117/2 "2016-01-16T01:25:34Z")

</div>

You can use [WiFi.scan()](https://docs.particle.io/reference/firmware/photon/#wifi-scan-), filter the results by matching the SSID of each result with the current SSID (which you get via WiFi.SSID()). The WiFiAccessPoint class includes a `bssid` field which contains the BSSID as 6 bytes.

---

<div class="post-metadata">

**Author:** ![blindseed](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@blindseed](https://community.particle.io/u/blindseed)\
**Post date:** [January 16, 2016, 1:45pm UTC](https://community.particle.io/t/obtaining-bssid/19117/3 "2016-01-16T13:45:21Z")

</div>

thats great thanks!  
was just surprised that this wasn’t exposed as a method.  
to have to scan again just to obtain the BSSID seems to be a little inefficient in terms of power.  
is there any information on whats the power “cost” of calling WiFi.scan() each time?

thanks lots

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [January 16, 2016, 6:32pm UTC](https://community.particle.io/t/obtaining-bssid/19117/4 "2016-01-16T18:32:01Z")

</div>

Yes, it’s not the most efficient way, but I figured it would at least get you what you were looking for with the tools available now until we have something more direct.

I’ll add a WiFi.BSSID() function to the backlog for inclusion in a future release.

What’s your use case? Are you building a battery powered product that’s connecting to many different networks?

---

<div class="post-metadata">

**Author:** ![blindseed](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@blindseed](https://community.particle.io/u/blindseed)\
**Post date:** [January 17, 2016, 1:11am UTC](https://community.particle.io/t/obtaining-bssid/19117/5 "2016-01-17T01:11:35Z")

</div>

Hi there

Yes. I’m building a battery powered product that needs only to report the BSSID it’s connected to via multiple networks. Which is why to scan for the same SSID again can be a hit and miss. It’ll really be great if that could be retrieved just like the other wifi parameters.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [August 5, 2016, 1:25pm UTC](https://community.particle.io/t/obtaining-bssid/19117/7 "2016-08-05T13:25:09Z")

</div>

Hi @tomkut

The WiFi.BSSID() method is doc’ed and works now–it tells you the BSSID (MAC address) of the access point you are connected to.

There is no equivalent in the WiFi.scan() results for APs that you are **not** connected to that I am aware of.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 8, 2016, 5:23pm UTC](https://community.particle.io/t/obtaining-bssid/19117/8 "2016-08-08T17:23:47Z")

</div>

I think the WiFiAccessPoint struct has a “bssid” member which I’m guessing should be populated. If not then we should definitely file a firmware bug, since this is like 90% of why I’d scan the networks around me. 🙂

Thanks!  
David
