Skip to content

How to build firmware for different hardware versions for the same CPU platform? #162

Closed

Description

The build workflow produces binaries that are named {name}-{platform}.factory.bin

Where {name} is the name as configured in the ESPHome configuration YAML:

esphome:
  name: my-device

and {platform} the CPU platform, ESP8266, ESP32, ESPC3 etc

When using different hardware versions one might want to create a firmware version for that specific hardware version. However since both hardware versions use the same CPU platform its not possible to create separate binaries for each hardware version.

Activity

  1. mikelawrence commented on Apr 29, 2026

    @mikelawrence

    Don't you need a new configuration YAML file for each hardware version and can't you just use a new name?

    I used separate config files for two different PCB revisions of a sensor and my binaries looked like:

    sensor-rev-a-esp32s3.factory.bin
    sensor-rev-b-esp32s3.factory.bin
    

    Maybe I don't understand...

  2. rrooggiieerr commented on Apr 29, 2026

    @rrooggiieerr
    Author

    Unfortunately some revisions of the hardware uses different components so I need separate configuration files.

    I want the binaries named exactly as you say. How did you achieve this? For me both binaries are named my-device-esp32c3.factory.bin and thus the compile of the second config file over writes the binary of the first compile

  3. mikelawrence commented on Apr 29, 2026

    @mikelawrence

    Have at look at ESPHome example repo. The publish-firmware workflow builds multiple config files. I based my setup on this example.

    To answer your question, I changed the name in each config file (just an example below).

    1st config file

    esphome:
      name: "sensor-rev-a"

    2nd config file

    esphome:
      name: "sensor-rev-b"

    If you want to see my setup have a look at my repo

    All of this is for publishing on GitHub.

  4. rrooggiieerr commented on Apr 30, 2026

    @rrooggiieerr
    Author

    Thanks for figuring that out! Unfortunately that also means the hostnames will be different depending on the hardware.

    I'm developing an component that can be installed on off the shelf ESP boards and some of these boards need different configurations. For instance on board has a nor mal status LED, while others have an RGB LED. This needs to be configured differently in the YAML. Or some sensors need a different way GPIO.

    I named my YAMLs <project>-<board>-<sensor>.yaml and <project>-<board>-<sensor>.factory.yaml and I'dd like to have the firmware bins to follow the same naming scheme.

    The name is also only allowed to be 24 characters long, so I would need to use abbreviations for board and sensor to fit within that size.

    So there is no way to configure the name of the resulting bin? I am able to set the build path for each config file, but that doesn't solve the problem of the bin files being the same name and being over written when the compiled bin file is copied to GitHun pages

  5. rrooggiieerr commented on Apr 30, 2026

    @rrooggiieerr
    Author

    Big Mike (@mikelawrence) Don't you have the same problem with for instance rev-b-pkg-a-c4001-esp32-s3.yaml and rev-b-pkg-a-ld2450-esp32-s3.yaml having the same name but different configurations?

  6. rrooggiieerr commented on Apr 30, 2026

    @rrooggiieerr
    Author

    Ah, it appears you overwrite the name in the factory.yaml

  7. mikelawrence commented on May 3, 2026

    @mikelawrence

    Yes. Is it working for you now?

  8. rrooggiieerr commented on May 3, 2026

    @rrooggiieerr
    Author

    Not really the way I'd like. Each board/sensor combo gets a different name while I would prefer it to have the same name.

  9. mikelawrence commented on May 4, 2026

    @mikelawrence

    Well I could have read all your messages. The crux of your problem is you want the same ESPHome name but a different filename for each config file beyond a different platform. You are right, this is not possible with the current workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions