wildekek / rdtech-esphome

Add Home Assistant support to your RDTech power supply
MIT License
32 stars 7 forks source link

Support for ESP8684-WROOM-04C #10

Open Furkan2000 opened 2 months ago

Furkan2000 commented 2 months ago

hey, i cant install the esphome yaml on my wifi module that came with the RD6018W as the moudle is a esp32 unit i think . it says its a ESP8684-WROOM-04C. what am i supposed to do? 20240530_203833

wildekek commented 2 months ago

I think RDTECH decided to include a new ESP version for later models. It's hard for me to test without having the unit on hand, but you could try modifying the esphome config and using ESP IDF 5.0 or 5.1: https://github.com/esphome/feature-requests/issues/1897

Furkan2000 commented 2 months ago

so i dont really know what i am doing here XD i tried adding version 5.1 and 5.0 but both give me this error `INFO ESPHome 2024.5.4 INFO Reading configuration /config/esphome/rd6018.yaml... Failed config

esp32: [source /config/esphome/rd6018.yaml:11] board: esp32-c3-devkitm-1

Not a valid version number. framework: type: esp-idf version: 5.1 `

ferbulous commented 1 month ago

Hi, did you have success flashing on the esp32c2 board?

wildekek commented 1 month ago

I ordered one of these boards just now, should arrive in about two weeks. Once I have it, I need to do some testing and I'll release a new version. Should be fairly trivial.

Furkan2000 commented 1 month ago

i did not have any success but im also a noob so i cant help much. waiting patiently for the new version

helloworldtest123 commented 1 month ago

Can anyone test this, it compiles fine but I don't have the new module to test:

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  flash_size: 2MB
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip

Set flash_size according to the chip. If the chip is labelled H2 then 2MB and for H4 4MB.

ferbulous commented 1 month ago

Can anyone test this, it compiles fine but I don't have the new module to test:

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip

Hi, doesn't seem to boot I'm just getting gibberish in the logs

