Go Down

Topic: Getting wifi mac address when scanning networks (Read 1 time) previous topic - next topic

newhobby

Is it possible to get mac addresses when scanning networks?
I was able to get ssid, signal strength and security using the sample code, but not mac addresses.
Google Maps geolocation API requires a json with mac addresses to be able to triangulate your location based on wifi networks instead of ip or cell towers.
I was able to get mac addresses using ESP8266, but not with MKR1000.

ballscrewbob

Are you using the MKR to scan networks to get other IP's and give those to the API or just wanting the MKR's to give to the API ?

Its been a while since I last played with the spare MKR but I seem to recall it was possible.

If I find the specific info I will put it up for you.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

newhobby

Getting Mkr mac address is easy.
I need the mac addresses of other AP's in the area.

ballscrewbob

OK I was correct.
Its an example sketch for the MKR1000.

The output is like this.
Code: [Select]

Scanning available networks...
** Scan Networks **
number of available networks: 3
1) Signal: -78 dBm Channel: 6 BSSID: 5E:CF:7F:F:03:47 Encryption: None SSID: AI-THINKER_0F0347
2) Signal: -68 dBm Channel: 6 BSSID: 1C:C6:3C:1A:EE:93 Encryption: WPA SSID: BOB01
3) Signal: -60 dBm Channel: 6 BSSID: 1E:C6:3C:1A:EE:94 Encryption: WPA SSID: BOB02



A copy is in your WiFi101 examples and here is also a copy I took from CREATE

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

newhobby

Thanks!!
I guess I have an older copy of the examples

sandeepmistry

Hi @newhobby,

What version of the WiFi101 library do you have installed?

newhobby

I should have the latest libraries, but since I download from github, I never copy the example folders to the arduino folder.
Well, I doesn't matter anyway. I got it working and geolocation using WiFi Mac address triangulation is pretty accurate.
Google was able to spot me inside the house :)
I now have mkr1000 getting lat and long from Google and sending to my server where I can use to plot a map :)

lord_newbie

Is it possible to get mac addresses when scanning networks?
I was able to get ssid, signal strength and security using the sample code, but not mac addresses.
Google Maps geolocation API requires a json with mac addresses to be able to triangulate your location based on wifi networks instead of ip or cell towers.
I was able to get mac addresses using ESP8266, but not with MKR1000.
Hey newhobby, how did you manage to do that with the esp8266, I have been trying to get the sketch for that. Your help would be appreciated. Thank you.

newhobby

I can't remember anymore, but google gave me this:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino

Go Up