(sorry about the poor english) Hello guys, I was working on a smart greenhouse project that utilize very chars and strings, ntp servers for telling time, bluetooth for app compability etc. I use a WEMOS D1 R32 Esp32. I specifically chose this board because i needed more storage for my projects. But my project is too heavy for my board. The sketch uses 1674221 bytes (127%) of program storage space. The maximum is 1310720 bytes.
And global variables use 60096 bytes (18%) of dynamic memory, leaving 267584 bytes for local variables. The maximum is 327680 bytes. I do not want to buy an SD card reader and do not want to break my code. Can anyone help me? The code is:
You may want to visit this Arduino page, which describes how to reduce your sketch size and memory usage.
You may also want to consider replacing your current board with an ESP32-S3 board that provides a more significant amount of flash. Adafruit has several boards with 8MB of flash. The downside is that they are S3-type boards that support BLE but not Bluetooth Classic. There is a BLE serial library that implements Nordic UART.
I have used the HardwareBLESerial library for one of my projects, which works without issue.
@kmin had a great suggestion. I selected large partition (no OTA), and here is the result:
Sketch uses 1679524 bytes (80%) of program storage space. Maximum is 2097152 bytes.
Global variables use 61484 bytes (18%) of dynamic memory, leaving 266196 bytes for local variables. Maximum is 327680 bytes.
Thank you guys very much, I tried out the code and it worked with no issues, also gonna state that I cannot afford another board right now because the econamical state in my country is bad so things get overpriced from our perspective. Still ty very much, appreciate it.
Well I have so much char and strings as I stated (as i remember) so it could be that.
My normal code was just over 600 lines long but i shortend the code a little.
Well, it's 80% of only 2MB. Apparently half the flash is "reserved" for OTA upgrades, or something. (although, even the non-OTA, no FS, partition schemes seem to max out at 3MB. I don't know whether that's a device limitation, or just a lack of menu options...)
Using the "Huge App" partition scheme indeed helps reduce the firmware size. However, if your code still occupies too much space, consider reviewing and optimizing the libraries you're using. Some libraries can be replaced with lighter alternatives or even custom implementations. Also, be cautious with the use of String variables, as they can consume a lot of memory; replacing them with character arrays (char[]) might be beneficial.