warp-more-hardware / esp32-firmware

TinkerForge WARP software for more hardware
16 stars 1 forks source link

Fix reset function #46

Closed bs-github closed 1 year ago

bs-github commented 1 year ago

This change implements 3 reset stages.

  1. Resetting network configuration and disabling web interface login
  2. Removing configuration but keeping charge log.
  3. Format data partition. (This also removes tracked charges and the username file)

The reset is initiated by pressing button SW3 during boot.
The stage is selected by the duration of holding the button down.

If you press and hold SW3 on boot, the green LED will be on for the first 10 seconds. If you release the button within this time, nothing will be reset and the boot will continue normally. If the button is still pressed, the green LED will start flashing and if SW3 is released within the next 5 seconds stage 0 will be initiated. The next 5 seconds both, the green and the red LED will be flashing and if released in this period, stage 1 will be entered. If still pressed, only the red LED will flash for another 5 seconds and if released now, stage 2 will be executed.
If SW3 is still pressed after this, finally a normal boot will happen without resetting anything.

bs-github commented 1 year ago

This reset logic is directly taken from TinkerForge and if we keep it that way, we can point to their documentation (with just adding documentation for the different way of triggering the stages).

https://github.com/Tinkerforge/esp32-firmware/blob/master/software/src/modules/evse_v2/preinit.cpp#L121-L157 https://github.com/Tinkerforge/warp-charger/blob/master/manual/manual_warp2.tex#L904-L914

bs-github commented 1 year ago

This fixes #1