NodeMCU flash size

guys, is it possible to change the NODEMCU card so that it holds more than 1mb for the program?
the idea would be to leave 1.5mb for the program, 1.5mb for OTA and 1mb for FS, totaling the 4bm that the card has memory

In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M SPIFFS) or 4M (3M SPIFFS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?

The reason we cannot have more than 1MB of code in flash has to do with a hardware limitation. Flash cache hardware on the ESP8266 only allows mapping 1MB of code into the CPU address space at any given time. You can switch mapping offset, so technically you can have more than 1MB total, but switching such “banks” on the fly is not easy and efficient, so we don’t bother doing that. Besides, no one has so far complained about 1MB of code space being insufficient for practical purposes.

The option to choose 3M or 1M SPIFFS is to optimize the upload time. Uploading 3MB takes a long time so sometimes you can just use 1MB. Other 2MB of flash can still be used with ESP.flashRead and ESP.flashWrite APIs if necessary.

https://arduino-esp8266.readthedocs.io/en/latest/faq/readme.html

Pete.

the reason for more than 1mb of code is because it activates an air conditioner via infrared.
the existing infrared libraries cannot identify the code, being necessary to send the RAW codes to work.
for the time we activate the control, a combination of values is sent, such as Mode, Temperature, Swing, Light … and these combinations result in about 1800 codes.
I am currently using the PROGMEM to store this information, but it is not enough.
as it is not possible to use more than 1mb of code, I believe that I should use the FS instead of the PROGMEM, right?

I guess so, either SPIFFS or the new FS.

What type of aircon system is it?
I’ve done quite a bit of research into IR, Aircon protocols ad 433MHz protocols and you’ll quickly discover that 90% of the raw data for most aircon systems is padding, repetition or static data. Once you understand the protocol then it’s usually 3 or 4 bytes of data that change per function. After that it’s easy to assemble your data string from these components and send them, with preamble and repetition as necessary,to activate the functions you require.

Also, even though my aircon has a recognised protocol that doesn’t need to be sent as raw data, I actually only use a handful of coides. What I do is to set the aircon to maximum cooling (in summer) then monitor the room temperature using a remote sensor. When it has reached the target temperature then I set the aircon to minimum cooling, so that it goes into idle mode.

More details here:

Pete.