logo elektroda
logo elektroda
X
logo elektroda

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

Adix3 2043 12
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19599474
    Adix3
    Level 13  
    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?
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • ADVERTISEMENT
  • #3 19599554
    inot
    Level 37  
    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  
    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?
  • ADVERTISEMENT
  • #5 19599619
    inot
    Level 37  
    Arduino is very widespread and you will find thousands of examples and various ready-made libraries everywhere.
  • #6 19599625
    khoam
    Level 42  
    Adix3 wrote:
    That is, would it be better to get acquainted with the possibility of creating software like on Arduino? Or something else?
    .
    It doesn't have to be Arduino (although it's the easiest), but in my opinion you'd get better use of the ESP8266's capabilities by programming in C/C++. Link
  • ADVERTISEMENT
  • #9 19599739
    Adix3
    Level 13  
    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
    khoam
    Level 42  
    Adix3 wrote:
    So this module has 8Mb Flash?
    .
    That's bad, because it's only 1MB flash, so you can do practically nothing with the Arduino. The minimum is 2MB, but modules with 4MB of flash are usually available.
    ESP-12F modules usually have 32Mb, or 4MB of flash.

    Adix3 wrote:
    What should I choose here?
    .
    One of the options below.

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

    Adix3 wrote:
    And one more thing, does a bootloader or something like that need to be uploaded to the ESP module?

    The bootloader is already in the ROM in the ESP.

    EDIT
    Sorry, but I misled with the above image. For 1MB flash, the following options are available in the Arduino IDE:

    ESP-12F (ESP8266) - Where to download NodeMCU firmware for LUA scripting? .
  • ADVERTISEMENT
  • #11 19599790
    inot
    Level 37  
    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  
    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  
    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.
Summary generated by the language model.
ADVERTISEMENT