Skip to content

Instantly share code, notes, and snippets.

@Jotschi
Created September 12, 2016 06:44
Show Gist options
  • Save Jotschi/d802da1ac268be8e8d08abc188c60e1f to your computer and use it in GitHub Desktop.
Save Jotschi/d802da1ac268be8e8d08abc188c60e1f to your computer and use it in GitHub Desktop.
esp-change-mac.c
extern "C" {
#include "user_interface.h"
}
// Change MAC
byte *mac = (byte*)malloc(6);
WiFi.macAddress(mac);
mac[0] = 0x20;
mac[1] = 0x11;
mac[2] = 0xCA;
mac[3] = 0xCA;
mac[4] = 0xCA;
mac[5] = 0xCA;
wifi_set_macaddr(STATION_IF, mac);
free(mac);
WiFi.mode(WIFI_STA);
WiFi.hostname("lamp");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment