axcap / Esp-GitHub-OTA

Arduino OTA updater that uses Github releases as storage
13 stars 8 forks source link

Parametric firmware name #8

Closed lollobaldo closed 1 year ago

lollobaldo commented 1 year ago

Hi, just some thoughts here. I have different ESPs, and need them to update with different firmware name. The change is quite straight forward, but I've done it just right before your new release, and I cannot rebase right now (just don't have time atm). But pls have a look and copy it if you think it'd be interesting to add

axcap commented 1 year ago

Hi, i skimmed through the code and it looks fairly easy to integrate. Should get the time to do it next week. Great work on reducing memory footprint!

Help me better understand the use case. Are you having multiple ESPs (potentially mix of 32s and 8266s) share the same source code (one github repo) and you want them to only pull the firmware binary compiled for the right chip?

lollobaldo commented 1 year ago

Yes exactly, a few ESP32/8266, all sharing the same repo, but not necessarily the same code (most of the code is shared, but they might have e.g. different sensors, have a look at this workflow https://github.com/lollobaldo/smarthome-nodeMCUs/actions/runs/5391929952 )

axcap commented 1 year ago

It should be possible with the new version of the library. The GitHubOTA class takes firmware_name as one of the paramethers and you should be able to use a define here, just like you did in otaHandler.cpp:13.

I finally got the time to merge the PR. Please take a look, perhaps i missed something. I kept the FS ota updates for now, but will have to find a better way to opt out of this functionality for those who does not use it to save resources.

I also noticed that my commits somehow got mixed into your forked repo, not sure how thats works and if thats intentional. Perhaps you want to compare remote with your local copy before pulling.

lollobaldo commented 1 year ago

Hey, just realised ESP32 was breaking, I added some commits in my repo to fix it (wifi library doesn't support MFLN I think), as well as a different way to pull last error. It's only a few lines change in this commit

Unfortunately, turning off the FS update is important for me as I don't publish it (and it breaks if it doesn't find one)