logo elektroda
logo elektroda
X
logo elektroda

ESP-12F (ESP8266) - Where to download NodeMCU firmware for LUA scripting?

Adix3 3414 12
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19599474
    Adix3
    Level 13  
    Posts: 334
    Rate: 21
    Welcome.

    I got my hands on a WiFi socket, which I stripped of its casing and removed the entire board with relay, button, LEDs and ESP-12F module. Wanting to get started with the ESP8266, I uploaded a batch downloaded from SUPLI (generated with an online generator) to this board. Once configured, I was able to control the relay from my smartphone, meaning everything worked as needed.
    Now I would like to go a bit further and write some batch of my own. From what I've gathered, this can be done in at least three ways: by writing a program in C++ after downloading the environment directly from the manufacturer, by writing a program in C based on the Arduino platform, or by writing a program (or rather a script) in LUA, but here you need to install the NodeMCU firmware on the ESP module beforehand.
    The first option would be rather too complicated, the second one is also out of the question, because I have never played with Arduino, and the third option, i.e. creating a script in LUA, appeals to me the most. Only now I have a problem where to download all this NodeMCU from? Apparently there are some sources on GitHub (NodeMCU Lua Firmware - GitHub), but you have to compile it somehow, which is already giving me a headache :D Is compilation the only way to generate NodeMCU? Isn't there a ready-made batch?
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 19599554
    inot
    Level 38  
    Posts: 3550
    Help: 439
    Rate: 798
    This may also be useful Link .
    In my opinion, LUA is not the best solution due to the fact that not much memory is available.
  • #4 19599604
    Adix3
    Level 13  
    Posts: 334
    Rate: 21
    TvWidget wrote:
    .

    I didn't come across that. Thanks. Just, can someone verify that I'm setting it up correctly? In "Select branch to build from" I selected "release", in "Select modules to include" I left "file, GPIO, net, node, timer, UART, WiFi" as default, in "LFS options (for release & dev branches)" I should leave the default? In "Miscellaneous options" I don't select anything, right?
    I tried to generate a batch, I got two .bin files on my email, one has "float" in the name and the other has "integer" what's the point?

    Added after 58 [seconds]: .

    inot wrote:
    In my opinion LUA is not the best solution due to the fact that not much memory is available.


    So it would be better to get acquainted with the possibility of creating software like on Arduino? Or something else?
  • #5 19599619
    inot
    Level 38  
    Posts: 3550
    Help: 439
    Rate: 798
    Arduino is very widespread and you will find thousands of examples and various ready-made libraries everywhere.
  • ADVERTISEMENT
  • #6 19599625
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #8 19599649
    inot
    Level 38  
    Posts: 3550
    Help: 439
    Rate: 798
    You can get even more complicated:
    Eclipse .
  • #9 19599739
    Adix3
    Level 13  
    Posts: 334
    Rate: 21
    Ok, after some thought and problems with programming the module via the generated NodeMCU batches, I decide to switch to Arduino. I downloaded the Arduino IDE, installed the ESP8266 add-on and selected the "Generic ESP8266 Module" board in "Tools". What now? I guess I still need to configure the other parameters in this Tools tab? But how? From what I've found on the web I think the ESP-12F module has 4Mb of Flash memory, meanwhile after taking the socket apart and before uploading the Supli software, I still managed to write down the parameters that the UART console returned to me after powering up the whole device and there was something like this:

    SPI Speed: 40 MHz
    SPI Mode: QIO
    SPI Flash Size & Map: 8MBit (512KB + 512KB)

    So this module has 8Mb Flash? In the Arduino, on the other hand, I have a choice of 8MB (FS; 6MB, OTA: 1019KB) and 8MB (FS; 7MB, OTA: 512KB). What should I choose here? :D .
    And one more thing, do you need to upload a bootloader or something on the ESP module? Or does the Arduino just upload what it needs?
  • #10 19599755
    Anonymous
    Level 1  
  • #11 19599790
    inot
    Level 38  
    Posts: 3550
    Help: 439
    Rate: 798
    Quote:
    Arduino is not going to do anything.
    .
    I wouldn't say that. The OTA can be reduced to a minimum (if you have no intention of programming via WLAN).
    With this code you can get information about the FLASH parameters,

    #ifdef DEBUG_OUT
      uint32_t realSize = ESP.getFlashChipRealSize();
      uint32_t ideSize = ESP.getFlashChipSize();
      FlashMode_t ideMode = ESP.getFlashChipMode();
    
      Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
      Serial.printf("Flash real size: %u bytes\n\n", realSize);
    
      Serial.printf("Flash ide  size: %u bytes\n", ideSize);
      Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
      Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
    
      if (ideSize != realSize) {
        Serial.println("Flash Chip configuration wrong!\n");
      } else {
        Serial.println("Flash Chip configuration ok.\n");
      }
     #endif
    .

    As khoam already wrote "ESP-12F modules usually have 32Mb, or 4MB FLASH."
  • #12 19600978
    Adix3
    Level 13  
    Posts: 334
    Rate: 21
    Ok, it works. I installed Arduino version 2.0 (beta), compiled the "Blink" example code, uploaded it and the diode flashes, so everything is ok.

    I want to raise two more points:
    1. I took the shield off the ESP-12F module and there is actually an 8Mb bone (PN25F08) mounted there. I am so wondering if I could replace it with 25Q064A13E40? This memory is 64Mb which is 8MB. Somewhere I found a topic on the electrode that someone once exchanged this way for some 32Mb bone and supposedly it worked :D .

    2 I wanted to run the Arduino IDE 1.8.16 on a computer with XP, but when compiling the "Blink" example I get errors like this:

    processing.app.debug.RunnerException
    	at cc.arduino.Compiler.callArduinoBuilder(Compiler.java:317)
    	at cc.arduino.Compiler.loadPreferences(Compiler.java:216)
    	at cc.arduino.Compiler.build(Compiler.java:175)
    	at processing.app.SketchController.build(SketchController.java:664)
    	at processing.app.Editor$BuildHandler.run(Editor.java:1638)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: java.io.IOException: Cannot run program "C:\Program Files\Arduino\arduino-builder": CreateProcess error=193, %1 is not a valid Win32 application
    	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    	at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
    	at cc.arduino.Compiler.callArduinoBuilder(Compiler.java:297)
    	... 5 more
    Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
    	at java.lang.ProcessImpl.create(Native Method)
    	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    	... 7 more
    
    .
    Perhaps someone has had a similar issue?

    Added after 2 [hours] 8 [minutes]:

    Ok with this error I have dealt with it. The problem was the "arduino-builder" file which was not for the 32-bit version. I downloaded Arduino 1.8.9 because I read that this version is still compatible with Windows XP. Now I get this error when compiling:

    In file included from c:\documents and settings\admin\local settings\application data\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\stdlib.h:36,
                     from C:\Documents and Settings\admin\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:27,
                     from sketch\Blink.ino.cpp:1:
    c:\documents and settings\admin\local settings\application data\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
       41 | #include <bits/c++config.h>
          |          ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    .
  • #13 20323830
    Michal_212
    Level 3  
    Posts: 128
    Rate: 13
    inot wrote:
    .

    #ifdef DEBUG_OUT
      uint32_t realSize = ESP.getFlashChipRealSize();
      uint32_t ideSize = ESP.getFlashChipSize();
      FlashMode_t ideMode = ESP.getFlashChipMode();
    
      Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
      Serial.printf("Flash real size: %u bytes\n\n", realSize);
    
      Serial.printf("Flash ide  size: %u bytes\n", ideSize);
      Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
      Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
    
      if (ideSize != realSize) {
        Serial.println("Flash Chip configuration wrong!\n");
      } else {
        Serial.println("Flash Chip configuration ok.\n");
      }
     #endif
    .

    .

    Sorry to dig up, but how do you use this code? Because I would also like to check the amount of memory in my :) .

