logo elektroda
logo elektroda
X
logo elektroda

Configuring OpenBeken on ESP32 with 4MB Default Using sdkconfig.defaults.esp32

insmod 18378 245
ADVERTISEMENT
  • #91 21224451
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    I wonder if SM16703P/PixelAnim/SPI will work...
  • ADVERTISEMENT
  • #92 21224554
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    Fixed crash on reboot. Was a very stupid error. It was, in essence, an infinite loop. Event WIFI_STA_DISCONNECTED called HAL_DisconnectFromWifi, which then triggered WIFI_STA_DISCONNECTED again.
  • #93 21224633
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    ESP-WROOM-32 and ESP32-C2
    reboot - Sep 12 2024 12:58:07 version 1344_merge_f98104065896
    Code: Text
    Log in, to see the code

    ESP-WROOM-32 and ESP32-C2
    reboot - Sep 13 2024 06:29:09 version 1344_merge_12c97a0a2962
    Code: Text
    Log in, to see the code

    great

    Added after 5 [hours] 22 [minutes]:

    insmod wrote:
    Correct, I have done it once. It was an ESP-01 with 1MB flash, I successfully replaced it for 4MB, which then correctly showed up in esptool flash_id.


    I'm going to stick this on my list of things to try. I've a few spare flash chips that would do the job.
  • #94 21226287
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    p.kaczmarek2 wrote:
    I am currently not aware about this problem. The logging was done by @btsimonh , so my knowledge about it may not be perfect. Is it replicable on all platforms, @divadiow ?

    not sure I'm aware of this.

    I can test whatever on different systems though, gimme instructions on setup if desired.
  • ADVERTISEMENT
  • #95 21226307
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21226287 No need now, it is fixed. Problem was with the timer which ran quick_timer_thread. Now i replaced it with hardware timer, which also features increased stack size. No problem since then.
  • #96 21226454
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    Cool.
    What shall I focus on testing next? Just trying currently enabled drivers on the WROOM-03 and C2 boards I have with all the sensors I can get working?

    I think I have an Sx board and maybe H4 coming

    Added after 38 [seconds]:

    Will all the drivers be enabled eventually and presumably they'll all need testing?

    Added after 24 [minutes]:

    divadiow wrote:
    4mb ESP32-C3 on PCB in SPI/PWM LED device (about to solder up to flash)

    I have this flashed with the C3 binary but have yet to get anything PWM working out of it. It's an SP530E. Will make a new post to discuss all I know about it so far.
  • #97 21229008
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    divadiow wrote:
    wonder if SM16703P/PixelAnim/SPI

    if you have time, please enable these two.
  • #98 21229122
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21229008 Impossible to just 'enable', those are dependent on spidma, which are beken n only. I will have to write a new driver to make those work.
  • ADVERTISEMENT
  • #99 21229128
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    >>21229122
    Ah. Thanks for explaining. No worries.
  • #100 21229285
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21226454 Last patch should revert ledc frequency back to 1000hz. Now pwm works on C3 again.
  • #101 21229729
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12344
    insmod wrote:
    which are beken n only. I will have to write a new driver to make those work.

    Maybe we could use this occasion to rewrite the per-pixel LEDs backend. It shouldn't be that problematic, especially now that we have automatic self tests for LED features:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/selftest/selftest_ws2812b.c
    When ran, they should ensure that API works as expected....
    I can extend them also a little.
    We can also test strips in simulator:
    Screenshot from the OpenBeken simulator showing the LED WS2812 connection schematic.
    It works well on Windows, it could also work on Linux (it's using multiplatform SDL), but I would need some help with porting,
    Helpful post? Buy me a coffee.
  • #102 21232111
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    if willing please add #define ENABLE_DRIVER_CHT83XX 1 when convenient

    Added after 8 [hours] 43 [minutes]:

    new toys

    ESP32-C6-WROOM-1
    Code: Text
    Log in, to see the code


    OpenESP32C6 user interface with device information.

    ESP32-S3-WROOM-1
    Code: Text
    Log in, to see the code


    bootloops
    Code: Text
    Log in, to see the code


    ESP32-C3 SuperMini
    Code: Text
    Log in, to see the code

    OpenESP32C3 system interface with system data.

    Added after 7 [hours] 55 [minutes]:

    Code: Text
    Log in, to see the code
    - CHT8310 on ESP32-C3 SuperMini

    Added after 1 [hours] 49 [minutes]:

    1344_merge_ab1a59d9ca19 C3 SuperMini loops

    Code: Text
    Log in, to see the code


    Added after 3 [hours] 45 [minutes]:

    ESP32-C3 SuperMini is back in business with 1344_merge_ba7820a59a2f
    Screenshot of the OpenESP32C3 user interface.
    Code: Text
    Log in, to see the code
  • #104 21234019
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21233915 Enabled, also added setting pwm frequency, along with s3 fix
  • #105 21234047
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    1344_merge_0d72382ec124 ESP32-S3 - success
    User interface of the OpenESP32S3 system showing status and management options.

    Spoiler:
    ESP-ROM:esp32s3-20210327
    Build:Mar 27 2021
    rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
    SPIWP:0xee
    mode:DIO, clock div:1
    load:0x3fce2810,len:0x178c
    load:0x403c8700,len:0x4
    load:0x403c8704,len:0xcb8
    load:0x403cb700,len:0x2db0
    SHA-256 comparison failed:
    Calculated: 5d8444be233343502afbca67fa220cf0117208852fd54c7076bafd3ef1501a8b
    Expected: 5f48a9e52eb3f553e14f520214a3b3dfc8080434805a247fbe614ec203ff9564
    Attempting to boot anyway...
    entry 0x403c8914
    I (45) boot: ESP-IDF c8fc5f64 2nd stage bootloader
    I (45) boot: compile time Sep 21 2024 08:00:55
    I (45) boot: Multicore bootloader
    I (48) boot: chip revision: v0.2
    I (52) boot.esp32s3: Boot SPI Speed : 80MHz
    I (57) boot.esp32s3: SPI Mode : DIO
    I (62) boot.esp32s3: SPI Flash Size : 16MB
    I (67) boot: Enabling RNG early entropy source...
    I (72) boot: Partition Table:
    I (76) boot: ## Label Usage Type ST Offset Length
    I (83) boot: 0 otadata OTA data 01 00 00009000 00002000
    I (90) boot: 1 nvs WiFi data 01 02 0000b000 00005000
    I (98) boot: 2 app0 OTA app 00 10 00010000 001d0000
    I (105) boot: 3 app1 OTA app 00 11 001e0000 001d0000
    I (113) boot: 4 lfs Unknown data 01 82 003b0000 00050000
    I (120) boot: End of partition table
    I (125) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=27940h (162112) map
    I (162) esp_image: segment 1: paddr=00037968 vaddr=3fc99c00 size=05794h ( 22420) load
    I (167) esp_image: segment 2: paddr=0003d104 vaddr=40374000 size=02f14h ( 12052) load
    I (171) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=89480h (562304) map
    I (277) esp_image: segment 4: paddr=000c94a8 vaddr=40376f14 size=12be4h ( 76772) load
    I (294) esp_image: segment 5: paddr=000dc094 vaddr=600fe000 size=00100h ( 256) load
    I (295) esp_image: segment 6: paddr=000dc19c vaddr=600fe100 size=00008h ( 8) load
    I (309) boot: Loaded app from partition at offset 0x10000
    I (310) boot: Disabling RNG early entropy source...
    I (324) cpu_start: Multicore app
    I (333) cpu_start: Pro cpu start user code
    I (333) cpu_start: cpu freq: 160000000 Hz
    I (333) app_init: Application information:
    I (336) app_init: Project name: OpenBeken
    I (341) app_init: App version: 0d72382
    I (346) app_init: Compile time: Sep 21 2024 08:01:28
    I (352) app_init: ELF file SHA256: 1b73de928...
    I (357) app_init: ESP-IDF: c8fc5f64
    I (362) efuse_init: Min chip rev: v0.0
    I (367) efuse_init: Max chip rev: v0.99
    I (372) efuse_init: Chip rev: v0.2
    I (377) heap_init: Initializing. RAM available for dynamic allocation:
    I (384) heap_init: At 3FCA87B0 len 00040F60 (259 KiB): RAM
    I (390) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
    I (396) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
    I (402) heap_init: At 600FE108 len 00001EE0 (7 KiB): RTCRAM
    I (409) spi_flash: detected chip: generic
    I (413) spi_flash: flash io: dio
    I (418) sleep: Configure to isolate all GPIO pins in sleep state
    I (424) sleep: Enable automatic switching of GPIO sleep configuration
    I (442) pm: Frequency switching config: CPU_MAX: 160, APB_MAX: 80, APB_MIN: 40, Light sleep: DISABLED
    I (443) main_task: Started on CPU0
    I (453) main_task: Calling app_main()
    I (453) temperature_sensor: Range [-10°C ~ 80°C], error < 1°C
    I (453) OpenBeken: Entering initLog()...

    I (463) OpenBeken: Commands registered!

    I (463) OpenBeken: initLog() done!

    I (483) OpenBeken: Info:MAIN:Main_Init_Before_Delay

    I (503) OpenBeken:
    Main_Init_Before_Delay done

    I (503) OpenBeken:
    Main_Init_Delay

    I (503) OpenBeken:
    Main_Init_Delay done

    I (513) OpenBeken: Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins
    I (533) OpenBeken: pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info
    I (543) OpenBeken: :MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:MQTT:MQTT_RegisterCallback called for bT es
    I (553) OpenBeken: pDAA2CE60/ subT espDAA2CE60/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT esp/ subT esp/+/set
    Info:MQTT:MQTT_RegisterCa
    I (573) OpenBeken: llback called for bT cmnd/espDAA2CE60/ subT cmnd/espDAA2CE60/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/esp/ subT cm
    I (583) OpenBeken: nd/esp/+
    Info:MQTT:MQTT_RegisterCallback called for bT espDAA2CE60/ subT espDAA2CE60/+/get
    Error:CMD:LFS_ReadFile: lfs is abs
    I (593) OpenBeken: ent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done

    I (1503) OpenBeken: Info:MAIN:Time 1, idle 0/s, free 286748, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (2493) OpenBeken: Info:MAIN:Time 2, idle 0/s, free 286748, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (3483) OpenBeken: Info:MAIN:Time 3, idle 0/s, free 286748, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (4473) OpenBeken: Info:MAIN:Time 4, idle 0/s, free 286748, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (5453) pp: pp rom version: e7ae62f
    I (5453) net80211: net80211 rom version: e7ae62f
    I (5463) OpenBeken: Info:MAIN:Time 5, idle 0/s, free 286748, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (5463) wifi:wifi driver task: 3fcb4214, prio:23, stack:3072, core=0
    I (5463) wifi:wifi firmware version: ccaebfa
    I (5473) wifi:wifi certification version: v7.0
    I (5473) wifi:config NVS flash: disabled
    I (5473) wifi:config nano formating: enabled
    I (5483) wifi:Init data frame dynamic rx buffer num: 32
    I (5483) wifi:Init static rx mgmt buffer num: 5
    I (5493) wifi:Init management short buffer num: 32
    I (5493) wifi:Init dynamic tx buffer num: 32
    I (5493) wifi:Init static tx FG buffer num: 2
    I (5503) wifi:Init static rx buffer size: 1600
    I (5503) wifi:Init static rx buffer num: 10
    I (5513) wifi:Init dynamic rx buffer num: 32
    I (5513) wifi_init: rx ba win: 6
    I (5513) wifi_init: accept mbox: 6
    I (5523) wifi_init: tcpip mbox: 32
    I (5523) wifi_init: udp mbox: 6
    I (5533) wifi_init: tcp mbox: 6
    I (5533) wifi_init: tcp tx win: 5760
    I (5533) wifi_init: tcp rx win: 5760
    I (5543) wifi_init: tcp mss: 1440
    I (5543) wifi_init: WiFi IRAM OP enabled
    I (5553) wifi_init: WiFi RX IRAM OP enabled
    I (5553) phy_init: phy_version 680,a6008b2,Jun 4 2024,16:41:10
    I (5593) wifi:mode : sta (d8:3b:da:a2:ce:60) + softAP (d8:3b:da:a2:ce:61)
    I (5593) wifi:enable tsf
    I (5593) wifi:Total power save buffer number: 16
    I (5603) wifi:Init max length of beacon: 752/752
    I (5603) wifi:Init max length of beacon: 752/752
    I (5613) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
    I (6613) OpenBeken: Info:MAIN:Time 6, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0
    Info:MAIN:Boot complete time rea
    I (6623) OpenBeken: ched (5 seconds)

    I (7613) OpenBeken: Info:MAIN:Time 7, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (8603) OpenBeken: Info:MAIN:Time 8, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (9593) OpenBeken: Info:MAIN:Time 9, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (10573) OpenBeken: +--------------- net device info ------------+

    I (10573) OpenBeken: |netif type : AP |

    I (10573) OpenBeken: |netif ip = 192.168.4.1 |

    I (10583) OpenBeken: Info:MAIN:Time 10, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (10593) OpenBeken: |netif mask = 255.255.255.0 |

    I (10593) OpenBeken: |netif gateway = 192.168.4.1 |

    I (10603) OpenBeken: |netif mac : [D8] |

    I (10613) OpenBeken: +--------------------------------------------+

    I (11613) OpenBeken: Info:MAIN:Time 11, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (12603) OpenBeken: Info:MAIN:Time 12, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (13593) OpenBeken: Info:MAIN:Time 13, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (14583) OpenBeken: Info:MAIN:Time 14, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (15573) OpenBeken: Info:MAIN:Time 15, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (16563) OpenBeken: Info:MAIN:Time 16, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (17553) OpenBeken: Info:MAIN:Time 17, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (18543) OpenBeken: Info:MAIN:Time 18, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (19533) OpenBeken: Info:MAIN:Time 19, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (20513) OpenBeken: +--------------- net device info ------------+

    I (20513) OpenBeken: |netif type : AP |

    I (20513) OpenBeken: |netif ip = 192.168.4.1 |

    I (20523) OpenBeken: Info:MAIN:Time 20, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (20533) OpenBeken: |netif mask = 255.255.255.0 |

    I (20533) OpenBeken: |netif gateway = 192.168.4.1 |

    I (20543) OpenBeken: |netif mac : [D8] |

    I (20553) OpenBeken: +--------------------------------------------+

    I (21553) OpenBeken: Info:MAIN:Time 21, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (22543) OpenBeken: Info:MAIN:Time 22, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0

    I (23533) OpenBeken: Info:MAIN:Time 23, idle 0/s, free 248660, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0



    Added after 38 [minutes]:

    1344_merge_0d72382ec124 - SHT3X driver tests

    Screenshot showing test results for ESP32-S3 using the SHT3X driver, displaying temperature and humidity. Screenshot showing readings from OpenESP32C2 system, indicating a temperature of 24.5°C and humidity of 62 from SHT3X sensor. Screenshot displaying data from ESP32C3, including SHT3X sensor readings of 24.5°C temperature and 61 humidity. Screenshot showing test results on ESP32-C6. ESP32 interface with temperature and humidity readings from SHT3X sensor without a humidity unit.

    curious the SHT3X driver doesn't give a decimal for humidity or have a "%" unit
  • #106 21234391
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12344
    p.kaczmarek2 wrote:
    insmod wrote:
    which are beken n only. I will have to write a new driver to make those work.

    Maybe we could use this occasion to rewrite the per-pixel LEDs backend. It shouldn't be that problematic, especially now that we have automatic self tests for LED features:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/selftest/selftest_ws2812b.c
    When ran, they should ensure that API works as expected....
    I can extend them also a little.

    @insmod @divadiow as mentioned in simulator thread:
    https://www.elektroda.com/rtvforum/topic4046056.html#21233963
    with todays update, selftests are run on Github. This means that selftest_ws2812b.c will run with each commit. And it will tell you if it fails, so you can tell whether you've broken expected API pattern or not. Just look for green check or red cross mark next to commit.

    Hopefully this will make easier for people to introduce new features without breaking old stuff.
    Helpful post? Buy me a coffee.
  • #107 21238166
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    insmod wrote:
    I have done it once. It was an ESP-01 with 1MB flash, I successfully replaced it for 4MB, which then correctly showed up in esptool flash_id.


    ah yeh. that was easy. swapped 1mb XMC on this ESP-01S for an 8mb Winbond from a dead router
    ESP-01S with replaced memory chip against a laptop background.
    ESP-01S module with a replaced chip, placed next to two smaller chips. Close-up of an ESP-01S module featuring an ESP8266EX chip and replaced 8MB Winbond memory chip.

    Code: Text
    Log in, to see the code

    Code: Text
    Log in, to see the code

    Screenshot showing hardware specifications of ESP8266EX, including 8MB flash memory capacity.

    ready for OpenESP port testing 😉
  • #109 21238223
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14406
    Help: 650
    Rate: 12344
    With 8MB of flash and with some clever code, we could host very large sites on the LittleFS in OBK.
    Helpful post? Buy me a coffee.
  • #110 21239799
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    divadiow wrote:
    I think I have an Sx board and maybe H4 coming

    lol. It was an H2 which is of course BLE/Thread/ZigBee. oh well.
    Code: Text
    Log in, to see the code
  • #111 21244324
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    Pushed an update, contains merge with master. The last commit will hopefully fix i2c. I was able to successfully use aht20/bmp280 module on ESP32-C3 7-SCL, 6-SDA pins.
  • #112 21244376
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    thank you. I asked GPT what those changes in the commit actually mean.
    Code: Text
    Log in, to see the code


    Is this correct?
  • #113 21244951
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21244376 Partially correct. Main change, is that gpio are now properly configured, using gpio_config(). That function dumps the pin configuration to the uart log, so it shouldn't be called often. I2C changes reflect this, because without them - heavy lag or crash. The rest is more or less what GPT answered.
  • #114 21245804
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    insmod wrote:
    Additionally have 2 of the fake ESP32-S2 Mini

    couldn't see a screenshot of your S2 mini with OBK. Did you get it running? I've WinUSB/DFU flashed the S2 factory.bin
    Screenshot of ESP3252 Flash Download Tool V3.9.7 with firmware file loaded.
    but im not seeing any AP. Not log out either on the USB/WinUSB com port, but maybe that's the USB-CDC thing that needs enabling.

    I flashed Tasmmota32 S2-CDC in case my unit was duff. I get some logs and:
    Screenshot showing technical details of ESP32-S2R2 microcontroller.
  • #115 21246079
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    divadiow wrote:
    S2 mini with OBK.

    I flashed my (probably fake) S2 mini "ages ago" #44
    But I don't remember exactly how, iirc it was quite simple (on Linux):
    Press"RST" and "0", release "RST" and the device "ttyACM0" came up.

    In my command history I found:

    esptool.py -p /dev/ttyACM0  write_flash 0  OpenESP32S2_dev_20240910_131614.factory.bin
  • ADVERTISEMENT
  • #116 21246088
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21246079 I debugged the problem, currently there is a stack overflow in internal temperature measurement. Fix is the same, as in S3.
    For some reason, when enabling CONFIG_ESP_CONSOLE_USB_CDC, it shows up some time later with error 43.
    Also, my fake S2 doesn't connect out-of-the-box, i had to set txpower to 10 (powersave 0 10) in startup command.
  • #117 21246113
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Just retried - it works like that
    Screenshot showing the firmware upload process to ESP32S2 and the OpenESP32S2 web interface.
  • #118 21246119
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21246113 It's AP mode, it already defaults to 10dBm. Try to connect to station. If it's a fake S2 mini, then it will fail. (yours is possibly not a fake, my is rev v0.0)
  • #119 21246152
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    This was just a coincidence.
    I just wanted to test, if I remembered the way to install OBK.
    I had a very early version before (running as client for quite some time).

    And you are right, I can connect as client (using the version of your latest commit)
    My board looks quite different to the images on wemos page or the comparison here.

    But maybe the makers of my device put more effort into copying the function but the look ;-)
  • #120 21246278
    divadiow
    Level 38  
    Posts: 4849
    Help: 421
    Rate: 854
    max4elektroda wrote:
    I flashed my (probably fake) S2 mini "ages ago" #44

    oh. duh. must have zoomed past it.
    :D OpenESP32S2 user interface displaying system information and configuration buttons.
    I think I might have the whole set now.

    Added after 1 [minutes]:

    dunno if mine's fake
    Purple printed circuit board with USB-C port and chip on a blue background. Printed circuit board with labels on a blue background.