▒dln▒▒{▒ocbc▒l'
▒▒▒▒g|▒g▒ls{▒c▒g▒l'

Here's my yaml

esphome:
  name: esp32c2-test
  friendly_name: esp32c2-test

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32C2-Test Fallback Hotspot"
    password: !secret ap_password

captive_portal:

web_server:
  port: 80

# esp32_ble_tracker:
#   scan_parameters:
#     active: true

# bluetooth_proxy:
#   active: true    

sensor:
  - platform: uptime
    name: $friendlyname Uptime
    update_interval: 60s
helloworldtest123 commented 1 month ago

What baud rate are you using? Since your yaml does not define anything, I think that esphome uses 115200. The chip probably has a 26Mhz XTAL instead of 40Mhz. Then the baud rate is 74880. Try this:

logger:
  baud_rate: 74880

I also noticed that the chip only has 2MB...so very small.

ferbulous commented 1 month ago

What baud rate are you using? The chip probably has a 26Mhz XTAL instead of 40Mhz. Then the baud rate is 74880. I also noticed that the chip only has 2MB...so very small.

I was using 115200, Here's the details for the chip

Serial port COM3
Connecting....
Detecting chip type... ESP32-C2
Chip is ESP32-C2 (revision v1.0)
Features: WiFi, BLE
Crystal is 26MHz
MAC: 08:3a:8d:65:18:e0
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...

Mine is the 4mb variant, ok I'll try using that baud rate

5.1.4.240712 2nd stage bootloader
I (7) boot: compile time Jul 22 2024 02:57:51
I (7) boot: chip revision: v1.0
I (10) boot.esp32c2: MMU Page Size  : 32K
I (15) boot.esp32c2: SPI Speed      : 60MHz
I (20) boot.esp32c2: SPI Mode       : DIO
I (24) boot.esp32c2: SPI Flash Size : 4MB
I (29) boot: Enabling RNG early entropy source...
I (34) boot: Partition Table:
I (38) boot: ## Label            Usage          Type ST Offset   Length
I (45) boot:  0 otadata          OTA data         01 00 00009000 00002000
I (53) boot:  1 phy_init         RF data          01 01 0000b000 00001000
I (60) boot:  2 app0             OTA app          00 10 00010000 001c0000
I (68) boot:  3 app1             OTA app          00 11 001d0000 001c0000
I (75) boot:  4 nvs              WiFi data        01 02 00390000 0006d000
I (83) boot: End of partition table
I (87) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=250d8h (151768) map
I (129) esp_image: segment 1: paddr=00035100 vaddr=3fcae590 size=02438h (  9272) load
I (132) esp_image: segment 2: paddr=00037540 vaddr=40380000 size=08ad8h ( 35544) load
I (144) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=8ae50h (568912) map
I (271) esp_image: segment 4: paddr=000cae78 vaddr=40388ad8 size=05ab4h ( 23220) load
I (282) boot: Loaded app from partition at offset 0x10000
I (282) boot: Disabling RNG early entropy source...
I (293) cpu_start: Unicore app
I (294) cpu_start: Pro cpu up.
I (302) cpu_start: Pro cpu start user code
I (302) cpu_start: cpu freq: 120000000 Hz
I (302) cpu_start: Application information:
I (305) cpu_start: Project name:     esp32c2-test
I (311) cpu_start: App version:      2024.7.0
I (316) cpu_start: Compile time:     Jul 22 2024 03:03:10
I (322) cpu_start: ELF file SHA256:  f3a5299f12ba8743...
I (328) cpu_start: ESP-IDF:          5.1.4.240712
I (333) cpu_start: Min chip rev:     v1.0
I (338) cpu_start: Max chip rev:     v1.99
I (343) cpu_start: Chip rev:         v1.0
I (347) heap_init: Initializing. RAM available for dynamic allocation:
I (355) heap_init: At 3FCB4AC0 len 000280B0 (160 KiB): D/IRAM
I (361) heap_init: At 3FCDCB70 len 0000294C (10 KiB): STACK/DRAM
I (369) spi_flash: detected chip: gd
I (372) spi_flash: flash io: dio
I (376) sleep: Configure to isolate all GPIO pins in sleep state
I (383) sleep: Enable automatic switching of GPIO sleep configuration
I (390) app_start: Starting scheduler on CPU0
I (395) main_task: Started on CPU0
I (399) main_task: Calling app_main()
I (484) main_task: Returned from app_main()
[I][logger:156]: Log initialized
                                [C][safe_mode:079]: There have been 4 suspected unsuccessful boot attempts
                                                                                                          [D][esp32.preferences:114]: Saving 1 preferences to flash...
         [D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
                                                                                                 [I][app:029]: Running through setup()...
                                                                                                                                         [C][wifi:047]: Setting up WiFi...
             [D][esp-idf:000]: I (500) pp: pp rom version: de8c800

                                                                  [D][esp-idf:000]: I (501) net80211: net80211 rom version: de8c800

                                                                                                                                   [D][esp-idf:000]: I (510) wifi:
     [D][esp-idf:000]: wifi driver task: 3fcbf630, prio:23, stack:6144, core=0
                                                                              [D][esp-idf:000]:

                                                                                                [D][esp-idf:000][wifi]: I (531) wifi:
                                                                                                                                     [D][esp-idf:000][wifi]: wifi firmware version: c2e8f6e45
                                [D][esp-idf:000][wifi]:

                                                        [D][esp-idf:000][wifi]: I (539) wifi:
                                                                                             [D][esp-idf:000][wifi]: wifi certification version: v7.0
                                                                                                                                                     [D][esp-idf:000][wifi]:

                [D][esp-idf:000][wifi]: I (559) wifi:
                                                     [D][esp-idf:000][wifi]: config NVS flash: enabled
                                                                                                      [D][esp-idf:000][wifi]:

                                                                                                                              [D][esp-idf:000][wifi]: I (580) wifi:
      [D][esp-idf:000][wifi]: config nano formating: enabled
                                                            [D][esp-idf:000][wifi]:

                                                                                    [D][esp-idf:000][wifi]: I (590) wifi:
                                                                                                                         [D][esp-idf:000][wifi]: Init data frame dynamic rx buffer num: 32
                             [D][esp-idf:000][wifi]:

                                                     [D][esp-idf:000][wifi]: I (611) wifi:
                                                                                          [D][esp-idf:000][wifi]: Init static rx mgmt buffer num: 5
                                                                                                                                                   [D][esp-idf:000][wifi]:

              [D][esp-idf:000][wifi]: I (631) wifi:
                                                   [D][esp-idf:000][wifi]: Init management short buffer num: 32
                                                                                                               [D][esp-idf:000][wifi]:

                                                                                                                                       [D][esp-idf:000][wifi]: I (641) wifi:
               [D][esp-idf:000][wifi]: Init dynamic tx buffer num: 32
                                                                     [D][esp-idf:000][wifi]:

                                                                                             [D][esp-idf:000][wifi]: I (662) wifi:
                                                                                                                                  [D][esp-idf:000][wifi]: Init static tx FG buffer num: 2
                            [D][esp-idf:000][wifi]:

                                                    [D][esp-idf:000][wifi]: I (682) wifi:
                                                                                         [D][esp-idf:000][wifi]: Init static rx buffer size: 1600
                                                                                                                                                 [D][esp-idf:000][wifi]:

            [D][esp-idf:000][wifi]: I (703) wifi:
                                                 [D][esp-idf:000][wifi]: Init static rx buffer num: 10
                                                                                                      [D][esp-idf:000][wifi]:

                                                                                                                              [D][esp-idf:000][wifi]: I (713) wifi:
      [D][esp-idf:000][wifi]: Init dynamic rx buffer num: 32
                                                            [D][esp-idf:000][wifi]:

                                                                                    [D][esp-idf:000]: I (724) wifi_init: rx ba win: 6

                                                                                                                                     [D][esp-idf:000]: I (734) wifi_init: tcpip mbox: 32

                           [D][esp-idf:000]: I (734) wifi_init: udp mbox: 6

                                                                           [D][esp-idf:000]: I (744) wifi_init: tcp mbox: 6

                                                                                                                           [D][esp-idf:000]: I (754) wifi_init: tcp tx win: 5760

                   [D][esp-idf:000]: I (764) wifi_init: tcp rx win: 5760

                                                                        [D][esp-idf:000]: I (764) wifi_init: tcp mss: 1440

                                                                                                                          [D][esp-idf:000]: I (774) wifi_init: WiFi IRAM OP enabled

                      [D][esp-idf:000]: I (785) wifi_init: WiFi RX IRAM OP enabled

                                                                                  [C][wifi:060]: Starting WiFi...
                                                                                                                 [C][wifi:061]:   Local MAC: 08:3A:8D:65:18:E0
 [D][esp-idf:000][wifi]: I (806) phy_init: phy_version 340,e255ce0,Jun  4 2024,16:44:11

                                                                                       [D][esp-idf:000][wifi]: I (837) wifi:
                                                                                                                            [D][esp-idf:000][wifi]: mode : sta (08:3a:8d:65:18:e0)
                     [D][esp-idf:000][wifi]:

                                             [D][esp-idf:000][wifi]: I (838) wifi:
                                                                                  [D][esp-idf:000][wifi]: enable tsf
                                                                                                                    [D][esp-idf:000][wifi]:

                                                                                                                                            [D][esp-idf:000][wifi]: I (844) wifi:
                    [D][esp-idf:000][wifi]: Set ps type: 1, coexist: 0

                                                                      [D][esp-idf:000][wifi]:

                                                                                              [D][wifi:481]: Starting scan...
                                                                                                                             [D][sensor:093]: '$friendlyname Uptime': Sending state 0.86500 s with 0 decimals of accuracy
                                                            [D][esp-idf:000][wifi]: I (873) wifi:
                                                                                                 [D][esp-idf:000][wifi]: Set ps type: 1, coexist: 0

                                                                                                                                                   [D][esp-idf:000][wifi]:

              [W][component:157]: Component wifi set Warning flag: scanning for networks
                                                                                        [D][wifi:496]: Found networks:
                                                                                                                      [D][wifi:498]:   No network found!
                                                                                                                                                        [D][wifi:481]: Starting scan...
                          [D][wifi:496]: Found networks:
                                                        [D][wifi:498]:   No network found!
                                                                                          [D][wifi:481]: Starting scan...
                                                                                                                         [D][wifi:496]: Found networks:
                                                                                                                                                       [D][wifi:498]:   No network found!
                            [D][wifi:481]: Starting scan...
                                                           [D][wifi:496]: Found networks:
                                                                                         [D][wifi:498]:   No network found!
                                                                                                                           [D][wifi:481]: Starting scan...
                                                                                                                                                          [D][sensor:093]: '$friendlyname Uptime': Sending state 30.82900 s with 0 decimals of accuracy
                                                                                          [D][wifi:496]: Found networks:
                                                                                                                        [D][wifi:498]:   No network found!
                                                                                                                                                          [D][wifi:696]: Retrying with hidden networks...
                                            [I][wifi:312]: WiFi Connecting to 'Huawei tenet'...
                                                                                               [W][wifi_esp32:663]: Event: Disconnected ssid='Huawei tenet' reason='Probe Request Unsuccessful'
                                  [W][wifi:652]: Error while connecting to network.
                                                                                   [D][wifi:696]: Retrying with hidden networks...
                                                                                                                                  [I][wifi:312]: WiFi Connecting to ''...
            [W][wifi_esp32:422]: esp_wifi_connect failed: ESP_ERR_WIFI_SSID
                                                                           [E][wifi:368]: wifi_sta_connect_ failed!
                                                                                                                   [W][wifi:689]: Restarting WiFi adapter...
                                                                                                                                                            [D][esp-idf:000][wifi]: I (39074) wifi:
                                      [D][esp-idf:000][wifi]: flush txq
                                                                       [D][esp-idf:000][wifi]:

                                                                                               [D][esp-idf:000][wifi]: I (39075) wifi:
                                                                                                                                      [D][esp-idf:000][wifi]: stop sw txq
            [D][esp-idf:000][wifi]:

                                    [D][esp-idf:000][wifi]: I (39095) wifi:
                                                                           [D][esp-idf:000][wifi]: lmac stop hw txq
                                                                                                                   [D][esp-idf:000][wifi]:

                                                                                                                                           [D][wifi:481]: Starting scan...
             [D][esp-idf:000][wifi]: I (44218) wifi:
                                                    [D][esp-idf:000][wifi]: mode : sta (08:3a:8d:65:18:e0)
                                                                                                          [D][esp-idf:000][wifi]:

                                                                                                                                  [D][esp-idf:000][wifi]: I (44218) wifi:
            [D][esp-idf:000][wifi]: enable tsf
                                              [D][esp-idf:000][wifi]:

                                                                      [D][esp-idf:000][wifi]: I (44232) wifi:
                                                                                                             [D][esp-idf:000][wifi]: Set ps type: 1, coexist: 0

  [D][esp-idf:000][wifi]:

                          [D][wifi:496]: Found networks:
                                                        [D][wifi:498]:   No network found!
                                                                                          [D][wifi:481]: Starting scan...
                                                                                                                         [D][wifi:496]: Found networks:
                                                                                                                                                       [D][wifi:498]:   No network found!
                            [D][wifi:481]: Starting scan...
                                                           [I][wifi:181]: Starting fallback AP!
                                                                                               [D][esp-idf:000][wifi]: I (60807) wifi:
                                                                                                                                      [D][esp-idf:000][wifi]: mode : sta (08:3a:8d:65:18:e0) + softAP (08:3a:8d:65:18:e1)
                                                            [D][esp-idf:000][wifi]:

                                                                                    [D][esp-idf:000][wifi]: I (60808) wifi:
                                                                                                                           [D][esp-idf:000][wifi]: Total power save buffer number: 16
                        [D][esp-idf:000][wifi]:

                                                [D][esp-idf:000][wifi]: I (60820) wifi:
                                                                                       [D][esp-idf:000][wifi]: Init max length of beacon: 752/752
                                                                                                                                                 [D][esp-idf:000][wifi]:

            [D][esp-idf:000][wifi]: I (60840) wifi:
                                                   [D][esp-idf:000][wifi]: Init max length of beacon: 752/752
                                                                                                             [D][esp-idf:000][wifi]:

                                                                                                                                     [D][esp-idf:000][tiT]: I (60852) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1

                                                                                          [D][esp-idf:000][tiT]: I (61124) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1

                                               [C][wifi:274]:   IP Address: 192.168.4.1
                                                                                       [C][web_server:128]: Setting up web server...
                                                                                                                                    [C][api:025]: Setting up Home Assistant API server...
                            [I][app:062]: setup() finished successfully!
                                                                        [D][wifi:496]: Found networks:
                                                                                                      [D][wifi:498]:   No network found!
                                                                                                                                        [I][safe_mode:041]: Boot seems successful; resetting boot loop counter
                                                 [D][esp32.preferences:114]: Saving 1 preferences to flash...
                                                                                                             [D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
                                        [W][component:157]: Component api set Warning flag: unspecified
                                                                                                       [I][app:100]: ESPHome version 2024.7.0 compiled on Jul 22 2024, 03:02:49
                  [C][wifi:599]: WiFi:
                                      [D][esp-idf:000][wifi]: W (61194) wifi:
                                                                             [D][esp-idf:000][wifi]: Haven't to connect to a suitable AP now!
                                                                                                                                             [D][esp-idf:000][wifi]:

        [W][wifi_esp32:916]: esp_wifi_sta_get_ap_info failed: ESP_ERR_WIFI_NOT_CONNECT
                                                                                      [C][wifi:427]:   Local MAC: 08:3A:8D:65:18:E0
                                                                                                                                   [D][esp-idf:000][wifi]: W (61224) wifi:
             [D][esp-idf:000][wifi]: Haven't to connect to a suitable AP now!
                                                                             [D][esp-idf:000][wifi]:

                                                                                                     [W][wifi_esp32:926]: esp_wifi_sta_get_ap_info failed: ESP_ERR_WIFI_NOT_CONNECT
                      [C][wifi:432]:   SSID: ''
                                               [C][wifi:438]:   BSSID: 00:00:00:00:00:00
                                                                                        [C][wifi:440]:   Hostname: 'esp32c2-test'
                                                                                                                                 [D][esp-idf:000][wifi]: W (61255) wifi:
           [D][esp-idf:000][wifi]: Haven't to connect to a suitable AP now!
                                                                           [D][esp-idf:000][wifi]:

                                                                                                   [W][wifi_esp32:937]: esp_wifi_sta_get_ap_info failed: ESP_ERR_WIFI_NOT_CONNECT
                    [C][wifi:442]:   Signal strength: 0 dB ▂▄▆█
                                                               [C][wifi:446]:   Channel: 1
                                                                                          [C][wifi:447]:   Subnet: 0.0.0.0
                                                                                                                          [C][wifi:448]:   Gateway: 0.0.0.0
                                                                                                                                                           [C][wifi:449]:   DNS1: 0.0.0.0
                            [C][wifi:450]:   DNS2: 0.0.0.0
                                                          [C][logger:185]: Logger:
                                                                                  [C][logger:186]:   Level: DEBUG
                                                                                                                 [C][logger:188]:   Log Baud Rate: 115200
                                                                                                                                                         [C][logger:189]:   Hardware UART: UART0
                                   [C][uptime.sensor:033]: Uptime Sensor '$friendlyname Uptime'
                                                                                               [C][uptime.sensor:033]:   Device Class: 'duration'
                                                                                                                                                 [C][uptime.sensor:033]:   State Class: 'total_increasing'
                                             [C][uptime.sensor:033]:   Unit of Measurement: 's'
                                                                                               [C][uptime.sensor:033]:   Accuracy Decimals: 0
                                                                                                                                             [C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
                                   [C][uptime.sensor:034]:   Type: Seconds
                                                                          [C][captive_portal:088]: Captive Portal:
                                                                                                                  [C][web_server:173]: Web Server:
                                                                                                                                                  [C][web_server:174]:   Address: esp32c2-test.local:80
                                          [C][mdns:116]: mDNS:
                                                              [C][mdns:117]:   Hostname: esp32c2-test
                                                                                                     [C][esphome.ota:073]: Over-The-Air updates:
                                                                                                                                                [C][esphome.ota:074]:   Address: esp32c2-test.local:3232
                                           [C][esphome.ota:075]:   Version: 2
                                                                             [C][safe_mode:018]: Safe Mode:
                                                                                                           [C][safe_mode:019]:   Boot considered successful after 60 seconds
               [C][safe_mode:021]:   Invoke after 10 boot attempts
                                                                  [C][safe_mode:022]:   Remain in safe mode for 300 seconds
                                                                                                                           [W][safe_mode:028]: Last reset occurred too quickly; safe mode will be invoked in 6 restarts
                                                          [C][api:139]: API Server:
                                                                                   [C][api:140]:   Address: esp32c2-test.local:6053
                                                                                                                                   [C][api:144]:   Using noise encryption: NO
                [D][wifi:481]: Starting scan...
                                               [D][wifi:496]: Found networks:
                                                                             [D][wifi:498]:   No network found!

it's having some trouble connecting to my wifi

helloworldtest123 commented 1 month ago

Since 74880 worked for you, this means that it is compiled for 40MHz XTAL. In addition to the wrong baud rate, the Wifi may also be glitchy. I have just checked and the 26Mhz is not set in the pins_arduino.h file. You can possibly set this via the sdkconfig_options, but I don't know if it really works:

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip
    sdkconfig_options:
      CONFIG_XTAL_FREQ_26: y

Otherwise you have to edit the file or even better create your own variant. After that the baud rate should be normal again.

helloworldtest123 commented 2 weeks ago

In the meantime, my Wifi module has also arrived. Unfortunately H2 not H4. So I've also tried my luck with ESPHome. But it won't work. I can programme the chip, but then nothing happens. No message via UART or anything. When I install the original firmware everything is normal. I'm a little clueless as to what the problem is. Maybe @ferbulous can explain how got it to work.

ferbulous commented 2 weeks ago

Since 74880 worked for you, this means that it is compiled for 40MHz XTAL. In addition to the wrong baud rate, the Wifi may also be glitchy. I have just checked and the 26Mhz is not set in the pins_arduino.h file. You can possibly set this via the sdkconfig_options, but I don't know if it really works:

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip
    sdkconfig_options:
      CONFIG_XTAL_FREQ_26: y

Otherwise you have to edit the file or even better create your own variant. After that the baud rate should be normal again.

Hi, with that config I have it connected to my network now

INFO Starting log output from 192.168.2.223 using esphome API
INFO Successfully connected to esp32c2-test @ 192.168.2.223 in 0.058s
INFO Successful handshake with esp32c2-test @ 192.168.2.223 in 0.017s
[11:15:28][I][app:100]: ESPHome version 2024.7.3 compiled on Aug  7 2024, 10:25:08
[11:15:28][C][wifi:599]: WiFi:
[11:15:28][C][wifi:427]:   Local MAC: 08:3A:8D:4C:D8:7C
[11:15:28][C][wifi:432]:   SSID: [redacted]
[11:15:28][C][wifi:435]:   IP Address: 192.168.2.223
[11:15:28][C][wifi:438]:   BSSID: [redacted]
[11:15:28][C][wifi:440]:   Hostname: 'esp32c2-test'
[11:15:28][C][wifi:442]:   Signal strength: -37 dB ▂▄▆█
[11:15:28][C][wifi:446]:   Channel: 10
[11:15:28][C][wifi:447]:   Subnet: 255.255.255.0
[11:15:28][C][wifi:448]:   Gateway: 192.168.2.1
[11:15:28][C][wifi:449]:   DNS1: 1.1.1.1
[11:15:28][C][wifi:450]:   DNS2: 192.168.2.1
[11:15:28][C][logger:185]: Logger:
[11:15:28][C][logger:186]:   Level: DEBUG
[11:15:28][C][logger:188]:   Log Baud Rate: 74880
[11:15:28][C][logger:189]:   Hardware UART: UART0
[11:15:28][C][uptime.sensor:033]: Uptime Sensor '$friendlyname Uptime'
[11:15:28][C][uptime.sensor:033]:   Device Class: 'duration'
[11:15:28][C][uptime.sensor:033]:   State Class: 'total_increasing'
[11:15:28][C][uptime.sensor:033]:   Unit of Measurement: 's'
[11:15:28][C][uptime.sensor:033]:   Accuracy Decimals: 0
[11:15:28][C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
[11:15:28][C][uptime.sensor:034]:   Type: Seconds
[11:15:28][C][captive_portal:088]: Captive Portal:
[11:15:28][C][web_server:173]: Web Server:
[11:15:28][C][web_server:174]:   Address: esp32c2-test.local:80
[11:15:29][C][mdns:116]: mDNS:
[11:15:29][C][mdns:117]:   Hostname: esp32c2-test
[11:15:29][C][esphome.ota:073]: Over-The-Air updates:
[11:15:29][C][esphome.ota:074]:   Address: esp32c2-test.local:3232
[11:15:29][C][esphome.ota:075]:   Version: 2
[11:15:29][C][safe_mode:018]: Safe Mode:
[11:15:29][C][safe_mode:019]:   Boot considered successful after 60 seconds
[11:15:29][C][safe_mode:021]:   Invoke after 10 boot attempts
[11:15:29][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[11:15:29][C][api:139]: API Server:
[11:15:29][C][api:140]:   Address: esp32c2-test.local:6053
[11:15:29][C][api:144]:   Using noise encryption: NO

In the meantime, my Wifi module has also arrived. Unfortunately H2 not H4. So I've also tried my luck with ESPHome. But it won't work. I can programme the chip, but then nothing happens. No message via UART or anything. When I install the original firmware everything is normal. I'm a little clueless as to what the problem is. Maybe @ferbulous can explain how got it to work.

Not much really, I wasn't successful using the esphome dashboard to flash the firmware directly (error expected esp32c2 board) so I just grab the factory.bin then I used esptool to flash it. I've also ordered some 2mb board (same form factor like CBU) and will test those once it arrives next week

Also, I'm having some errors compiling with bluetooth proxy/ble tracker, is there anyway around this?

esp32_ble_tracker:
  scan_parameters:
    active: true

bluetooth_proxy:
  active: true    

Logs logs_esp32c2-test_compile.txt

ferbulous commented 1 week ago

Got the ESP8684-WROOM-06c

Found 1 serial ports
Serial port COM4
Connecting...
Detecting chip type... ESP32-C2
Chip is ESP32-C2 (revision v1.0)
Features: WiFi, BLE
Crystal is 26MHz
MAC: 08:3a:8d:46:a3:08
Stub is already running. No upload is necessary.
Manufacturer: a1
Device: 4015
Detected flash size: 2MB
Hard resetting via RTS pin...

And this it what I'm getting from the logs, it just bootloops with 2mb version, seems to work fine on the 4mb esp32c2

Rebooting...
ESP-ROM:esp8684-api2-20220127
Build:Jan 27 2022
rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40380dfc
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5c80,len:0x16c4
load:0x403acb70,len:0x974
load:0x403aeb70,len:0x2988
entry 0x403acb70
I (36) boot: ESP-IDF 5.1.4.240712 2nd stage bootloader
I (36) boot: compile time Aug  6 2024 23:32:27
I (36) boot: chip revision: v1.0
I (41) boot.esp32c2: MMU Page Size  : 32K
I (49) boot.esp32c2: SPI Speed      : 60MHz
I (56) boot.esp32c2: SPI Mode       : DIO
I (63) boot.esp32c2: SPI Flash Size : 4MB
I (70) boot: Enabling RNG early entropy source...
I (79) boot: Partition Table:
I (84) boot: ## Label            Usage          Type ST Offset   Length
I (96) boot:  0 otadata          OTA data         01 00 00009000 00002000
I (107) boot:  1 phy_init         RF data          01 01 0000b000 00001000
I (119) boot:  2 app0             OTA app          00 10 00010000 001c0000
I (130) boot:  3 app1             OTA app          00 11 001d0000 001c0000
I (142) boot:  4 nvs              WiFi data        01 02 00390000 0006d000
I (153) boot: End of partition table
I (160) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=250d8h (151768) map
I (207) esp_image: segment 1: paddr=00035100 vaddr=3fcae5c0 size=02438h (  9272) load
I (210) esp_image: segment 2: paddr=00037540 vaddr=40380000 size=08ad8h ( 35544) load
I (225) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=8ae4ch (568908) map
I (357) esp_image: segment 4: paddr=000cae74 vaddr=40388ad8 size=05ae8h ( 23272) load
I (367) boot: Loaded app from partition at offset 0x10000
I (367) boot: Disabling RNG early entropy source...
I (387) cpu_start: Unicore app
I (388) cpu_start: Pro cpu up.
I (399) cpu_start: Pro cpu start user code
I (399) cpu_start: cpu freq: 120000000 Hz
I (399) cpu_start: Application information:
I (404) cpu_start: Project name:     esp32c2-test
I (412) cpu_start: App version:      2024.7.3
I (420) cpu_start: Compile time:     Aug 13 2024 16:44:45
I (429) cpu_start: ELF file SHA256:  e3ccc2df46631f85...
I (438) cpu_start: ESP-IDF:          5.1.4.240712
I (447) cpu_start: Min chip rev:     v1.0
I (454) cpu_start: Max chip rev:     v1.99
I (461) cpu_start: Chip rev:         v1.0
I (469) heap_init: Initializing. RAM available for dynamic allocation:
I (480) heap_init: At 3FCB4AF0 len 00028080 (160 KiB): D/IRAM
I (489) heap_init: At 3FCDCB70 len 0000294C (10 KiB): STACK/DRAM
I (501) spi_flash: detected chip: generic
I (507) spi_flash: flash io: dio
E (513) spi_flash: Detected size(2048k) smaller than the size in the binary image header(4096k). Probe failed.

assert failed: do_core_init startup.c:350 (flash_ret == ESP_OK)
Core  0 register dump:
MEPC    : 0x40380e3a  RA      : 0x40385ad8  SP      : 0x3fcde5e0  GP      : 0x3fcaedc0
TP      : 0x00000000  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x00000001  S1      : 0x3fcde73f  A0      : 0x3fcde638  A1      : 0x3fcaff3d
A2      : 0x00000001  A3      : 0x00000029  A4      : 0x00000001  A5      : 0x3fcb5000
A6      : 0x00000008  A7      : 0x76757473  S2      : 0x00000088  S3      : 0x3fcde638
S4      : 0x3fcde638  S5      : 0x3c09b5d8  S6      : 0xffff8000  S7      : 0x40380ab0
S8      : 0x00040020  S9      : 0x00010020  S10     : 0x00000005  S11     : 0x3fcde820
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001801  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
MHARTID : 0x00000000

Stack memory:
3fcde5e0: 0xffffffff 0x00000079 0x3c09b628 0x4038ab36 0xffffffff 0x00000079 0xfffffffb 0x3fcaff3c
3fcde600: 0x00303533 0x000250d8 0x00000000 0x00000000 0x36000000 0x3fcb01bc 0x3c09b684 0x3fcb02c4
3fcde620: 0x3c09b5d8 0x3fcb01cc 0x3fcde600 0x3fcb01d0 0x3c09b628 0x3fcaff3c 0x65737361 0x66207472
3fcde640: 0x656c6961 0x64203a64 0x6f635f6f 0x695f6572 0x2074696e 0x72617473 0x2e707574 0x35333a63
3fcde660: 0x66282030 0x6873616c 0x7465725f 0x203d3d20 0x5f505345 0x00294b4f 0x00000000 0x40382198
3fcde680: 0x3fcb0000 0x3fcafaa0 0x00000000 0x3fcde6a4 0x00000058 0x00000054 0x00a14015 0x4203eba8
3fcde6a0: 0xffff8000 0x00000201 0x3c0a2388 0x00000800 0x00001000 0x000003e8 0xd0000000 0x00000034
3fcde6c0: 0xffff8000 0x000250d8 0x3fcde88c 0x00000000 0x00000000 0x00000001 0x00000000 0x00000001
3fcde6e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x0000003c 0x0000003c
3fcde700: 0x3c0af000 0x000250d8 0x3fcde88c 0x3fcb2054 0x3c0af000 0x3c09b000 0x3fcb2054 0x42025fc8
ferbulous commented 1 week ago

Some updates, I forgot to add flash_size=2mb line

esp32:
  board: esp32-c2-devkitm-1
  variant: esp32c2
  flash_size: 2MB
  framework:
    type: esp-idf
    platform_version: "https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5"
    version: 5.1.4
    source: https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240712/esp-idf-v5.1.4.zip
    sdkconfig_options:
      CONFIG_XTAL_FREQ_26: y

But now I'm getting this error

ESP-ROM:esp8684-api2-20220127
Build:Jan 27 2022
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40054770
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5c80,len:0x16c4
load:0x403acb70,len:0x974
load:0x403aeb70,len:0x2988
entry 0x403acb70
I (36) boot: ESP-IDF 5.1.4.240712 2nd stage bootloader
I (36) boot: compile time Aug 13 2024 17:16:32
I (36) boot: chip revision: v1.0
I (41) boot.esp32c2: MMU Page Size  : 32K
I (49) boot.esp32c2: SPI Speed      : 60MHz
I (56) boot.esp32c2: SPI Mode       : DIO
I (63) boot.esp32c2: SPI Flash Size : 2MB
I (70) boot: Enabling RNG early entropy source...
I (79) boot: Partition Table:
I (84) boot: ## Label            Usage          Type ST Offset   Length
I (96) boot:  0 otadata          OTA data         01 00 00009000 00002000
I (107) boot:  1 phy_init         RF data          01 01 0000b000 00001000
I (119) boot:  2 app0             OTA app          00 10 00010000 000c0000
I (130) boot:  3 app1             OTA app          00 11 000d0000 000c0000
I (142) boot:  4 nvs              WiFi data        01 02 00190000 0006d000
I (153) boot: End of partition table
I (160) boot: No factory image, trying OTA 0
I (168) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=250d8h (151768) map
I (215) esp_image: segment 1: paddr=00035100 vaddr=3fcae5c0 size=02438h (  9272) load
I (217) esp_image: segment 2: paddr=00037540 vaddr=40380000 size=00ad8h (  2776) load
I (224) esp_image: segment 3: paddr=00038020 vaddr=42000020 size=8ae4ch (568908) map
I (364) esp_image: segment 4: paddr=000c2e74 vaddr=40380ad8 size=0dae8h ( 56040) load
E (378) esp_image: Image length 788864 doesn't fit in partition length 786432
E (378) boot: OTA app partition slot 0 is not bootable
E (382) esp_image: image at 0xd0000 has invalid magic byte (nothing flashed here?)
E (395) boot: OTA app partition slot 1 is not bootable
E (404) boot: No bootable app partitions in the partition table
wildekek commented 2 days ago

I've received on of these units and will do some tests over the next coming days. Tasmota seems to work, so that is hopeful.