Notifications
Clear all

Need help with finding mac-adress of a Pico W using arduino IDE

Page 1 / 5

Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

my router needs a mac address for a wireless connection.
I write my programs in the arduino IDE but unfortunately I can't find any good code for getting that address anywhere.
Does anyone have a suggestion how to solve this problem?

Sorry for my bad english, it's not my native


Quote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 
Posted by: @frits1956

my router needs a mac address for a wireless connection.
I write my programs in the arduino IDE but unfortunately I can't find any good code for getting that address anywhere.
Does anyone have a suggestion how to solve this problem?

Sorry for my bad english, it's not my native

Google should find code easily, also is there not a sample sketch? ScanNetworks has it.

Screen Shot 2022 08 09 at 09.05.30

 

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

Ron, THANKS!!!!

I was for more then 3 days looking on internet for a file like this. I even asked on several forums but the answeres are mostly with python. Your answere did it. Many many thanks


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

Unfortunately, it turned out not to be the solution I thought.
This file gives the mac addresses of the access points and not of the Pico W.
Does anyone have a code to find out the mac address of the Pico W?

Thanks in advance


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 3 years ago
Posts: 1159
 

@frits1956

My PicoW is still on it's way to me, so it may be a short while before I can try to find its MAC address.

Maybe someone else can provide the solution for you in the mean time.

SteveG


Frits1956 liked
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 

@frits1956 Try ScanNetworksAdvanced, I think line 36 is where it prints your MAC.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 

@frits1956 The specific API is WiFi.macAddress(mac); That is how you retrieve the MAC address of the WiFi radio on the board. See the scan advanced for details.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

@zander first of all thanks for your help.

I have compiled the ino file and the result is the message "WiFi 101 Shield not present"
I understand from this message the file is intended for an arduino with a shield, but I would like to know the address of my RPi Pico W.

It could also be that I have the wrong ino file.
https://github.com/arduino-libraries/WiFi101/blob/master/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino
This file has on line 36 " // print your MAC address:"


ReplyQuote
frogandtoad
(@frogandtoad)
Noble Member
Joined: 3 years ago
Posts: 1387
 

@frits1956

Posted by: @frits1956

Unfortunately, it turned out not to be the solution I thought.
This file gives the mac addresses of the access points and not of the Pico W.
Does anyone have a code to find out the mac address of the Pico W?

Thanks in advance

Just a thought... if you know the IP address, all you have to do is ping the device, and then check the arp (address resolution protocol), cache from your command prompt.

Running "arp -a" will display the arp table with all the IP to MAC address mappings, which is available on Windows, Mac and Linux.

This can be a lot quicker than compiling and uploading scripts.

Cheers


Ron liked
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 

@frits1956 FORGET github and undo any 'stuff' you have done.

1. Have you installed the Pico and Pico W boards into preferences?

2. Do you understand about selecting your board using the board manager? Your errors look like you have the wrong board selected. See picture at end. Once you select the board then the built in examples will be populated with the sketches that work with that board ONLY. You just select the example from the file menu.

3. Now select the sample sketch as shown in the attached picture. That is from WiFi101.

4. I did the verify and you can see it worked and the code is also showig that will print your MAC. That is in the 3rd picture.

I don't have a PICOW with hdrs soldered on yet and I am too busy for the rest of the day so I can't help any more.

 

 

Screen Shot 2022 08 10 at 09.11.07
Screen Shot 2022 08 10 at 09.16.01
Screen Shot 2022 08 10 at 09.17.01

 

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

@frogandtoad Thanks for your idea. I'm going to look into how I can do that


ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 
Posted by: @frogandtoad

@frits1956

Posted by: @frits1956

Unfortunately, it turned out not to be the solution I thought.
This file gives the mac addresses of the access points and not of the Pico W.
Does anyone have a code to find out the mac address of the Pico W?

Thanks in advance

Just a thought... if you know the IP address, all you have to do is ping the device, and then check the arp (address resolution protocol), cache from your command prompt.

Running "arp -a" will display the arp table with all the IP to MAC address mappings, which is available on Windows, Mac and Linux.

This can be a lot quicker than compiling and uploading scripts.

Cheers

Of course now he will want to know how to find out his IP. 

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  

@zander 

Yes, I have already several programs that work fine on the pico and pico W. Also a self written program on the W that has a connection to a WiFi network. That's not the problem. I only miss the mac address of the pico W for a special application

 

By the way, it is not a error. Compile and upload works fine and line 29 (// check for the presence of the shield:) give the result "WiFi 101 Shield not present" on the monitor


ReplyQuote
Frits1956
(@frits1956)
Eminent Member
Joined: 2 years ago
Posts: 30
Topic starter  
Posted by: @zander
Posted by: @frogandtoad

@frits1956

Posted by: @frits1956

Unfortunately, it turned out not to be the solution I thought.
This file gives the mac addresses of the access points and not of the Pico W.
Does anyone have a code to find out the mac address of the Pico W?

Thanks in advance

Just a thought... if you know the IP address, all you have to do is ping the device, and then check the arp (address resolution protocol), cache from your command prompt.

Running "arp -a" will display the arp table with all the IP to MAC address mappings, which is available on Windows, Mac and Linux.

This can be a lot quicker than compiling and uploading scripts.

Cheers

Of course now he will want to know how to find out his IP. 

😀


ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3045
 

@frits1956 If you have a wifi pgm, then just add the call to print the mac, the code is where I told you and showed you, Good luck.

In case you forgot, HERE IS THE ANSWER

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Page 1 / 5