Topic summary

✨ The discussion centers on configuring OpenBeken firmware for ESP32 devices with a default 4MB flash size using sdkconfig.defaults.esp32. Initial issues included missing sdkconfig.defaults.esp32 and bootloader offset misconfiguration, which were resolved to enable successful compilation and flashing. Various ESP32 variants were tested, including ESP32-C3, ESP32-C6, ESP32-CAM, ESP32-C2, ESP32-D0WDQ5-V3 (ESP-WROOM-32), and ESP32-S3, with reports on flash size detection, bootloader behavior, and peripheral support. Challenges encountered involved stack overflows on reboot, watchdog timer resets, and GPIO functionality inconsistencies, particularly on non-C/S ESP32 boards. Solutions included adjusting makefiles for 4MB flash, fixing bootloader offsets, increasing task stack sizes, and replacing software timers with hardware timers for improved timing accuracy. Peripheral drivers such as BMP280, AHT2x, DS1820, DHT11/22, PWM, UART, and NTP were tested with varying success; some required specific pin assignments or additional delays to prevent crashes. Deep sleep support was added without GPIO wakeup. The firmware uses the Espressif ESP-IDF SDK for ESP32 and plans for ESP8266 porting were discussed, noting SDK differences and RAM constraints. Continuous integration (CI) and online build availability were confirmed. Users shared flashing tools, partition table considerations, and debugging tips including esptool flash_id and efuse burning. The community actively tested and reported logs, crashes, and feature functionality, contributing to iterative fixes and enhancements.
Generated by the language model.

