Changing MAC Address
Posted: Sat Dec 10, 2016 9:19 am
Connecting to the WiFi in my college is very limited, it's actually bound to MAC address.
That's why I want to change the ESP8266 MAC address to eg. my phone address. ( I know, it can conflict if I want to connect both esp8266 & phone, but just forget about this case, I won't use both of them )
So, I've seen this API:
So I just made my quick code:
But even after this the device seems to have the same MAC address as before:
http://i.imgur.com/xekXjBF.png
Could anyone tell me where did I fail, or what should I do to make it work?
That's why I want to change the ESP8266 MAC address to eg. my phone address. ( I know, it can conflict if I want to connect both esp8266 & phone, but just forget about this case, I won't use both of them )
So, I've seen this API:
Code: Select all
wifi_set_macaddr( ... )
So I just made my quick code:
Code: Select all
void setup()
{
Serial.begin(115200);
Serial.print("Connecting to ");
Serial.println(ssid);
uint8_t mac[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 };
bool a = wifi_set_macaddr(SOFTAP_IF, &mac[0]);
WiFi.mode(WIFI_AP_STA);
WiFi.hostname("ESP8266 Test Device");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
But even after this the device seems to have the same MAC address as before:
http://i.imgur.com/xekXjBF.png
Could anyone tell me where did I fail, or what should I do to make it work?