thorrak/brewflasher

Filesystem Flash Not Honored

Closed this issue · 5 comments

lbussy commented

It's hard to come up with a title here that's 100% descriptive but here's what's happening:

In Keg Cop (and Brew Bubbles I think) there is an application configuration JSON that has demo data. Especially in Keg Cop where there is a configuration per tap, there is a value in shipping this configuration intact. When this is intact, nine taps are displayed on the home screen after the first flash. When it's not intact the screen is bare.

If locally I flash the firmware and then the SPIFFS partition, the reset then loads the demo config and all is well.

When I use BrewFlasher (web) I flash both partitions, but the demo data is gone. The application does write default data but that demo data is missing.

Theory: The flashing process allows/causes the application to start and create the default configuration. Even though that configuration is overwritten on the filesystem, the process allows/causes the application to save what's in memory which is at this point "default."

So, to be clear - This is an issue with BrewFlasher Web?

lbussy commented

Uh, good point. Let me try the desktop client.

lbussy commented

This is an issue with BrewFlasher Web?

Both.

An interesting difference though, not sure this is important: When I use the web it takes me to the captive portal and I do my thing, and after it restarts I cannot connect to the board without resetting again. When I use the app, it allows a connection the first time.

Verifying firmware list is up-to-date before downloading...
Downloading firmware...
Downloading partitions file...
Downloading SPIFFS/LittleFS file...
Downloading bootloader file...
Downloading otadata file...
Downloading main firmware file...
Downloaded successfully!

Command: esptool.py --chip esp32 --baud 460800 --before default_reset --after hard_reset write_flash 0x10000 /private/var/folders/sm//T/firmware.bin 0x8000 /private/var/folders/sm//T/partitions.bin 0x1000 /private/var/folders/sm//T/bootloader.bin 0x370000 /private/var/folders/sm//T/spiffs.bin 0xe000 /private/var/folders/sm//T/otadata.bin --erase-all -fs detect

esptool.py v3.3.2
Found 2 serial ports
Serial port /dev/cu.usbserial-210
Connecting......
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 34:ab:95:5c:a7:d8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Erasing flash (this may take a while)...
Chip erase completed successfully in 46.2s
Compressed 1747040 bytes to 1020139...
Writing at 0x00010000... (1 %)
Writing at 0x0001dcec... (3 %)
Writing at 0x0002a229... (4 %)
Writing at 0x0003646a... (6 %)
Writing at 0x0003faee... (7 %)
Writing at 0x00047d4c... (9 %)
Writing at 0x0005ae94... (11 %)
Writing at 0x0006a076... (12 %)
Writing at 0x0006f5e8... (14 %)
Writing at 0x00077039... (15 %)
Writing at 0x0007d9ac... (17 %)
Writing at 0x00084d3a... (19 %)
Writing at 0x0008b880... (20 %)
Writing at 0x000921b7... (22 %)
Writing at 0x000982ea... (23 %)
Writing at 0x0009ea79... (25 %)
Writing at 0x000a5d30... (26 %)
Writing at 0x000ac26e... (28 %)
Writing at 0x000b299c... (30 %)
Writing at 0x000b940a... (31 %)
Writing at 0x000c0116... (33 %)
Writing at 0x000c7ce0... (34 %)
Writing at 0x000ce86d... (36 %)
Writing at 0x000d4c11... (38 %)
Writing at 0x000dab3d... (39 %)
Writing at 0x000e0308... (41 %)
Writing at 0x000e5d10... (42 %)
Writing at 0x000eb0e0... (44 %)
Writing at 0x000f05aa... (46 %)
Writing at 0x000f5ebc... (47 %)
Writing at 0x000fb27b... (49 %)
Writing at 0x001003f5... (50 %)
Writing at 0x00105688... (52 %)
Writing at 0x0010a81f... (53 %)
Writing at 0x0010fc25... (55 %)
Writing at 0x0011508b... (57 %)
Writing at 0x0011a2ef... (58 %)
Writing at 0x0011f391... (60 %)
Writing at 0x00124740... (61 %)
Writing at 0x0012a6d3... (63 %)
Writing at 0x0012fd0c... (65 %)
Writing at 0x00135281... (66 %)
Writing at 0x0013a7af... (68 %)
Writing at 0x0013fa0b... (69 %)
Writing at 0x00144dfb... (71 %)
Writing at 0x0014a1c3... (73 %)
Writing at 0x0014f735... (74 %)
Writing at 0x00154ebc... (76 %)
Writing at 0x0015ad22... (77 %)
Writing at 0x00160669... (79 %)
Writing at 0x00166ee9... (80 %)
Writing at 0x0016e250... (82 %)
Writing at 0x00176564... (84 %)
Writing at 0x0017dd24... (85 %)
Writing at 0x00184590... (87 %)
Writing at 0x0018a9b0... (88 %)
Writing at 0x001929e3... (90 %)
Writing at 0x0019b342... (92 %)
Writing at 0x001a3979... (93 %)
Writing at 0x001a8afc... (95 %)
Writing at 0x001ae3fb... (96 %)
Writing at 0x001b35ed... (98 %)
Writing at 0x001b8f33... (100 %)
Wrote 1747040 bytes (1020139 compressed) at 0x00010000 in 27.0 seconds (effective 518.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 147...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (147 compressed) at 0x00008000 in 0.1 seconds (effective 398.6 kbit/s)...
Hash of data verified.
Flash params set to 0x0240
Compressed 17056 bytes to 11160...
Writing at 0x00001000... (100 %)
Wrote 17056 bytes (11160 compressed) at 0x00001000 in 0.5 seconds (effective 257.8 kbit/s)...
Hash of data verified.
Compressed 524288 bytes to 220493...
Writing at 0x00370000... (7 %)
Writing at 0x0037c2fe... (14 %)
Writing at 0x00384bc0... (21 %)
Writing at 0x0038ce5a... (28 %)
Writing at 0x00394ed8... (35 %)
Writing at 0x0039e4d3... (42 %)
Writing at 0x003a6f5f... (50 %)
Writing at 0x003af3d8... (57 %)
Writing at 0x003b75bb... (64 %)
Writing at 0x003bfabb... (71 %)
Writing at 0x003c7f82... (78 %)
Writing at 0x003d055c... (85 %)
Writing at 0x003d89d9... (92 %)
Writing at 0x003e15e4... (100 %)
Wrote 524288 bytes (220493 compressed) at 0x00370000 in 6.0 seconds (effective 694.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 632.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Firmware successfully flashed. Unplug/replug or reset device 
to switch back to normal boot mode.

Are you 100% certain that you rebuilt the filesystem (with the right filenames) and uploaded the correct image?

I ask, as this is working for me at the moment (and the image is definitely not launching in the middle of that flash)

lbussy commented

Are you 100% certain that you rebuilt the filesystem (with the right filenames) and uploaded the correct image?

Yep. Also 100% certain that this is my fault. :)

I was "saving" after executing the captive portal, but I never loaded the configuration before that, so the expected happened.