Change ESP8266 esp_init_data_default values on build


I am having trouble finding out how to change the esp_init_data_default.bin for my ESP8266 build without manually doing it, which causing hash mismatch issues. I would like to be able to change values here prebuild in my mos.yml file.

  1. Change the default value of the 34th byte (TPW value) of the esp_init_data_default.bin file to a higher number, 82 = (20.5dbm)
  2. I tried looking for documentation on how to do this with the YAML build file, but could not find any reference.
  3. After the build, I would like to see the esp_init_data_default.bin file 34th byte to be 0x52, the maximum allowed by the SDK, instead of 0x4E which seems to be the default value.

Any help would be appreciated. Thank you.


If that can be changed in the IDF sdkconfig file, you can do it with this incantation:

Unfortunately I don’t know what TPW means.


It comes from the function system_phy_set_max_tpw, Transmission PoWer (TPW) which is an ESP8266 function to set this value while dynamically, but I just would like it this way all the time.

I am having no luck finding any ESP8266 build variables, only ESP32 variables from this link provided. I appreciate the help though. Thank you.


Yeap, my mistake, I was in ESP32 mode…
The ESP8266 IDF documentation is “not so clear”, search for the non-OS SDK. It doesn’t seem to use sdkconfig so I guess my post is useless to you.


I appreciate the help, my extreme frustration is the fact I cannot change any of the parameters in the .bin file at all. Is there a way to do this? Every time I modify the esp_init_data_default_v08.bin, located in the deps folder, nothing changes in the actual .zip that is created. For now, I will just create the build, unzip, change the bin file in there, change the manifest hash, and then zip again.


I’m not into those low-level arts in mOS. I read somewhere in this forum about one or maybe two guys doing some manual generation of the firmware files with custom content, maybe that helps you.
Perhaps there is some other way to do what you need, I just don’t know. I bet the bin that goes to the zip is generated by the compiler, not read from deps.