Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes firmware updates reset the board profile on the E32 #345

Closed
bbqkees opened this issue Jan 30, 2022 · 14 comments
Closed

Sometimes firmware updates reset the board profile on the E32 #345

bbqkees opened this issue Jan 30, 2022 · 14 comments
Labels
bug Something isn't working
Milestone

Comments

@bbqkees
Copy link
Contributor

bbqkees commented Jan 30, 2022

I get regular emails that when someone updates the firmware on an E32, that the board profile resets to S32.
The problem here is that you loose the Ethernet connection and you have to go to the boiler, connect to the AP and set it to E32 again.

This happens I think when updating from 3.x to 3.4 and of course if you flash it via USB.

Would it be an idea to add a second bin file on the releases page with E32 as the default board profile?
So in case something goes wrong, the default profile is E32 and you can still connect remotely via Ethernet.

I was thinking to hardwire a product ID on two or three GPIO in future revisions, in this case EMS-ESP can check on boot which board it is running on.

@bbqkees bbqkees added the bug Something isn't working label Jan 30, 2022
@proddy
Copy link
Contributor

proddy commented Jan 30, 2022

Interesting, I haven't seen this behavior. The board profile logic changed in v3.4 to support extra parameters but didn't expect it to not recognize previous settings. Have you been able to reproduce this?

@MichaelDvP
Copy link
Contributor

MichaelDvP commented Jan 31, 2022

@proddy (deleted)
Edit: Sorry, looked in the wrong line, the rename is not the settings file.

@bbqkees
Copy link
Contributor Author

bbqkees commented Jan 31, 2022

Here I did not encounter these problems myself.
It's always difficult to get to the exact reason why someones' Gateway had this reset. It looks like there are several unrelated causes.
Most often they have no idea how they ended up in the reset.

@bbqkees
Copy link
Contributor Author

bbqkees commented Jan 31, 2022

I just got an email from a user who had this issue after updating from 3.2.x to 3.3.1.

@pypb
Copy link

pypb commented Jan 31, 2022

I encountered the same issue going from 3.3.0 to 3.3.1, profile was reset to S32.

@mvjt
Copy link

mvjt commented Jan 31, 2022

Same here when going from 3.3.x to 3.4.

@proddy
Copy link
Contributor

proddy commented Feb 5, 2022

ok, so I need to test this and load up an 3.3 onto an ESP32 and set the boardtype to E32, then upgrade to 3.4 and see if and why it switches back to S32.

proddy added a commit that referenced this issue Feb 6, 2022
@proddy
Copy link
Contributor

proddy commented Feb 6, 2022

Can't reproduce this, but added some improved logging to catch it if it happens again. Would be good to know from the users experiencing this how they are upgrading, via ota, via browser (which) and which OS

@mvjt
Copy link

mvjt commented Feb 6, 2022

Can't reproduce this, but added some improved logging to catch it if it happens again. Would be good to know from the users experiencing this how they are upgrading, via ota, via browser (which) and which OS

In my case I did the following

  1. Connected my NEW out of the box E32 to the network (cable)
  2. Saw it had FW 3.3.x, downloaded the 3.4 beta and uploaded it (using MacOS, Safari which we know has issues).
  3. Device rebooted and was lost on the network (cable), did not think about checking if AP was broadcasting as I was not using it
  4. Firmware upgraded using serial cable, still no Ethernet
  5. Saw that SSID was broadcasting, changed device profile and everything started to work again.

EDIT: Now when on 3.4, if I try to upgrade FW again using the same web interface, it fails but does not change the device profile.

@proddy
Copy link
Contributor

proddy commented Feb 6, 2022

I suspect its related to that previous OSX firmware uploaded bug where it would try and upload a broken .bin file and it would remove part of the flash memory which has the board profile setting. If it happens again let me know!

@MichaelDvP
Copy link
Contributor

I had this one time, but not sure after what update, because only the project settings were on defaults, wifi, mqtt, ntp, etc. were unchanged. It was surely a update v3.4 to v3.4 with little changes. There was a upload error http:500 in one update, second upload worked and i suspect this 500 was the cause for deleting the project file.
A test with 3.1, 3.2, 3.3, 3.4 updating works without changing data. (i've loaded factory settings and configure manual in 3.1 to have a clear start).

@bbqkees
Copy link
Contributor Author

bbqkees commented Feb 7, 2022

I don't think we can really prevent it from ever happening.
However, when it happens on a wired E32 it's very inconvenient or sometimes maybe even problematic.

Is there any failsafe we can think of?

@MichaelDvP
Copy link
Contributor

Don't know if it is competly failsafe and if it works. Just an idea:
There is a nv storage in esp32, see here. I think nvs survives the OTA/webupdate. On first emsesp-config store the ethernet module to nvs (only if the value is not existing). On start load the default from nvs and if settingsfile is missing/broke/reseted this default eth-module is set. If the nvs-value exists, it is never written again. (except reformatting/repartitioning/flash-erase).

@proddy
Copy link
Contributor

proddy commented Feb 7, 2022

I really would like to know the root cause. Now after a recent change if the board profile is reset by chance during a f/w upload it'll be shown in the log, so we can trace it back. And instead of resetting to the S32 it will go to CUSTOM. I think we can close this and see what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants