Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By xtal
#48056 If you are also writing the clients , get the mac and send to the mothership.....

If you are not involved in writing the client , then make it a condition for connecting,
No MAC -- No Connect, its your sandbox, you set your rules...

There possibly may be some TCPIP method of getting the MAC ?
User avatar
By pgScorpio
#48137
martinayotte wrote:@pgScorpio, your piece of code is returning the ESP MAC, not the client MAC ... :ugeek:

There is only one MAC per network interface, so one for AP and one for STA...
The client is on a port of either one if these interfaces. So how would the client have a different MAC ??
User avatar
By pgScorpio
#48178 OK, i think I misunderstood the question...
You want to know the MAC at the other side...
Unfortunately this should be known at the esp kernel, but it is not exposed AFAIK....
Any way, if there is any router between the client and the esp (and since we are on wifi , this will most probaly be the case) the 'known' MAC would be the MAC of the router the esp is connected to.
If you really want the mac of the interface at the client side you will have to communicate it in your own protocol between client and host.
User avatar
By dnc40085
#48223 I only have experience with NodeMCU, but I did find something that might help you accomplish your goals.
When I was exposing the SDK event monitor (see function wifi_set_event_handler_cb in SDK programming guide), I found that the event "EVENT_SOFTAPMODE_STACONNECTED" returns the mac address of the connecting station which you could deauth with the unlisted function "bool wifi_softap_deauth(uint8 mac[6])".

Here are the links to my implementation if it helps, wifi eventmon and wifi deauth