Menu

How to handle Certificate and SPIFFS update

ChWuel
Joined
2021-01-17 09:32:53
Posts
26

How to handle Certificate and SPIFFS update

Hi All out there ... I'm still a newbe after three month, but got a few different ESP32 projects to run. As I haven't found sufficient enough information at the WIKI, Discord and from "Mrs Google", I'll try this new channel.

I have started quite well and running my Solartrol project, which I really need to update OTA and like the others to do as well. Just as I changed to use SPIFFS for hosting webserver files a month ago. Since then I'm getting a reply from the IoTAppStory server, that the cerificate is missing... and no updates. So I did the updates in the classical way through USB tll yesterday. Then I installed the basic sketch from Arduino IDE and updated with my project sketch - successfully. But again I can only update through the configuration mode andneed to update the certificate everytime.

I asume, that it is due to a full image update of SPIFFS every time and so overwriting the stored certificate with my new created files.

I'm using PlatformIO and created a cert folder under data, where I (today)stored a copy of the iasRootCa.cer file from GitHub (WebAppToggleBtn example). This still does not solve the problem.

PLEASE help me to understand (first of all) the issues and then give a (step wise explanation) helping hand.

THANKS in advance - I really like this platform !

PS: If you need further infromation, I'll try to deliver asap

 

 

Christiaan Broeders
Joined
2016-06-04 21:36:48
Posts
23

Hello ChWuel!

We recently had two other users contact us with the same problem.
Have not yet figured out why people are running into this now, as it used to work perfectly in the past and i dont recall any big changes in this part of the code.

While we (and by we i meen Onno) are looking into the issieu, may i suggest using the following workarround wich was posted in our discord

Schnueck — 03/10/2021
Hi Christiaan. I just tried to do exactly that: download the root certificate from GitHub. But it seems to be in a binary format, not in text format. That file works well for Windows (when double-clicking it, it shows all certificate information in the Windows certificate app), but when I put it into the "data/cert" folder and upload the SPIFFS image to my ESP32, it does not work. Something complained about wrong certificate format. Only when I copy/pase the certificate text code out of "/examples/Loaders/IASLoader/IASLoader.ino" lines 35 to 59 and remove all unnecessary characters (" \n ...) and put that into a file in cert folder it works.

Christiaan Broeders
Joined
2016-06-04 21:36:48
Posts
23

This bug has been found and is now fixed 😀