Notifications
Clear all

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

64 Posts
5 Users
9 Likes
2,110 Views
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3416
 
Posted by: @frits1956

@frogandtoad

My problem is completely solved with your directions and I'm glad you wrote the linux solution also.

The new question, that has now become visible, is why your method gives a correct mac address and @Zander's normally working method does not. Rob and I are curious about that. Is there a library cause or is there something else because it seems to occur only with picoW .....

I failed to notice the print code for the MAC was backwards, have a look at the MAC I gave you but reverse it, should be the same as what you got via the ping/arp method.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


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

@frogandtoad Sorry, I assumed that you did it without any sketch loaded since if you did, why bother with the arp when you could just get the mac in the sketch. I suspect your answer will be similar to you already had a piece of server code that displayed the IP available and it was quicker to follow that with the arp than to write the get mac decode mac code.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


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

@zander Yes you did. I have adjusted the void.

@zander @frogandtoad Gentlemen I learned a lot. THANKS!!!

void printMacAddress(byte mac[])
{  for (int i = 0; i <= 5; i++)
     { if (i > 0) 
           Serial.print(":");
        if (mac[i] < 16)
            Serial.print("0");
        Serial.print(mac[i], HEX); 
     } 
     Serial.println();
 }

 


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

@zander

Posted by: @zander

@frogandtoad Sorry, I assumed that you did it without any sketch loaded since if you did, why bother with the arp when you could just get the mac in the sketch. I suspect your answer will be similar to you already had a piece of server code that displayed the IP available and it was quicker to follow that with the arp than to write the get mac decode mac code.

🙂

You suspect correctly!
Why load a sketch to get the MAC details already available if you know the IP address?

That was the whole point of my initial response.

Cheers


   
Ron reacted
ReplyQuote
Page 5 / 5