FAQ

TL;DR: 4MB stało się domyślną bazą dla OpenESP32, a autor poprawki napisał: "Now configured with 4MB by default". Ten FAQ jest dla osób uruchamiających OpenBeken na ESP32 i wyjaśnia, jak dobrać build, rozwiązać błędy partycji, bootloadera, OTA, UART i Wi‑Fi na C2, C3, S2, S3 oraz klasycznym ESP32. [#21220790]

Dlaczego to ważne: Błędny rozmiar flash, zły offset bootloadera albo niewłaściwy typ obrazu potrafią dać „invalid header”, bootloop albo bezpieczny tryb AP mimo sprawnego sprzętu.

Wariant Typowy flash z wątku Co działało najlepiej Najczęstszy problem
ESP32-C3 4MB Wi‑Fi, OTA, PWM, czujniki I2C SuperMini miewa problemy z Wi‑Fi i DHCP
Klasyczny ESP32 4MB, czasem wykrywany jako 2MB GPIO, OTA, Wi‑Fi po poprawnym flashu błędy tabeli partycji i safe mode po reboocie
ESP32-S2/S3 4MB lub 16MB DS1820, GPIO, AP/STA po poprawkach stack overflow, problemy z temperaturą wewnętrzną
ESP32-C2 4MB podstawowe funkcje, PWM mało RAM, czułość na taktowanie i baud
ESP8266 1MB, 4MB, 8MB po swapie eksperymenty po rozdzieleniu wątku zbyt mały flash dla dual-OTA przy 8Mbit

Najważniejszy wniosek: Na ESP32 najpierw dobierz właściwy obraz do realnego flashu i układu, a dopiero potem diagnozuj skrypty, UART lub Wi‑Fi. W wątku większość „magicznych” awarii okazała się skutkiem złego rozmiaru flash, złego offsetu bootloadera albo użycia factory.bin zamiast .img. [#21221363]

Quick Facts

  • Domyślna konfiguracja ESP32 została przestawiona na 4MB flash, bo brakowało sdkconfig.defaults.esp32; to była kluczowa poprawka startowa całego portu. [#21220790]
  • Na ESP32-C3 poprawny boot pokazał partycje app0 0x10000, app1 0x100000 i LFS 0x1EF000, przy wykrytym flashu 4MB oraz SPI 80MHz/DIO. [#21221080]
  • Jeden z modułów ESP32-C5 pobierał przy starcie AP około 1,4 W / 0,3 A przy 5 V, czyli w przybliżeniu 0,5 A przy 3,3 V; to tłumaczy brownouty przy słabym zasilaniu. [#21648381]
  • Dla problematycznych płytek ESP32-C3 SuperMini obniżenie mocy Wi‑Fi do 10 dBm, a nawet 6 dBm, poprawiało łączenie z DHCP. [#21450268]
  • W sterowniku BP5758D padały konkretne prądy robocze: domyślnie 14 mA, w ESPHome 10 mA, a w praktyce dla GU10 sprawdzało się nawet 8 mA na kanałach. [#21246766]

How do I configure OpenBeken on ESP32 to use 4MB flash by default with sdkconfig.defaults.esp32?

Dodaj brakujący plik sdkconfig.defaults.esp32 i ustaw w nim wariant 4MB jako domyślny dla ESP32. To właśnie ta zmiana odblokowała poprawny start portu i autor podsumował ją krótko: „Now configured with 4MB by default”. Jeśli tworzysz także obraz scalony, dopasuj --flash_size 4MB, bo samo SDK nie naprawi błędnego merge bin. [#21220790]

Why does OpenESP32 factory.bin fail to boot with partition table errors on some ESP32 boards that actually have 4MB flash?

Najczęściej dlatego, że obraz factory.bin został zmergowany z nagłówkiem 2MB, mimo że płytka ma fizycznie 4MB. W logu widać wtedy SPI Flash Size : 2MB, a zaraz potem błąd typu partition ... exceeds flash chip size 0x200000. W wątku poprawka polegała na zmianie polecenia esptool.py merge_bin z --flash_size 2MB na --flash_size 4MB, bez zmiany samej płyty. [#21221363]

What is the difference between OpenBeken factory.bin and non-factory .img builds on ESP32, and when should each one be flashed?

factory.bin to obraz scalony z bootloaderem, tabelą partycji i aplikacją, a .img to zwykle sam obraz aplikacji do istniejącego układu partycji. Gdy układ startuje od zera, po erase_flash, albo masz uszkodzone partycje, użyj factory.bin. Gdy bootloader i partycje już są poprawne, często bezpieczniej użyć .img; w wątku klasyczny ESP32 ruszył po przejściu z factory na non-factory. [#21221359]

How can I erase_flash and reflash OpenBeken correctly on ESP32, ESP32-C3, and ESP32-S2 boards when GPIOs or boot behavior seem broken?

Najbezpieczniej wykonaj pełne czyszczenie i dopiero potem ponowny flash. 1. Uruchom erase_flash, aby usunąć stare partycje, konfigurację i błędne autostarty. 2. Wgraj właściwy obraz dla układu i realnego flashu: factory.bin przy czystym starcie albo .img przy istniejących partycjach. 3. Na S2 wejdź w boot przez przyciski RST i 0, a potem sprawdź log i AP przed testem GPIO. Ten schemat przywrócił poprawne działanie LED-ów i factory.bin na kilku płytkach. [#21221622]

Why did the ESP32-C3 merge initially fail with invalid header errors, and how does the bootloader offset at 0x0 vs 0x1000 affect flashing?

Bo przy merge dla C3 bootloader trafił pod zły adres. Autor poprawki napisał wprost, że „bootloader must be at 0x0, instead of 0x1000”, a wcześniejszy układ dawał serię invalid header. Na ESP32-C3 boot ROM oczekiwał bootloadera od 0x0, więc obraz z offsetem 0x1000 wyglądał jak uszkodzony mimo poprawnego flashowania. [#21221037]

What causes OpenBeken script timing to run too slowly on ESP32, and how do QUICK_TMR_DURATION, vTaskDelay, and esp_timer_get_time relate to the fix?

Problem wynikał z błędnego liczenia g_deltaTimeMS i z niepoprawnego użycia opóźnienia FreeRTOS. Poprawa miała dwa elementy: dla ESP-IDF czas zaczęto brać z esp_timer_get_time()/1000, a w wątku timera zmieniono vTaskDelay(QUICK_TMR_DURATION) na vTaskDelay(QUICK_TMR_DURATION / portTICK_RATE_MS). To ograniczyło dryf, który wcześniej dawał wynik około MAIN:Time 150 przy kanale zwiększonym tylko do 121. [#21221114]

How do flash encryption flags and eFuse settings on an ESP32-C3 device affect whether OpenBeken can boot after flashing?

Włączone szyfrowanie flash może zablokować start zwykłego obrazu, nawet gdy sprzęt ma poprawne 4MB i sam flash zapisze się bez błędów. W wątku jeden ESP32-C3 miał Flash Encryption: Enabled i nie startował jak zwykła płytka deweloperska. Po zmianie eFuse tak, by raport pokazywał Flash Encryption: Disabled oraz SPI_BOOT_CRYPT_CNT: 0x3, urządzenie zaczęło bootować OpenBeken poprawnie. [#21221080]

What is LittleFS or LFS in OpenBeken, and why do ESP logs sometimes say 'lfs is absent' even when scripts appear to work later?

„LittleFS” jest lekkim systemem plików flash, który przechowuje skrypty, pliki startowe i inne dane trwałe, a jego kluczową cechą jest praca na wydzielonej partycji flash zamiast w RAM. Log lfs is absent oznacza zwykle brak zamontowanej partycji LFS lub jeszcze nieutworzony system plików. W wątku ten komunikat pojawiał się przy starcie, ale później testy pokazały, że skrypty i zapis zaczęły działać po dalszych poprawkach partycji i flashowania. [#21221088]

What is TCA9554, and why is that I2C expander needed to run OpenESP32 on boards like the Waveshare ESP32-S3-ETH-8DI-8RO?

„TCA9554” jest ekspanderem I2C, który dodaje 8 linii wejścia/wyjścia GPIO, a jego główną cechą jest sterowanie dodatkowymi sygnałami przez magistralę I2C zamiast bezpośrednio z MCU. Na płytce Waveshare ESP32-S3-ETH-8DI-8RO ten układ steruje sekcją przekaźników, więc bez jego obsługi OpenESP32 nie potrafi przełączać wyjść. Dlatego w wątku wskazano, że TCA9554 jest wymagany, aby ta płyta miała sensowną obsługę pod OpenESP32. [#21640201]

ESP32-C2 vs ESP32-C3 vs classic ESP32 vs ESP32-S3 for OpenBeken — which one is currently the better choice for stability, Wi-Fi, sensors, and OTA?

Najbezpieczniejszym wyborem z wątku jest ESP32-C3 albo poprawnie zasilony ESP32-S3. C3 miał działające Wi‑Fi, OTA, PWM i czujniki I2C, choć wersje SuperMini wymagały czasem obniżenia mocy TX. Klasyczny ESP32 działał, ale częściej wpadał w safe mode, miał problemy z restartem i błędami partycji. C2 działał, lecz był bardziej ograniczony RAM-em; autor napisał wprost, że „ESP32-C2 is already struggling”. [#21223468]

How can I diagnose ESP32 reboot loops, WDT safe mode, or stack overflow crashes in OpenBeken after restart, OTA, NTP start, or saving pins?

Najpierw patrz na dokładny powód resetu i nazwę zadania z logu. Jeśli widzisz TG0WDT_SYS_RESET lub TG1WDT_SYS_RESET, szukaj blokującego kodu, a nie problemu RTC WDT. Jeśli log mówi o stack overflow w sys_evt, quick albo IntTemp, zwiększ stack albo znajdź pętlę rekurencyjną. W wątku restart rozbijał się o nieskończoną pętlę: WIFI_STA_DISCONNECTED wywoływało HAL_DisconnectFromWifi, które generowało ten sam event ponownie. [#21224554]

What is the best way to test UART on OpenESP32 with TuyaMCU, and why can UART receive still behave inconsistently even when transmit works?

Najlepiej testować UART na prawdziwym urządzeniu z TuyaMCU i osobno sprawdzić TX oraz RX. Autor portu podał, że nadawanie działało, ale odbiór wymagał obejścia: po UART_AppendByteToReceiveRingBuffer dodał vTaskDelay(3), aby uniknąć crasha. To stabilizowało pracę, ale przy większym strumieniu danych nadal mogło przepełnić bufor, wywołać flush wejścia i reset kolejki. [#21222660]

How do I reduce Wi-Fi issues on ESP32-C3 SuperMini boards in OpenBeken, including slow DHCP or failed connections, with commands like powersave 1 10?

Obniż moc nadawania i nie zakładaj, że domyślne 20 dBm będzie stabilne. Dla ESP32-C3 SuperMini w wątku zalecono powersave 1 10, gdzie 10 oznacza 10 dBm, a w jednym przypadku urządzenie połączyło się dopiero przy 6 dBm. To pomogło przy wolnym DHCP, braku adresu IP i niestabilnych połączeniach, typowych właśnie dla SuperMini. [#21450298]

Can I upgrade an ESP8266 or ESP-01 flash chip from 1MB to 4MB or 8MB for OpenBeken, and what should I verify with esptool afterward?

Tak, taka podmiana została potwierdzona praktycznie. W wątku wymieniono flash w ESP-01 z 1MB na 4MB, a później także na 8MB w innym module, po czym esptool flash_id poprawnie raportował nowy rozmiar pamięci. Po wymianie zawsze sprawdź producenta układu, kod urządzenia i Detected flash size, bo to jedyny szybki sposób potwierdzenia, że lutowanie i konfiguracja SPI są poprawne. [#21238166]

How can I create a global float variable or pulse counter in OpenBeken on ESP32-C3 for water meters when each pulse represents 10 liters?

W pokazanym fragmencie wątku nie ma gotowej, potwierdzonej implementacji globalnego floata ani licznika impulsów dla 10 litrów na impuls. Jest tylko pytanie użytkownika o taki licznik po uruchomieniu logiki addChangeHandler, bez dalszej odpowiedzi z działającym rozwiązaniem. Jeśli chcesz pozostać zgodny z tym wątkiem, jedyną potwierdzoną ścieżką jest dalszy eksperyment ze skryptami lub Berry, ale bez gotowej recepty opisanej w podanych postach. [#21798097]
Generated by the language model.
ADVERTISEMENT