logo elektroda
logo elektroda
X
logo elektroda

Flashing OpenBeken/OBK firmware to ESP8266/ESP8285 devices

divadiow 5313 95
ADVERTISEMENT
  • Helpful post
    #61 21703172
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    @Tilator do you know incidentally how multiple sensors on one device are handled? So we can follow this for the other driver, too?
    If not, I can try to check the code ...

    Added after 16 [minutes]:

    No need to check - found it:

    https://tasmota.github.io/docs/DS18x20/#multiple-sensors

    {"Time":"2021-01-02T09:09:44","DS18B20-1":{"Id":"00000566CC39","Temperature":13.3},"DS18B20-2":{"Id":"0000059352D4","Temperature":1.2},"DS18B20-3":{"Id":"000005937C90","Temperature":22.5},"TempUnit":"C"}

    Sadly it doesn't use the human readable name but the ID...

    Added after 2 [hours] 12 [minutes]:

    Opened PR#1811 for the multiple DS1820 sensors.
    There is one "plain" Tasmota version, adding "-<id>" to the sensor and an Id to identify the sensor (middle 48 bits from ROM address in reverse order).

    Flashing OpenBeken/OBK firmware to ESP8266/ESP8285 devices

    Included is a (commented out) version which additionally adds a "Name": field in JSON:

    Flashing OpenBeken/OBK firmware to ESP8266/ESP8285 devices

    (both images are with "wrong" index number, which is now corrected - Tasmota will start index with "-1" not with "-0")
  • ADVERTISEMENT
  • Helpful post
    #62 21738294
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    My MAX72xx clock works on ESP8266, nice:
    
    
    startDriver MAX72XX
    // [clk][cs][din]
    MAX72XX_Setup 10 8 9
    startDriver NTP
    startDriver MAX72XX_Clock
    ntp_timeZoneOfs 2
    

    LED display showing time 18:27 connected to an electronic control board
    I had to manually use OBK pin indexes. Probably I need to add a translation function.

    Added after 6 [hours] 51 [minutes]:

    @insmod something wrong may be with OTA on some builds, any ideas?
    
    
    fo:OTA:OTA in progress: 100%, total Write binary data length: 74750
              
    I (227725) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0
    x91904 (596228) map
                                                           
    E (229422) esp_image: unaligned segment length 0xffffffff
              
    
    ror:OTA:Image validation failed, image is corrupted
       
    
    

    https://github.com/openshwprojects/OpenBK7231...mits/fac912391b0eaaf4a1cb18f6f7de753d72848198

    Added after 1 [minutes]:

    or maybe it's due to running drivers

    Added after 7 [minutes]:

    Still, with no drivers. Hm.
    Terminal screenshot showing OTA image validation error on ESP8266
    Or wait, now it worked. Interesting.
    Helpful post? Buy me a coffee.
  • #63 21738998
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    interesting. I have a MAX6675, MAX31855 and MAX31865.

    Thermocouple modules and temperature sensor wires with MAX6675, MAX31855, MAX31865 in packaging
  • #64 21739011
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    You've confused the sensor I use for hot air testing with the display driver.
    https://www.elektroda.com/rtvforum/topic4055231.html

    For now, I am focusing on a display driver for a clock. If you want to test, you need to buy the LED matrix from this topic:
    https://www.elektroda.com/news/news4073144.html

    For now, I'm finishing text scrolling, along with self tests:
    Visual Studio editor showing C code for testing the MAX72XX driver
    Helpful post? Buy me a coffee.
  • #65 21739014
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    p.kaczmarek2 wrote:
    You've confused the sensor I use for hot air testing with the display driver.



    lol. oh yes. that was dumb.
  • #66 21756786
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    Anyone tried Berry on ESP8266? I am confused now, in code it looks like HTTP client thread stack is the same on all platforms.
    
    
    fo:CMD:CMD_StartScript: will run berry import test
                               
    
    fo:BERRY:[berry init]
                                                            
    
    fo:BERRY:[berry start]
                                                           
    
    fo:BERRY:[berry end]
                                                             
    
    fo:BERRY:[berry start]
                                                           
    Stack canary watchpoint triggered (HTTP Client)
                                   
    
                                                   
                                  
    Backtrace: 0x4025193f:0x3fffc790 0x4024c0c6:0x3fffc7a0 0x4024c37a:0x3fffc7b0 0x4
    024c43c:0x3fffc7d0 0x4024c50a:0x3fffc800 0x4024c688:0x3fffc810 0x402535c4:0x3fff
    c830 0x4024f944:0x3fffc860 0x4024f8ac:0x3fffc890 0x402500bc:0x3fffc8c0 0x4025031
    0:0x3fffc9b0 0x40250439:0x3fffcaa0 0x402501c8:0x3fffcad0 0x40250439:0x3fffcbc0 0
    x40250b54:0x3fffcbf0 0x40250e18:0x3fffcc70 Guru Meditation Error: Core  0 panic'
    
     (LoadStoreAlignment). Exception was unhandled.
                                  
    Core 0 register dump:
                                                             
    PC      : 0x4025c387  PS      : 0x00000033  A0      : 0x4025c301  A1      : 0x3f
    
    9fe0  
                                                                           
    A2      : 0x3fffcc6d  A3      : 0x000000c0  A4      : 0x00000000  A5      : 0x00
    
    00a0  
                                                                           
    A6      : 0x3ffea010  A7      : 0x40250cfc  A8      : 0x3fffcc71  A9      : 0x00
    
    07fe  
                                                                           
    A10     : 0x00000090  A11     : 0x00000011  A12     : 0x4024c0c6  A13     : 0x3f
    
    a020  
                                                                           
    A14     : 0x40250e18  A15     : 0x3fffcc70  SAR     : 0x0000001f  EXCCAUSE: 0x00
    
    0009  
                                                                           
    
    
                                                                                 
    Backtrace: 0x4025c387:0x3ffe9fe0 0x40217beb:0x3ffea010 0x40100e84:0x3ffea070 0x4
    
    5c301:0x3ffea090 
       
    
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #68 21757126
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    Ah, indeed, there is redefine. I must have missed that.

    Also, is there OTA file limit? Can it be checked on build? I'm running into that after I enabled OpenWeatherMap:
    
    0), bWifi 1, secondsWithNoPin
    
    965, socks 0/0 
                                                                  
    I (1045456) esp_image: segment 0: paddr=0x00110010 vaddr=0x40210010 size=
    0xb2df4 (732660) map
                                                          
    
    fo:OTA:OTA in progress: 100%, total Write binary data length: 702588
             
    E (1045632) esp_image: unaligned segment length 0xffffffff
             
    
    ror:OTA:Image validation failed, image is corrupted
                              
    Info:MAIN:Time 1032, idle 0/s, free 21096, MQTT 0(60), bWifi 1, secondsWithNoPin
    
    966, socks 0/0 
                                    
    
    

    
    I (173218) esp_image: segment 0: paddr=0x00110010 vaddr=0x40210010 size=0
    xb2df4 (732660) map
                                                           
    I (173388) esp_image: segment 1: paddr=0x001c2e0c vaddr=0x402c2e04 size=0
    x26174 (156020) map
                                                           
    I (173429) esp_image: segment 2: paddr=0x001e8f88 vaddr=0x3ffe8000 size=0
    x01a24 (  6692) 
                                                              
    I (173434) esp_image: segment 3: paddr=0x001ea9b4 vaddr=0x40100000 size=0
    x00080 (   128) 
                                                              
    I (173439) esp_image: segment 4: paddr=0x001eaa3c vaddr=0x40100080 size=0
    x05ad8 ( 23256) 
                                                              
    E (173454) esp_image: Checksum failed. Calculated 0xf0 read 0x0
        
    Info:MAIN:Time 141, idle 0/s, free 10000, MQTT 0(1), bWifi 1, secondsWithNoPing 
    
    , socks 0/0 
                                                                     
    Info:MAIN:Time 
    
                                    
    
    Helpful post? Buy me a coffee.
  • #69 21757469
    Tilator
    Level 12  
    Posts: 130
    Help: 2
    Rate: 13
    I did not find any direct and clear instruction how to flash ESP8266MOD (ESP-12F).

    I did it using ESP.Easy.Flasher.EXE, connected TX and RX as usual, GPIO0 to ground, power on the chip from 5V input and flashed OpenESP uart binary directly to address 0x0.

    So the process was exactly similar which works with old ESP-01 and others too.

    That's it. It did boot as expected.

    Unfortunately OTA update seems not to work.

    Web interface is a bit sticky. It feels like Powersave off helps a bit.
  • #70 21758993
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    It looks I had too many drivers compiled into build. I removed few and OTA works for me. Or at least, in most cases. I alsohave to disable running drivers before OTA, I need to look in the code to make sure it will be done automatically.
    PROTATool window with update log and input for device IP address.
    I am looking into ADC now, it seems it's not ported to HAL.
    https://github.com/espressif/ESP8266_RTOS_SDK/issues/351#issuecomment-435675984

    I also tested DHT11, DHT22, AHT20 with ESP8266 - works fine.
    Also tested Berry - works good if you don't try to run script from HTTP client. Probably LittleFS "reset svm and run script" should add run command to global queue instead of running it in place.

    I also tested OpenWeatherMap integration - works fine, sometimes runs out of memory.

    I also tested Charts driver - works just fine.

    My ESP8266 board:
    ESP8266 board with LED matrix display and multicolored connection wires

    Btw @insmod can you elaborate on this PR?
    github.com/openshwprojects/OpenBK7231T_App/pull/1869
    Helpful post? Buy me a coffee.
  • #71 21759012
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21758993
    Cloned RTOS sdk, so that any patches can be applied directly to repo.
    Increased free heap by about 3K.

    Idle hooks for BL602, RTLs, TR6260 (not tested) and ESPs.
    BL602 without wfi (wait for interrupt)
    "Info:MAIN:Time 39, idle 4190510/s, free 107448, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/21"
    Wfi is in idle hook by default in SDK.
    With wfi there are less than 10000 cycles per second, but should consume less power.

    Near useless on ESPs, since they use tickless idle by default.

    Additional PR for BL602, tested: https://github.com/openshwprojects/OpenBK7231T_App/pull/1868
  • #72 21759023
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    Nice, thank you! Keep it on.

    I've added ADC on ESP8266 and it seems to work, but I need to solder potentiometer to be sure. I will bump pins counter and add it as 13th pin, named ADC and do all the checks.

    Maybe later I will also try to support pin string names in functions where pin indexes are expected, for example, in AHT20 driver init.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #73 21759035
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21759023
    For ADC pin use GPIO_NUM_NC
    Replace only for ESP8266
    int g_numPins = sizeof(g_pins) / sizeof(g_pins[0]);
    with
    int g_numPins = sizeof(g_pins) / sizeof(g_pins[0]) - 1;
    And HAL_PIN_GetPinNameAlias from xradio hal. Again, only for ESP8266
  • #74 21759094
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    Yup, I figured GPIO_NUM_NC out, I didn't see your message. But why:
    Code: C / C++
    Log in, to see the code

    I think setting GPIO_NUM_NC already prevents the crash-calls, as the ADC pin is ADC-only on ESP8266.

    Changing that count would also cause problems here:
    Code: C / C++
    Log in, to see the code

    So I am not sure about that.

    Later I will also need to change int http_fn_cfg_pins to show only ADC option there.
    GPIO configuration dropdown in Tasmota showing ADC options for GPIO5
    Helpful post? Buy me a coffee.
  • #75 21759132
    Tilator
    Level 12  
    Posts: 130
    Help: 2
    Rate: 13
    I was still unable to OTA-update the ESP-01.

    I did remember it wrong, I have changed the flash to Winbond 25Q128FVSG which is 16MB (128mb) chip.

    ESP-12F did update itself. It had 1.18.212 version before while the ESP-01 has older version 1.18.177.
  • #76 21759139
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    insmod wrote:
    >>21759023
    For ADC pin use GPIO_NUM_NC
    Replace only for ESP8266

    Maybe a bit late now, but would using "GPIO_NUM_NC" for the IOs mapped to memory would be an option with ESP8266?
    This way, the index would be equal to IO pin, if I got it right?!?

    Sure, this would break all actual configs, but we might add a "onetime-wrapper" or something.
    But would this break something else?

    
    #elif PLATFORM_ESP8266
    
    espPinMapping_t g_pins[] = {
       { "IO0", GPIO_NUM_0, false }, // 0
       { "IO1", GPIO_NUM_1, false }, // 1
       { "IO2", GPIO_NUM_2, false }, // 2
       { "IO3", GPIO_NUM_3, false }, // 3
       { "IO4", GPIO_NUM_4, false }, // 4
       { "IO5", GPIO_NUM_5, false }, // 5
       { "NC", GPIO_NUM_NC, true }, // 6
       { "NC", GPIO_NUM_NC, true }, // 7
       { "NC", GPIO_NUM_NC, true }, // 8
       { "IO9", GPIO_NUM_9, false }, // 9
       { "IO10", GPIO_NUM_10, false }, // 10
       { "NC", GPIO_NUM_NC, true }, // 11
       { "IO12", GPIO_NUM_12, false }, // 12
       { "IO13", GPIO_NUM_13, false }, // 13
       { "IO14", GPIO_NUM_14, false }, // 14
       { "IO15", GPIO_NUM_15, false }, // 15
       { "IO16", GPIO_NUM_16, false }, // 16
    };
    
    #else
    
  • #77 21759150
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    But why? What is the motiviation behind that?

    I would rather support string pin names in OBK console commands, something like, PIN_Parse(const char *s), and it checks string for pin name match and if it does not match, it returns atoi
    Helpful post? Buy me a coffee.
  • #79 21759160
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    p.kaczmarek2 wrote:
    But why? What is the motiviation behind that?

    My laziness or forgetfulness if using drivers giving pins in startdriver command because I simply forgot to use "8" if I connected sensor to "IO12".
    Usually I start with wrong numbers on ESP8266 :-(

    But you are right, changing startdriver in this case to be more flexible would be better, just use "IO12" for ESP or "B5" on LN882H would make more sense.
  • ADVERTISEMENT
  • #80 21759167
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    Where do we have multiple pins with the same name? Duplicate pin names would show on UI and confuse users, so if there are any, I think we should fix them and make names unique.
    Helpful post? Buy me a coffee.
  • #81 21759172
    Tilator
    Level 12  
    Posts: 130
    Help: 2
    Rate: 13
    p.kaczmarek2 wrote:
    Where do we have multiple pins with the same name?


    ECR6600 seems to have TX2 twice (P0 and P13). TX0 too twice.

    Does not belong to this thread, but because you asked ...
  • #82 21759173
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21759167
    Several NC pins on ESP32, S2 and S3.
  • #83 21759180
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    On S2 it looks like this - we might simply hide "NC" in GU, since we can't configure them anyway, if I understand it right.
    Don't we do this with PWM pins, too???

    List of input/output pins with dropdown menus and value 0 assigned to each
  • #84 21759193
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    ADC role on ESP8266 should be also only visible for ADC pin, just like I shown on screenshot from Tasmota.
    Helpful post? Buy me a coffee.
  • Helpful post
    #85 21759275
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    o.k., seems to work as expected - DS3231 extended like this in

    https://github.com/MaxineMuster/OpenBK7231T_App/tree/refs/heads/ESP8266temp

    Using all IOs, NC for the ones unusable.
    Hiding all pins with alias "NC"
    Adding 17th pin ADC
    Only for ADC pin ADC roles are usable - only for ESP8266 !

    Spoiler:


    diff --git a/../../_DS3231_new/OpenBK7231T_App/src/hal/espidf/hal_pins_espidf.c b/src/hal/espidf/hal_pins_espidf.c
    index 0897af98..97df25e3 100644
    --- a/../../_DS3231_new/OpenBK7231T_App/src/hal/espidf/hal_pins_espidf.c
    +++ b/src/hal/espidf/hal_pins_espidf.c
    @@ -319,13 +319,19 @@ espPinMapping_t g_pins[] = {
        { "IO3", GPIO_NUM_3, false }, // 3
        { "IO4", GPIO_NUM_4, false }, // 4
        { "IO5", GPIO_NUM_5, false }, // 5
    -   { "IO9", GPIO_NUM_9, false }, // 6
    -   { "IO10", GPIO_NUM_10, false }, // 7
    -   { "IO12", GPIO_NUM_12, false }, // 8
    -   { "IO13", GPIO_NUM_13, false }, // 9
    -   { "IO14", GPIO_NUM_14, false }, // 10
    -   { "IO15", GPIO_NUM_15, false }, // 11
    -   { "IO16", GPIO_NUM_16, false }, // 12
    +   { "NC", GPIO_NUM_NC, true },  // 6
    +   { "NC", GPIO_NUM_NC, true },  // 7
    +   { "NC", GPIO_NUM_NC, true },  // 8
    +   { "IO9", GPIO_NUM_9, false }, // 9
    +   { "IO10", GPIO_NUM_10, false }, // 10
    +   { "NC", GPIO_NUM_NC, true },    // 11
    +   { "IO12", GPIO_NUM_12, false }, // 12
    +   { "IO13", GPIO_NUM_13, false }, // 13
    +   { "IO14", GPIO_NUM_14, false }, // 14
    +   { "IO15", GPIO_NUM_15, false }, // 15
    +   { "IO16", GPIO_NUM_16, false }, // 16
    +   // ADC only I guess (no GPIO)
    +   { "ADC", GPIO_NUM_NC, false },  // 17
     };
     
     
    diff --git a/../../_DS3231_new/OpenBK7231T_App/src/httpserver/http_fns.c b/src/httpserver/http_fns.c
    index aafc4b64..4723a155 100644
    --- a/../../_DS3231_new/OpenBK7231T_App/src/httpserver/http_fns.c
    +++ b/src/httpserver/http_fns.c
    @@ -2956,6 +2956,7 @@ int http_fn_cfg_pins(http_request_t* request) {
           "}");
     
        poststr(request, "function f(alias, id, c, b, ch1, ch2) {"
    +      "if (alias.startsWith(\"NC \")) return;"
           "let f = document.getElementById(\"x\");"
           "let d = document.createElement(\"div\");"
           "d.className = \"hdiv\";"
    @@ -2967,6 +2968,10 @@ int http_fn_cfg_pins(http_request_t* request) {
           "d.appendChild(s);"
           "   for (var i = 0; i < sr.length; i++) {"
           "   if(b && sr[i][0].startsWith(\"PWM\")) continue; "
    +#if PLATFORM_ESP8266
    +      "ISADC=sr[i][0].startsWith(\"ADC\");"
    +      "if(alias.startsWith(\"ADC\")) { if (i>0 && ! ISADC) continue;} else { if (ISADC) continue;}"
    +#endif
           "var o = document.createElement(\"option\");"
           "   o.text = sr[i][0];"
           "   o.value = sr[i][1];"
    diff --git a/../../_DS3231_new/OpenBK7231T_App/src/new_pins.h b/src/new_pins.h
    index 080ec13f..5687f244 100644
    --- a/../../_DS3231_new/OpenBK7231T_App/src/new_pins.h
    +++ b/src/new_pins.h
    @@ -1137,7 +1137,8 @@ typedef enum channelType_e {
     #define PLATFORM_GPIO_MAX 0
     #endif
     #elif PLATFORM_ESP8266
    -#define PLATFORM_GPIO_MAX 13
    +//2025-11-22 added NC for unusable IOs 6-8 and 11 plus added ADC, so its 0 to 17 now --> 18 
    +#define PLATFORM_GPIO_MAX 18
     #elif PLATFORM_TR6260
     #define PLATFORM_GPIO_MAX 25
     #elif PLATFORM_RTL87X0C
    



    Now I can use
    
    backlog startdriver DS3231 12 13; DS3231_SetTime 20 45 21 22 11 2025


    for DS3231 on IO12 and IO13.
    And startup command

    startdriver DS3231 12 13 2


    will set device clock on a restart of ESP (sync-option "2" means, "use RTC as master for device clock", so regularly set it to RTCs time)

    Also ADC is present in GUI - and only there are ADC roles possible.

    OpenESP UI screenshot with dropdown menu and configurable IO and ADC pins
    OpenESP8266 GPIO and ADC configuration interface with role dropdown menu
    ADC-code itself is NOT added, just the GUI code ...
  • #86 21769646
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    max4elektroda wrote:
    My laziness or forgetfulness if using drivers giving pins in startdriver command because I simply forgot to use "8" if I connected sensor to "IO12".
    Usually I start with wrong numbers on ESP8266


    Same!
  • #87 21785711
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    I think the pin indexing change for ESP is acceptable so if you want, open a PR
    Helpful post? Buy me a coffee.
  • #89 21846783
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12345
    ESP8266 support for flasher (briefly tested):
    ESP8266 board with OLED showing “Hello World!”, connected via micro USB, in front of a flasher window
    @divadiow
    Helpful post? Buy me a coffee.
  • #90 21846787
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    OMG

    no code for it yet..

Topic summary

✨ The discussion centers on flashing a 2MB OpenBeken/OBK firmware onto a 4MB ESP8266 board. Initial boot logs confirm successful recognition of the 4MB flash size with a detailed partition table including OTA data, WiFi NVS, two OTA app partitions, and an LFS partition. Users report smooth flashing and stable WiFi connectivity without resets after manual reboot. GPIO2 functionality is confirmed. Subsequent updates include added PWM and UART support, with UART implemented via a task-based polling method to avoid crashes seen with interrupt-driven approaches. PWM operates inverted but functional, with PWM_n also working as expected. OTA updates remain non-functional despite passing image checks. Adjustments to QuickTick timer handling and stack size were necessary to prevent crashes. Disabling PWM on GPIO0 resolved bootloop issues. Overall, the firmware demonstrates improved hardware compatibility and peripheral support on the 4MB ESP8266 platform.
Generated by the language model.

FAQ

TL;DR: OpenESP8266 now boots on 1MB, 2MB, 4MB, and 8MB ESP8266/ESP8285 boards, and one developer called the OTA fix "merge-ready" after partition issues were corrected. This FAQ helps builders flash, size, and troubleshoot OpenBeken on ESP8266-class hardware with ESP-Flasher or esptool. [#21597042]

Why it matters: ESP8266 support is usable for testing and many real devices, but flash mode, partition size, OTA headroom, and pin indexing still decide whether a build boots cleanly or crashes.

Topic 1MB flash 2MB flash 4MB/8MB flash
Firmware style seen in thread factory app OTA layout OTA layout
Example boot result confirmed boot confirmed boot after DOUT flashing confirmed boot
LFS space seen 64KB 128KB 192KB in shown 4MB/8MB layouts
OTA status in thread fixed build exists fixed after partition change fixed after partition change

Key insight: Most "bad firmware" symptoms in this thread were not random. They came from three concrete causes: wrong flash mode, wrong partition layout, or too little free flash/RAM for OTA and runtime features. [#21596825]

Quick Facts

  • Boot logs in the thread show OpenESP8266 running with SPI flash sizes of 1MB, 2MB, 4MB, and 8MB. The reported AP fallback IP is 192.168.4.1 after first boot. [#21599222]
  • A full device-hosted WebApp was measured at 287,278 bytes before aggressive minification and 195,261 bytes after complete minification, which is why gzip and LFS matter on small flash targets. [#21597082]
  • On one stable ESP8285 1MB test, free heap stayed around 28,680–29,360 bytes with Wi-Fi connected and no extra drivers started. That is workable, but not generous. [#21599222]
  • OTA failures were traced to partition layout first, then later to oversized builds and active runtime load. One failing OTA log showed a mapped segment of 732,660 bytes before image validation failed. [#21757126]

How do I flash OpenBeken/OpenESP8266 firmware onto an ESP8266 or ESP8285 with ESP-Flasher or esptool, including the correct boot mode wiring and flash address?

Flash the UART or factory image at address 0x0 with the chip in download mode. 1. Wire TX↔RX, hold GPIO0 to GND, and power the module. 2. In ESP-Flasher, write the image to 0x0; with esptool, the thread shows write_flash 0 ...bin. 3. If boot fails on ESP8285-class boards, retry with --flash_mode dout. One tester said the ESP-12F process was the same as ESP-01: GPIO0 low, normal serial wiring, flash to 0x0, and boot succeeded. [#21757469]

Why does OTA update on OpenESP8266 fail with errors like "unaligned segment length 0xffffffff" or "image is corrupted" when the build gets too large?

OTA fails because the second app slot no longer has enough room for the new image. In one failing case, the OTA log mapped a segment of 732,660 bytes and then reported unaligned segment length 0xffffffff and Image validation failed. Later testing showed OTA started working again after removing some compiled drivers and, in practice, stopping running drivers before update. The thread ties this to image size and memory pressure, not to Wi-Fi alone. [#21758993]

What is LFS in OpenBeken/OpenESP8266, and why do logs show messages like "lfs is absent" after first boot?

LFS is a small on-device file system used to store files such as scripts and WebApp assets. "LFS is a flash file system that stores user files inside a dedicated partition, separate from the app image, so firmware can read scripts or web assets after boot." Fresh boots often show lfs is absent because the partition exists in the table but no files have been uploaded yet. The same logs also show failed to get file autoexec.bat, which matches an empty LFS rather than a bad firmware flash. [#21595385]

What is GPIO_NUM_NC in the ESP8266 pin mapping, and how is it used for hidden or non-usable pins like flash-connected GPIOs?

GPIO_NUM_NC marks entries that exist in the index map but should not be driven as real GPIOs. In the proposed ESP8266 remap, indexes 6, 7, 8, and 11 were set to GPIO_NUM_NC, labeled NC, and hidden in the UI so the index numbers could line up with real IO names like IO12 and IO16. The same discussion added a separate ADC entry while keeping unusable flash-connected pins out of normal configuration. [#21759275]

Which partition layout should I use for OpenESP8266 on 1MB, 2MB, 4MB, and 8MB flash chips?

Use the layout that matches the actual flash size and OTA strategy shown by the working boots. The 1MB build used nvs at 0x9000, factory app at 0x10000, and lfs at 0x0f0000. The working 2MB DOUT build used otadata, app0 at 0x10000, lfs at 0x0f0000, app1 at 0x110000, and nvs at 0x1f0000. The 4MB and 8MB examples kept app0/app1 at 0x10000 and 0x0f0000 with larger LFS space around 0x1d0000. [#21597261]

Why does an ESP8266 or ESP8285 boot only after flashing with --flash_mode dout, even when the boot log later reports QIO?

Because the flash write mode used during programming can still decide whether the image lands in a bootable form. In the thread, a 1MB ESP8285H08 booted only after esptool write_flash 0 ... --flash_mode dout, even though the later log still printed SPI Mode : QIO. A separate 2MB case also failed until a flasher run produced a boot log that explicitly showed SPI Mode : DOUT. The practical fix was simple: use DOUT when the module refuses to boot after normal flashing. [#21599222]

What’s the difference between ESP8266 and ESP8285 when running OpenBeken, especially regarding RAM, internal flash, and supported firmware sizes?

They run the same firmware class with the same RAM budget, but they differ in flash packaging. One developer stated that ESP8266 and ESP8285 have the same amount of RAM, while ESP8285 has built-in 1MB flash and ESP8266 uses external SPI flash. That is why the thread shows ESP8285 tests mainly on 1MB and 2MB parts, while ESP8266 boards were tested with 2MB, 4MB, 8MB, and even 16MB-modified hardware. Runtime limits still come mostly from RAM, not just flash size. [#21599257]

How does OpenESP8266 OTA from Tasmota differ from normal OBK OTA, and why does the RTOS SDK vs NONOS SDK mismatch matter?

Tasmota-to-OpenESP8266 OTA is not the same as normal OpenBeken OTA because the frameworks differ. The thread states that Tasmota uses the Arduino framework with NONOS SDK, while OpenESP8266 uses ESP8266 RTOS SDK, so their image expectations and upgrade paths are incompatible by default. A manual bridge is possible only with a special FOTA workflow from Espressif. Standard OBK OTA assumes an RTOS-compatible partition layout and image format, which is why direct Tasmota-style upgrades are not the normal path. [#21597062]

Why is the DHT11 or other sensor shown on the wrong pin number in the OpenESP8266 home page or console when using higher GPIOs like IO14-IO16?

The display is wrong because the UI and some console paths used pin indexes instead of real GPIO aliases. The thread shows DHT11 configured on GPIO14 appearing as pin 10, and other tests found pins 14–16 displayed as 10–12. One maintainer explained that this happens because IO6–IO8 are flash pins and were removed from the visible list, so later entries shift. The sensor was not necessarily wired wrong; the mapping layer was. [#21691202]

What causes Wi-Fi connection problems on OpenESP8266, including first-connect issues, reconnect bugs, and failure to join WPA3 networks?

Early Wi-Fi failures came from unfinished porting, and WPA3 still did not work in the thread. One developer explicitly posted that they fixed Wi-Fi first connect and reconnect, and later testers confirmed the Wi-Fi fix. By contrast, a later log shows repeated handler warnings and immediate disconnect when joining a WPA3 SSID, with no IP address assigned. So first-connect and reconnect bugs were fixed during July 2025, but WPA3 remained unsuccessful in the reported tests. [#21614400]

In OpenBeken on ESP8266, how should pin indexes map to real pin names like IO12 or IO16, and what is the best way to avoid confusion in startDriver commands?

Map indexes so they match real IO numbers, or accept string pin names in commands. The thread shows why users get confused: on the older ESP8266 mapping, IO12 could require index 8 in startDriver, not 12. A proposed fix used NC placeholders for missing pins so index 12 equals IO12 and index 16 equals IO16. Another maintainer preferred parsing names like IO12 directly in commands, which avoids platform-specific mental math entirely. [#21759160]

Where does the free heap go on ESP8266 when enabling MQTT, Home Assistant discovery, Berry, or multiple drivers, and how can low-memory crashes be reduced?

It goes into protocol buffers, task stacks, HTTP client work, and discovery payloads, and ESP8266 does not have much spare RAM. One report shows free heap dropping from 34,284 to 16,812 bytes after Home Assistant discovery, with malloc failure causing a crash. Berry also triggered a Stack canary watchpoint in the HTTP client path, and maintainers said there is simply not enough RAM for heavy features together. Reduce crashes by compiling fewer drivers, disabling active drivers during OTA, and avoiding Berry execution through the HTTP client path. [#21819086]

Which OpenBeken features have been confirmed working on ESP8266 so far, such as PWM, UART, DHT, DS18B20/DS1820, BMP280, ADC, Charts, MAX72XX, and WebApp hosting?

Many core features now work, but some remain rough. Confirmed in the thread are PWM, UART, Wi-Fi reconnect, DHT11/DHT22, DS18B20/DS1820, BMP280, Charts, MAX72XX, and device-hosted WebApp tests. ADC was later added to HAL and UI work was underway. Limits remain: PWM was once inverted, GPIO0 PWM could bootloop, OTA had size limits, and some sensor timing on ESP8266 needed hacky workarounds. Still, by late 2025 multiple testers had real, repeatable success across these drivers. [#21758993]

How can gzip-compressed WebApp files be stored and served from LFS in OpenBeken to save flash space on ESP8266 and other small devices?

Store the WebApp files precompressed in LFS and return them with Content-Encoding: gzip. The thread proposed an LFS lookup that checks for filename.gzip first, then streams that compressed file while keeping a normal fallback path. A maintainer then implemented an "upload as GZIP" button and simple gzip header handling in firmware so the browser decodes the file on the fly. This matters because the fully minified WebApp was measured at 195,261 bytes, which is large for small-flash targets. [#21601376]

ESP8266 vs Tasmota for OpenBeken migration: which JSON naming and sensor reporting conventions should be followed for compatibility with DS18B20, MQTT, and external scripts?

Follow Tasmota naming where possible, especially for DS18B20 JSON keys. The thread shows a real compatibility issue: OpenBeken originally reported DS1820, while Tasmota used DS18B20, forcing external scripts to handle both keys. Maintainers agreed that OBK should follow the Tasmota standard, then changed it and also checked Tasmota’s multi-sensor format using names like DS18B20-1 with an Id field. That keeps MQTT consumers and simple PHP or Home Assistant tooling more portable. [#21702907]
Generated by the language model.
ADVERTISEMENT