Menu

Device is not getting SPIFFS updates

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

Device is not getting SPIFFS updates

Any hint that helps finding the issue is appreciated ...

Currently my device is calling home via IAS.callHome() and getting updates installed. Just the second call to get the SPIFFS update (website and certificate) fails. The dashboard and the logs do just show the first call. (IAS.callHome(true) did not help.)

As it can not be connected to a serial monitor, trouble shooting is quite hard.

THANKS to all in advance !

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to ChWuel (View post):

Any hint that helps finding the issue is appreciated ... Currently my device is calling home via IA...

Esp32 or esp8266?

Has it ever successfully called home for SPIFFS?

Is it possible that you turned off spiffs calls on the config.h file? 

How do you know the certificate fails? 

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

It is an ESP32 and I did not touch the config.h - same timestamp, as the other files / OTA_UPD_CHECK_SPIFFS     true

It has worked in the past, beside the certificate issues, which have been solved. I did not do SPIFFS updates since then.

I do get the firmware updates installed, so the certificate seems to be OK - right ? The dashboard/logs show calling home and receiving the new sketch. Additionally, I had implemented an XHR, to check some status information including the compile time/date, so that I can see, the new firmware version has been installed.

I called config mode manually to really make sure, the cert is fine. BTW - FYI - I just noticed, that it did called config mode several times on its own, without out me initiating it ... (AutoUpdate and AutoConfig set to false, CallTime = 0).

In SPIFFS, I have index.html, favicon.png and the cert 'folder' with iasRootCa.cer file.

As the new website version does not show up and the dashboard/logs do not show SPIFFS call/update - I assume, that something is wrong after getting the SW update - right ?

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

In response to ChWuel (View post):

It is an ESP32 and I did not touch the config.h - same timestamp, as the other files / OTA_UPD_CHECK...

After further testing, even updates are failing ... I restarted with IASLoader and manual upload of sketch and file image. OTA fails ... seems, that IAS is called, but no update gets installed. No error message about no connection or missing certificate, so this seems OK. I once saw a message "Not activated. Check config ...", but I was not able to determine, where this comes from, nor to reproduce.
Usually just after the "Checking for App(Sketch) ..." I get "ELF file SHA256: 000000000000000" and a Backtrace 0x..... followed by Rebooting... with the usual booting sequence.

HOW to further trouble shoot ?

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to ChWuel (View post):

After further testing, even updates are failing ... I restarted with IASLoader and manual upload of...

"Not activated. Check config ..."
Would explain a lot regarding calling home without logs messages: If something went wrong and the device is no longer activated/recognized. Our systems will no longer know it's yours... and so you will not receive any logs....

So I think your problems are bigger. And you have to find out what happened to the in EEPROM stored activation code.

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

In response to Onno Dirkzwager (View post):

"Not activated. Check config ..."Would explain a lot regarding calling home without logs messages: I...

Well ... and how ???
Would it be better / possible to re-register (activate) the device ?

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to ChWuel (View post):

Well ... and how ???Would it be better / possible to re-register (activate) the device ?

Yes, you should be able to go into config mode and re-register it in the IAS tab.

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Other than that it is very difficult for me to find out what happened..... if it happens again, it would be helpful if I could run / check your code.

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

In response to Onno Dirkzwager (View post):

Yes, you should be able to go into config mode and re-register it in the IAS tab.

I did that a feq time today and again ... I uploaded an empty data folder to totally clean the SPIFFS, then uploaded the IASLoader successfull...registered the device and got the firmware installed, but it is not going to get the SPIFFS. There is just the cert folder/file, not my index.html...another reset did not do anything. The logs says "no updates necessary". I created a new version with just the SPIFFs file with "file not selected". Then I uploaded a new version and have the same behaviour, as before...log shows update, but it does not.

So, it seems, that after the installation it is possible to call home, but not really getting updates.

 

BTW - Is there a way to just and only get a SPIFFS update initiated ?

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

In response to Onno Dirkzwager (View post):

Other than that it is very difficult for me to find out what happened..... if it happens again, it w...

What is the best way to exchange files ?

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to ChWuel (View post):

What is the best way to exchange files ?

I just did multiple updates myself for my current project to be sure everything server and library wise is in order. It worked!
I know you are also on discord... maby you can send me a PM as gmail does not like .bin files.

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Just a thought.... did you change partition sizes between the device registration and the initial update?

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

In response to ChWuel (View post):

I did that a feq time today and again ... I uploaded an empty data folder to totally clean the SPIFF...

I took a similar board and uploaded the sketch - failing with the SPIFFS again. So, similar situation. After that, I tried to get back to the original APP and failed ... "file not selected". After manual update with the same sketch - same situation. After IASLoader restart - same situation...

Then I tried vice versa and got the same situation. Manual upload via serial is OK, OTA fails "file not selected" or no information at all ....

Now, I removed the 2nd board from my account with the project and APP and reiinitialized - sucessfully, I updated with a new sketch !

Now trying the same with the first board / sketch ... no success, same result. NO update after the sketch is loaded.

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

In response to Onno Dirkzwager (View post):

Just a thought.... did you change partition sizes between the device registration and the initial up...

I'm not sure, if I do know, how to change partition size ... I did use PREFERENCES to store some settings and removed it now, as I thought it could be an issue, but it should not from my understanding. The first month, there was no issue getting updates ... (on a second board the preferences are still there, even after a lot of updates and re-initializing)

What do you mean by "initial" ? I usually start with the IASLoader and then directly update with the sketch, I like to use.

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to ChWuel (View post):

I'm not sure, if I do know, how to change partition size ... I did use PREFERENCES to store some set...

It's not clear to me what you are doing and in what order... probably lost in translation... I've been updating all evening without issues.

It's clear it's not working for you... and I would like to help you figure it out. Please send me your code so I can try and reproduce your issues. Either on discord as a PM or as a .zip at iotappstory@gmail.com (may complain about the files...) Without it, I'm shooting in the dark...