Topic summary

✨ The discussion revolves around downloading NodeMCU firmware for the ESP-12F module, part of the ESP8266 family, to enable LUA scripting. A user successfully controlled a relay using a batch firmware from SUPLI and seeks to create custom scripts. Responses suggest using the NodeMCU build site for firmware, while some participants recommend exploring Arduino programming due to its extensive resources and libraries. The user inquires about configuration settings for the NodeMCU firmware and later decides to switch to Arduino IDE, seeking guidance on board settings and flash memory options. The conversation also touches on the possibility of upgrading the flash memory chip on the ESP-12F module and troubleshooting compilation errors on older systems.
Generated by the language model.

FAQ

TL;DR: ESP-12F typically has 32 Mb (4 MB) flash—"ESP-12F modules usually have 32Mb, or 4MB of flash." Use nodemcu-build.com for ready NodeMCU, or switch to Arduino/MicroPython on small-flash boards. [Elektroda, khoam, post #19599755]

Why it matters: This FAQ helps ESP‑12F/ESP8266 tinkerers find firmware, flash it safely, and choose workable Arduino settings on low‑flash boards.

Quick Facts

Where can I download NodeMCU firmware for ESP-12F without compiling?

Use the community build service at nodemcu-build.com. It lets you pick branch and modules, then emails ready .bin files. This avoids setting up a toolchain. Many users start with the release branch and core modules, then iterate as needed. [Elektroda, TvWidget, post #19599543]

Why did the builder email me two files: float and integer? Which do I use?

Float builds support decimal math; integer builds save memory but only handle integers. Choose float if you need fractional sensor values or math. Choose integer for tight memory budgets or simple control logic. The builder commonly delivers both variants for convenience. [“NodeMCU Build”]

Which branch and modules should I choose on nodemcu-build.com for ESP8266?

Start with the release branch for stability. Keep core modules (file, gpio, net, node, timer, uart, wifi) and add only what you need. Leave LFS defaults until your Lua files outgrow RAM. Trim modules to fit small flash sizes. [“NodeMCU Build”]

Is there a simple Windows tool to flash NodeMCU firmware?

Yes. Use the NodeMCU Flasher from GitHub. Select your COM port, load the .bin, and flash. It’s a straightforward GUI, good for initial experiments with ESP-12F modules. Keep wiring short and stable to avoid flashing errors. [Elektroda, inot, post #19599554]

Do I need a bootloader before flashing ESP8266?

No. ESP8266 contains its bootloader in ROM. You only need to enter download mode and push your firmware. “The bootloader is already in the ROM in the ESP.” [Elektroda, khoam, post #19599755]

How do I flash firmware with esptool-style steps?

  1. Enter download mode (GPIO0 low), reset the ESP-12F.
  2. Connect USB‑UART (3.3 V), pick the correct COM port.
  3. Use esptool or a GUI to write the .bin at the required offset. These steps mirror Espressif’s standard process for ESP8266. [“ESP8266 RTOS SDK Get Started”]

How can I check my ESP-12F flash size in Arduino code?

Add the provided snippet to your sketch, define DEBUG_OUT, and print chip size, speed, and mode over Serial. Then compile for Generic ESP8266 Module, upload, and read the Serial Monitor at startup. It reports real vs IDE flash size and mode. [Elektroda, inot, post #19599790]

What does “8Mbit (512KB + 512KB)” in the boot log mean?

It indicates a 1 MB flash with a 512 KB + 512 KB mapping. Many stock images use two half‑megabyte regions, affecting OTA and filesystem options. With 1 MB, you often disable OTA and filesystem to free space for sketches. [Elektroda, Adix3, post #19599739]

My ESP-12F shows only 1 MB flash. Can I still use Arduino?

Yes, but keep things lean. Disable OTA updates, avoid large filesystems, and choose a minimal flash layout. “The OTA can be reduced to a minimum,” so serial flashing works for updates. Expect tight space for libraries and features. [Elektroda, inot, post #19599790]

Which Flash Size/FS/OTA option should I select in Arduino IDE for 1 MB?

Pick one of the 1 MB profiles such as 1M (no SPIFFS) or similar minimal layouts. These profiles match constrained parts and prevent size mismatch errors during upload. Avoid 8 MB profiles, which target 64 Mbit chips. [Elektroda, khoam, post #19599755]

What SPI speed/mode should I use (my boot log shows 40 MHz, QIO)?

Match your boot log. If it reports SPI Speed 40 MHz and Mode QIO, keep those defaults in Arduino Tools. This aligns with the module’s factory configuration and improves stability during flash and runtime. [Elektroda, Adix3, post #19599739]

Is Lua/NodeMCU a good choice on small‑flash ESP8266 boards?

Lua can work, but memory is tight. One expert noted, “LUA is not the best solution due to the fact that not much memory is available.” Consider Arduino C/C++ or MicroPython if you hit space limits. [Elektroda, inot, post #19599554]

Should I pick Arduino Core, ESP8266 RTOS SDK, or MicroPython?

Arduino Core is easiest and has many libraries. For maximum control and performance, “you’d get better use of the ESP8266’s capabilities by programming in C/C++.” MicroPython is another high‑level option with ready firmware downloads. [Elektroda, khoam, post #19599625]

Where do I get MicroPython firmware for ESP8266?

Download prebuilt ESP8266 images from the official MicroPython site. Flash them like any other firmware using esptool or your preferred GUI. It’s a fast path to Python scripting on ESP-12F. [Elektroda, TvWidget, post #19599633]

Can I upgrade the flash chip from 8 Mbit to 64 Mbit (8 MB)?

It’s possible with compatible SPI flash and rework skills. One user identified PN25F08 (8 Mbit) and considered a 25Q064 (64 Mbit). Verify pinout, voltage, and flash mapping before swapping, and adjust IDE settings after. [Elektroda, Adix3, post #19600978]

Arduino IDE errors on Windows XP—how do I fix “CreateProcess error=193”?

On XP, Arduino 1.8.16 bundles a non‑XP builder. Install Arduino 1.8.9, which includes a compatible 32‑bit builder. If you still see toolchain header errors, align your ESP8266 core/toolset to versions that support XP. [Elektroda, Adix3, post #19600978]
Generated by the language model.
ADVERTISEMENT