{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/3024","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/3024/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/3024/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/3024/events","html_url":"https://github.com/esp8266/Arduino/issues/3024","id":211947842,"number":3024,"title":"Mac address change with initVariant() lost after ESP.restart()","user":{"login":"torntrousers","id":12925578,"avatar_url":"https://avatars0.githubusercontent.com/u/12925578?v=4","gravatar_id":"","url":"https://api.github.com/users/torntrousers","html_url":"https://github.com/torntrousers","followers_url":"https://api.github.com/users/torntrousers/followers","following_url":"https://api.github.com/users/torntrousers/following{/other_user}","gists_url":"https://api.github.com/users/torntrousers/gists{/gist_id}","starred_url":"https://api.github.com/users/torntrousers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torntrousers/subscriptions","organizations_url":"https://api.github.com/users/torntrousers/orgs","repos_url":"https://api.github.com/users/torntrousers/repos","events_url":"https://api.github.com/users/torntrousers/events{/privacy}","received_events_url":"https://api.github.com/users/torntrousers/received_events","type":"User","site_admin":false},"labels":[{"id":332802539,"url":"https://api.github.com/repos/esp8266/Arduino/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-05T11:53:56Z","updated_at":"2018-04-09T22:50:47Z","closed_at":"2017-10-10T06:31:59Z","author_association":"NONE","body":"I need to change the AP mac address so use the approach from  #1221:\r\n\r\n```\r\nextern \"C\" {\r\n  #include \"user_interface.h\"\r\n}\r\nvoid initVariant() {\r\n  uint8_t mac[] = {0x36, 0x12, 0x34, 0x56, 0x78, 0xAB};\r\n  wifi_set_macaddr(SOFTAP_IF, &mac[0]);\r\n}\r\n```\r\nAnd that works fine, however then doing an ESP.restart() and that mac change is forgotten and it reverts back to the default mac address.\r\n\r\nIs there some way to get that initVariant() code to run on the restart too?\r\n\r\n(I'm using the latest Github code)"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/379918092","html_url":"https://github.com/esp8266/Arduino/issues/3024#issuecomment-379918092","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/3024","id":379918092,"user":{"login":"torntrousers","id":12925578,"avatar_url":"https://avatars0.githubusercontent.com/u/12925578?v=4","gravatar_id":"","url":"https://api.github.com/users/torntrousers","html_url":"https://github.com/torntrousers","followers_url":"https://api.github.com/users/torntrousers/followers","following_url":"https://api.github.com/users/torntrousers/following{/other_user}","gists_url":"https://api.github.com/users/torntrousers/gists{/gist_id}","starred_url":"https://api.github.com/users/torntrousers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torntrousers/subscriptions","organizations_url":"https://api.github.com/users/torntrousers/orgs","repos_url":"https://api.github.com/users/torntrousers/repos","events_url":"https://api.github.com/users/torntrousers/events{/privacy}","received_events_url":"https://api.github.com/users/torntrousers/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T22:50:47Z","updated_at":"2018-04-09T22:50:47Z","author_association":"NONE","body":"This is still broken on the latest code in git. The comment above about  WiFi.macAddress(mac);\r\nWifi.softAPmacAddress(mac); is irrelevant as they get the mac not set it. See https://github.com/HarringayMakerSpace/ESP-Now/issues/5#issuecomment-379916598 but to sumarize that - a work around is to erase the entire flash and then include in the sketch a call to WiFi.persistent(false). "}}
{"actor":{"display_login":"torntrousers"}}