After you upload the firmware to your ESP32 can you make modifications to secrets.yaml?

HI,

Reasonably new to ESPHome and have flashed two ESP32 units when the devices were connected to a Guest Network using the main networks subnet (192.168.9.x)

I have now added an IoT VLAN (Asus Router) with a different subnet for IoT devices than the primary subnet.

My previous secrets.yaml looks like this:

# Your Wi-Fi SSID and Password
wifi_ssid: "xxxxxxxx"
wifi_password: "pppppppp"
gateway: 192.168.9.1
subnet: 255.255.255.0
wifi_ap_password: "apapapapapapap"
encryption_key: "lotsof hieropglyphics"
ota_password: "moremenainglessnumbers"

As title, the question is simply after you upload the firmware can you make modifications to secrets.yaml that will allow you to change these details (i.e. does the firmware ā€˜reference’ secrets.yaml) or does the information in secrets.yaml get hard coded into the firmware binary?

If the former, all other SSID and PWDs being the same for the new IoT Subnet then would I be correct that I should be able to simply change gateway: 192.168.9.1 to gateway: 192.168.53.1 (the new subnet is 53); and if the latter I will need to change secrets.yaml to the IoT VLAN gateway (is that correct?) and redo the ā€œInstallā€.

thank you!

k.

No - these are part of the compiled code. If you change them, you need to compile again.

Thank you, much appreciated.

Assuming the Router assigns IP Addresses via DHCP for the IoT Network, am I correct that the revised Gateway in the secrets.yaml for my case is 192.168.53.1?

Or leave out the gateway - DHCP should supply that as well. It should only be needed if you have static IP addresses in your yaml.

1 Like