zwiebert / tronferno-mcu

Control and program Fernotron receivers by micro-controller. (ESP32, 2011-2022)
GNU General Public License v3.0
21 stars 2 forks source link

Feature Request: Backup Data / Clone Device #12

Open devtos opened 2 months ago

devtos commented 2 months ago

Hey, would be nice if i can backup all the sata on the ESP and move it to another device.

zwiebert commented 2 months ago

Hello, there is an experimental backup functionality. Most of the data can be saved and restored with it.

In the WebApp go to the rightmost tab and chose "Expert" for GUI access restriction. Then go to the tab ?->Backup and read the mouse over help texts.

Alternatitvely you could try to copy the entire flash ROM from one ESP to another one using esptool:

https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/basic-commands.html

FIrst read the entire flash to a file:

esptool.py -p PORT -b 460800 read_flash 0 ALL flash_contents.bin

Then use write_flash to copy it to the new ESP.

Maybe I could add this to menutool later, if I have the time.

HTH, Bert

devtos commented 2 months ago

the backup looks like its missing mqtt, wifi and the code for the shutter if i see it correctly. my remote broke down and i didn't got the code for the shutters, so the esp is my last chance to controll them. i will try the dump and flash method to copy the esp to have a backup, thx :)

zwiebert commented 2 months ago

I did not test the backup with esptool, but it should work.

I'm a bit stuck with the browser based backup feature, but its nearly fully working and usable. It does not save any secret data, like password, because its not protected. Restoring also requires an already working network connection, so its a bit pointless to restore the WIFI data anyway and may be even harmful if there were changes since the backup was made. I plan to add a filter to the UI to exclude the network connection when doing a restore. (edit: Ok the restore would work using the WIFI accesspoint, so it may not be pointless to restore the network connection. I make it optional, and add some Input field for the passwords. For now, passwords can be added to the JSON file using an editor. )

The tronferno is a replacement for the original programming central, so it should work fine. Its nice that they put the code on that sticker in the battery compartment. Not sure if it is possible to reprogram a replacement programming central, so it uses that old code. Maybe the manufacturer service can do this, and thats why they put that sticker there.