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.
As I said, *if* he was able to ping the device, then that pinging action would enter its MAC details into the "arp cache table" with the relevant MAC address mapped to that specific IP address.
OP clearly does not acknowledge this fact or your suggestions for that matter!
Cheers
I don't know how to ping when the Pico is connected to my Android phone's hotspot.
On my phone I see that I am connected to one device so I know the connection has been established.
At the same time, I see all available Wi-Fi networks on the serial monitor.
I've tried several libraries, but I can't get the following part to work. Keep getting all kinds of errors.
byte mac[6];
WiFi.macAddress(mac);
printMacAddress(mac);
I have tryed <WiFi.h> <ESP8266WiFi.h> <WiFi101> <WiFiNINA>
I had a psychic girlfriend but she left me before we met.
Thanks for your suggestion.
I tryed to understand the document but it is mostly python en a few pages SDK.
I have searched it several times but to me they both are abracadabra. I only know a bit of Arduino C and... I am allready connected to internet with the Pico W. For a specific program I only need to know the MAC and that drives me to crazy :C
Please keep in mind, My knowledge is limited, at my age it is not easy to learn new computer languages and English is not my native so I do not understand everything I read on internet.
@frits1956 I just hooked up my PICOW and here is the result. Pics show PICOW connected with sketch in the backgtound, My MAC from my router admin page, BSSID (MAC) from the sketch output, the board selection, and the sketch from File/Exampls/WiFi/ScanNetworks
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
@zander Ron, I have seen the same result but is the mac address shown from your router or from your Pi. I think from your router because all the networks availlable shows different mac addresses.
Second reason I believe it is from your router because when I put the address in the mac filter table the application still can not get a connection. I know for sure the SSID and password are oke because I use a library with these credentials and other boards (Wemos D1 for instance) with this application connect without any problems.
@frits1956 Sorry, you are right. Add the following code to just after the delay(5000) in the main loop
byte mac[6]; WiFi.macAddress(mac); Serial.print("MAC: "); printMacAddress(mac);
And then add the following to the very end of the file AFTER THE LAST }
void printMacAddress(byte mac[]) { for (int i = 5; i >= 0; i--) { if (mac[i] < 16) Serial.print("0"); Serial.print(mac[i], HEX); if (i > 0) Serial.print(":"); } Serial.println(); }
Now the output will look like in the picture, and your PICOW's MAC is the line labelled MAC, the first thing printed
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
@zander Ron, It took a while, meshed up (is this the expression?) the ino file so had to search for a virgin one but now we are getting somewhere. I found a Mac adres ...... Thanx!!!!
My head is exploding (have been searching for 6 hours) and I am going to sleep now.
Tomorrow with a brisk feeling I will start again and post the result here.
Thanks for your patience and help.
Today I tried for more than 5 hours to connect the Pi Pico to the router through the application.
Assuming that the MAC address found yesterday is correct, the checked application with a Wemos D1 R1 and a Wemos D1 R2 both are functioning perfect, I have to conclude that for me there is an insurmountable problem at the moment. I'll put it on hold for now.
Maybe in the future, who knows.........
@frits1956 What is 'the application'. What do you mean by 'connect the Pi Pico to the router'
Why is a MAC involved?
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
@frits1956 Try to explain what it is you are trying to do as if you were telling a 10 yr old. NO technical terms like MAC address.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
I myself wrote a program for a museum that needs an internet connection for time so a museum clock can work. The program works on a wemos and arduino with wifi for some years now.
The museum's internet has a specific protection called mac filtering.
Another programmer wrote a program for a Pi Pico to drive model trains. Now they want to use my clock program to drive a route.
The program works on the Pico W. without mac filtering, but I've been trying to connect to the museum's router for a week. For some reason I can't. It's frustrating.....
@frits1956 Ok, I think I understand enough now to say I think you have 2 separate issues. The first is will the PICOW actually work as intended. The way to test that is to 'connect' it to something like your home router. That eliminates the MAC filtering issue. If it works on some unprotected router then we know the issue is in the MAC filtering, if it doesn't work on a normal router then the new 'train' software is the problem. Give that a try and let us know. I strongly suspect the software on the PICOW is at fault since MAC filtering is fairly trivial.
Do you understand what I am suggesting?
EDIT Oops, I see you already did that test. If the PICOW works on a normal router then the protected router is doing something more than just MAC filtering, OR the router/PICOW connection is substantially different than the old clock.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
The program on a Wemos D1 R1, Wemos D1 R2 and on a FUNduino (a kind of uno with wifi) works fine with the filtering of the museum. Therefor it is so frustrating....
I stripped the test program down to just getting the time from the internet. The train program is not yet in it. So only connecting the pico W to the museum's router remains. This is the test program I use, only the dutch comments removed. I have tested all the commented libraries..........
//Libraries ----------------------------------------------- ---------
//#include <WiFi.h> // for WiFi shield
//#include <WiFi101.h> // for WiFi 101 shield or MKR1000
#include <ESP8266WiFi.h>// for Wemos D1 (= ESP8266 board)
#include<WiFiClient.h>
#include<WiFiServer.h>
#include<WiFiUdp.h>
#include<NTPClient.h>
#include <Netwerk_Telefoon.h> // Network Hotspot credentials
//#include <Netwerk_TO.h> // Network Museum credentials (checked over and over 🙁 )
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 7200, 60000);
void setup() {
Serial.begin(9600);
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED )
{ delay ( 500 );
serial.print( "." );
}
timeClient.begin();
}
void loop() {
timeClient.update();
Serial.println(timeClient.getFormattedTime());
delay(1000);
}
oeps. the library did not copy, I will add them
@frits1956 I am just trying the PICOW sample server sketch. Once I know it works you should try it as well. If it works on a 'normal' router, then try the protected router (after changing SSID and password of course) If it works as I suspect, then the problem is in the 'train' software.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting