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

Moderator: igrr

User avatar
By diffstorm
#67825 Hi All,

The following code does not work properly, so STA MAC is not changing, it stays as it is.

I call it after setup of WiFi.mode to WIFI_AP_STA.

Code: Select allshort id = 0xAA55;
    mac[0] = 1 + (chip_id >> 24) & 0xff;
    mac[1] = (chip_id >> 16) & 0xff;
    mac[2] = (chip_id >> 8) & 0xff;
    mac[3] = chip_id & 0xff;
    mac[4] = highByte(id);
    mac[5] = lowByte(id);

    ret = wifi_set_macaddr(STATION_IF, mac);
    yield();
   


Please help.
Another question, is it possible AP and STA macs can be same?

Thanks.
User avatar
By diffstorm
#67848 Any help will be appreciated.

I have tried to use it in user_init function, in Arduino I used the early_init function which is in user_init.
It still does not change, I cannot change STA MAC.
Code: Select allextern void early_init();

  void early_init(void) {
      // all the existing code
      WiFi.mode(WIFI_AP_STA);
      MAC_Write(44);
  }


Please help if there is any way.

Thanks
User avatar
By diffstorm
#67862 Hi, Thanks for the answer.

I could not find where is the InitVariant function called in the example code.

So, what is InitVariant?
If it is called in user_init or similar place, I need to read a file to get an ID before setting MAC address.
Is it possible in this setup?

Thanks.