How to Update framework via git repo on an ESP8266?

Hello,

I want to update my ESP via Git repo with HttpUpdate. But I don’t how.

I know that PlatformIO have documentation for ESP32 about BinTray, it can be adapte to an ESP8266 (I think). But I want a private solution, because BinTray, his free plan, only offer public repo.

Any idea?

Edit: must be using a password.

Simplest thing then is probably to have a version file on github, and if the version doesn’t match the version on your ESP8266, download the latest release binary, or a binary you’re storing in the repo.

Well is something, but the repo must be public, I need that be private, accessing by password. Is for security reasons.

What makes you say the repo needs to be public? Both github and gitlab have the option for private repos.

So, if you want to use HttpUpdate, you will need to follow the documentation for that function, which tells you that you need to have a web server that can service the version check request and provide the necessary reponse - whether it be ‘no update for you’ or ‘here is your update’, etc. There is currently no facility for password authentication in ESPhttpUpdate, but there will be once if/when this PR makes it into the ESP8266 Arduino core.

Anybody can download my code, but my code has wifi, mqtt and server settings, this can be a problem if somebody download the code and copy the device, sending fake data to the server.

I read here the HTTPclient have authentication, maybe I can use that…

Thanks.

1 Like

Why not have the WiFi/MQTT/server/passwords/etc in a separate file, that is not tracked in the git repo. This is one of the reasons .gitignore exists - so you can protect secrets.

So are you saying the git repo should be public, so that people can see/use the code, but the update mechanism should be secure?

1 Like

But all the code in compile in one file firmeware.bin. Or you refer something like have a file inside the ESP and access it, for example, by FS library?

No, I mean… I don’t speak English very well and sorry if there is a misunderstanding.
All the files need to be private and updates must secure. The repo is if I have a team, only members have access to it.

1 Like

No need to aplogise, I’m sure any attempt I made at writing in your native tongue via Google Translate would be bad! This is why I wanted to clarify public / private, as your last reply had confused me.

So, as before, use a PRIVATE github repo, not a public one. Therefore only people with a login can download your code.

Using the EEPROM library, or a FS file, is also another option, which means the device itself is what has the secrets for WIFI/MQTT/Updates/etc. A library like WifiManager can make it so you even have web browser interface to configure this.

1 Like

thanks for your help, I already think I have an idea of what I should do.

1 Like