vortigont / esp32-flashz

zlib compressed OTA firmware update for ESP32. Implements on-the-fly OTA images decompression on upload/flashing
GNU General Public License v2.0
33 stars 4 forks source link

Error beginz #3

Closed jlsevillano closed 1 year ago

jlsevillano commented 1 year ago

size_t totalSize = atoi(sizeFromString); I replace Update.begin(totalSize) by Flashz::beginz(totalSize) But when i try to compile: cannot call member function 'bool FlashZ::beginz(size_t, int, int, uint8_t, const char*)' without object

And the same with: cannot call member function 'size_t FlashZ::writez(const uint8_t*, size_t, bool)' without object

jlsevillano commented 1 year ago

I'm trying to implement flashz over this: https://www.teachmemicro.com/update-esp32-firmware-external-web-server/ And is not possible.

vortigont commented 1 year ago

Flashz is a singleton, you need to spawn an instance. Use it like this

FlashZ::getInstance()->beginz(totalSize);
FlashZ::getInstance()->writez();

etc...

vortigont commented 1 year ago

You may check flashz-http.cpp code to get a hint on how to deal with OTA via remote compressed image downloading.

jlsevillano commented 1 year ago

Lot of thanks, @vortigont. I tried: FlashZ::getInstance()->beginz(totalSize); FlashZ::getInstance()->writez();

Error

But with: FlashZ::getInstance().beginz(totalSize); FlashZ::getInstance().writez();

Works, ;)

Now I have Flash Mem space: ERROR, flashed 0 of 32768 bytes chunk, err: Not Enough Space!

But I think is another problem not related with this lib.

vortigont commented 1 year ago

yeah, not a pointer, my bad ) feel free to reopen if any issues persists. Cheers!