For now I have a NodeMCU 4mb unit which I use for setting-up and tweaking. I run Linux of Mac and prefer commandline utilities. This is my workflow when creating a backup of the current flash memory.
First I calculate the flash size in bytes (which is always 4194304 bytes in my case but might change in the future):
Code: Select all
rombytesize=$(( 1048576 * $(esptool --port /nodemcu flash_id | grep "flash size:" | sed 's/.*\([0-9+]\).*/\1/')
Code: Select all
esptool --port /nodemcu read_flash 0x00000 "$rombytesize" backup."$rombytesize"."$(date +%Y%m%d%H%M)".bin
Code: Select all
esptool --port /nodemcu write_flash 0x00000 firmwarebackup.bin
Is this good practice or am I doing it wrong?
ps. I symlinked esptool to .../ESP8266/esptool-master/esptool.py, and I have symlinked /nodemcu to /dev/ttyblabla