Wi-Fi connectivity issues on a Chinese ESPHome based relay device

Hi there,

I bought a 4-channel relay panel from AliExpress. I was able to install an ESPHome firmware on it without any issues, and it basicly works, but its stability is very poor.
I have another devices running ESPHome firmware (like this), and all of them are completely stable.

The main stability issue is that the device disconnects from my WiFi every few minutes or sometimes a few hours - and due to the API disconnection, it reboots itself. After rebooting, it is able to reconnect to my WiFi again. The access point is in the same room as the device. The reported wifi signal sthrength is around -50dBm.

My first thought was that the problem migbt be insufufficient power: my PC might not be able to provice enought current to the device throught the USB-C cable. Because of this, I powered it using a smartphone charger together with a PD trigger board (12V) connected ti its DC input. At the same time I kept the device connected to my PC so I could read the log via the serial connection.

Some more info:

  • ESP module on the relay panel: DOIT ESP32-32E N4
  • Sometimes I cannot update it’s firmware via OTA, but I believe this is related to the issue described above.
  • I wrote a test Home Assistant script in which I rapidly switch a relay on and off. In some positions (possibly blocking the antenna), the switching commands are missed, and then a large number of buffered switch commands are executed very rapidly afterward.

At this point, I’m trying to determine whether the issue is caused by hardware instability, power supply problems, or a software/ESPHome configuration issue. Any suggestions on what else I sould check or how I could further debug this problem would be greatly appreciated.

Thank you,
tom

The configuration I’m using on the problematic device can be found here:

esphome:
  name: relayboard4channel
  friendly_name: RelayBoard4Channel

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "MySecretCode(censored)"

ota:
  - platform: esphome
    password: "password(censored)"

wifi:
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  enable_btm: True
  enable_rrm: True
  power_save_mode: NONE
  ap:
    ssid: "Relayboard4Channel"
    password: "password(censored)"

captive_portal:

web_server:
  port: 80
  version: 3
  local: True


debug:
  update_interval: 5s

text_sensor:
  - platform: debug
    device:
      name: "Device Info"
    reset_reason:
      name: "Reset Reason"

sensor:
  - platform: uptime
    name: Uptime
  - platform: debug
    free:
      name: "Heap Free"
    block:
      name: "Heap Max Block"
    cpu_frequency:
      name: "CPU Frequency"
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 30s      

button:
  - platform: restart
    name: Reboot
  - platform: safe_mode
    name: Reboot in safe mode

# ==========================
# RELAYS (OUTPUTS)
# ==========================
switch:
  - platform: gpio
    pin:
      number: 23
      inverted: true
    name: "Output 1"

  - platform: gpio
    pin:
      number: 5
      inverted: true
      ignore_strapping_warning: true
    name: "Output 2"

  - platform: gpio
    pin:
      number: 4
      inverted: true
    name: "Output 3"

  - platform: gpio
    pin:
      number: 13
      inverted: true
    name: "Output 4"

# ==========================
# INPUTS (BINARY SENSORS)
# ==========================
binary_sensor:
  - platform: gpio
    pin:
      number: 25
      inverted: true
    name: "Input 1"

  - platform: gpio
    pin:
      number: 26
      inverted: true
    name: "Input 2"

  - platform: gpio
    pin:
      number: 27
      inverted: true
    name: "Input 3"

  - platform: gpio
    pin:
      number: 33
      inverted: true
    name: "Input 4"

  # ==========================
  # EXTRA PADS (RX2/TX2)
  # ==========================
  - platform: gpio
    pin:
      number: 16
      inverted: true
      mode: INPUT_PULLUP
    name: "Pad RX2 as input"

  - platform: gpio
    pin:
      number: 17
      inverted: true
      mode: INPUT_PULLUP
    name: "Pad TX2 as input"

# ==========================
# MODBUS UART
# ==========================
uart:
  rx_pin: 18 # Modbus RX
  tx_pin: 19 # Modbus TX
  baud_rate: 9600

# ==========================
# Status LED (system state)
# ==========================
status_led:
  pin:
    number: 15
    inverted: true
    ignore_strapping_warning: true

Read logs via serial communication:

[D][sensor:129]: 'Heap Free' >> 223836 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -48dB P:-41
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -92dB P:-41
[D][wifi:1259]: - 13 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -41, attempt 1/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -41 β†’ -41
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -41, attempt 2/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -41 β†’ -42
[D][wifi:408]: Skipping hidden retry for visible network 'MyWiFiAccessPointName'
[D][wifi:1563]: Retry phase: SCAN_CONNECTING β†’ RESTARTING
[W][wifi:566]: Restarting adapter
[W][wifi:1413]: Connecting to network failed
[D][wifi:1563]: Retry phase: RESTARTING β†’ SCAN_CONNECTING
[D][wifi:1098]: Starting scan
[D][sensor:129]: 'Heap Free' >> 223504 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -89dB P:-41
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -47dB P:-42
[D][wifi:1259]: - 13 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -41, attempt 1/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint2Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac), priority -41 β†’ -41
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -41, attempt 2/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:762]: Disconnected ssid='MyWiFiAccessPointName' reason='Probe Request Unsuccessful'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac), priority -41 β†’ -42
[D][wifi:408]: Skipping hidden retry for visible network 'MyWiFiAccessPointName'
[D][wifi:1563]: Retry phase: SCAN_CONNECTING β†’ RESTARTING
[W][wifi:566]: Restarting adapter
[D][sensor:129]: 'Heap Free' >> 227056 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[W][wifi:1407]: Network no longer found
[D][wifi:1563]: Retry phase: RESTARTING β†’ SCAN_CONNECTING
[D][wifi:1098]: Starting scan
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -51dB P:-42
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -92dB P:-42
[D][wifi:1259]: - 14 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -42, attempt 1/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -42 β†’ -42
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -42, attempt 2/2 in phase SCAN_CONNECTING)...
[D][sensor:129]: 'Heap Free' >> 225404 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -42 β†’ -43
[D][wifi:408]: Skipping hidden retry for visible network 'MyWiFiAccessPointName'
[D][wifi:1563]: Retry phase: SCAN_CONNECTING β†’ RESTARTING
[W][wifi:566]: Restarting adapter
[W][wifi:1413]: Connecting to network failed
[D][wifi:1563]: Retry phase: RESTARTING β†’ SCAN_CONNECTING
[D][wifi:1098]: Starting scan
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -91dB P:-42
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -47dB P:-43
[D][wifi:1259]: - 8 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -42, attempt 1/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint2Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac), priority -42 β†’ -42
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -42, attempt 2/2 in phase SCAN_CONNECTING)...
[D][sensor:129]: 'Heap Free' >> 225736 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint2Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac), priority -42 β†’ -43
[D][wifi:408]: Skipping hidden retry for visible network 'MyWiFiAccessPointName'
[D][wifi:1563]: Retry phase: SCAN_CONNECTING β†’ RESTARTING
[W][wifi:566]: Restarting adapter
[W][wifi:1413]: Connecting to network failed
[D][wifi:1563]: Retry phase: RESTARTING β†’ SCAN_CONNECTING
[D][wifi:1098]: Starting scan
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -58dB P:-43
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -92dB P:-43
[D][wifi:1259]: - 16 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -43, attempt 1/2 in phase SCAN_CONNECTING)...
[D][sensor:129]: 'Heap Free' >> 225280 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -43 β†’ -43
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority -43, attempt 2/2 in phase SCAN_CONNECTING)...
[W][wifi_esp32:771]: Disconnected ssid='MyWiFiAccessPointName' bssid=MyWiFiAccessPoint1Mac reason='Auth Expired'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac), priority -43 β†’ -44
[D][wifi:408]: Skipping hidden retry for visible network 'MyWiFiAccessPointName'
[D][wifi:1563]: Retry phase: SCAN_CONNECTING β†’ RESTARTING
[W][wifi:566]: Restarting adapter
[W][wifi:1413]: Connecting to network failed
[D][wifi:1563]: Retry phase: RESTARTING β†’ SCAN_CONNECTING
[D][wifi:1098]: Starting scan
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -88dB P:-43
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -50dB P:-44
[D][wifi:1259]: - 14 non-matching (VERBOSE to show)
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -43, attempt 1/2 in phase SCAN_CONNECTING)...
[D][sensor:129]: 'Heap Free' >> 225356 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[W][wifi_esp32:762]: Disconnected ssid='MyWiFiAccessPointName' reason='Probe Request Unsuccessful'
[W][wifi:1397]: Connecting to network failed (callback)
[D][wifi:1743]: Failed 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac), priority -43 β†’ -43
[D][wifi:1814]: Retry attempt 2/2 in phase SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) (priority -43, attempt 2/2 in phase SCAN_CONNECTING)...
[E][api:159]: No clients; rebooting
[I][app:251]: Forcing a reboot
[D][debug:056]: Storing reboot source: api
[D][esp32.preferences:155]: Writing 1 items: 0 cached, 1 written, 0 failed
ets Jul 29 2019 12:21:46



rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:2

load:0x3fff0030,len:6384

load:0x40078000,len:15996

load:0x40080400,len:3920

entry 0x4008063c

I (27) boot: ESP-IDF 5.5.2 2nd stage bootloader

I (27) boot: compile time Feb 20 2026 11:19:10

I (27) boot: Multicore bootloader

I (29) boot: chip revision: v3.1

I (31) boot.esp32: SPI Speed      : 40MHz

I (35) boot.esp32: SPI Mode       : DIO

I (39) boot.esp32: SPI Flash Size : 4MB

I (42) boot: Enabling RNG early entropy source...

I (47) boot: Partition Table:

I (49) boot: ## Label            Usage          Type ST Offset   Length

I (56) boot:  0 otadata          OTA data         01 00 00009000 00002000

I (62) boot:  1 phy_init         RF data          01 01 0000b000 00001000

I (69) boot:  2 app0             OTA app          00 10 00010000 001c0000

I (75) boot:  3 app1             OTA app          00 11 001d0000 001c0000

I (82) boot:  4 nvs              WiFi data        01 02 00390000 0006d000

I (88) boot: End of partition table

I (92) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=3950ch (234764) map

I (179) esp_image: segment 1: paddr=00049534 vaddr=3ffb0000 size=03ea0h ( 16032) load

I (185) esp_image: segment 2: paddr=0004d3dc vaddr=40080000 size=02c3ch ( 11324) load

I (190) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=b6e38h (749112) map

I (447) esp_image: segment 4: paddr=00106e60 vaddr=40082c3c size=10450h ( 66640) load

I (473) esp_image: segment 5: paddr=001172b8 vaddr=50000000 size=00020h (    32) load

I (482) boot: Loaded app from partition at offset 0x10000

I (483) boot: Disabling RNG early entropy source...

[I][logger:121]: Log initialized
[C][safe_mode:118]: Unsuccessful boot attempts: 0
[D][esp32.preferences:155]: Writing 1 items: 0 cached, 1 written, 0 failed
[I][app:087]: Running through setup()
[D][switch:026]: 'Output 1' Turning OFF.
[D][switch:065]: 'Output 1' >> OFF
[D][switch:026]: 'Output 1' Turning OFF.
[D][switch:026]: 'Output 2' Turning OFF.
[D][switch:065]: 'Output 2' >> OFF
[D][switch:026]: 'Output 2' Turning OFF.
[D][switch:026]: 'Output 3' Turning OFF.
[D][switch:065]: 'Output 3' >> OFF
[D][switch:026]: 'Output 3' Turning OFF.
[D][switch:026]: 'Output 4' Turning OFF.
[D][switch:065]: 'Output 4' >> OFF
[D][switch:026]: 'Output 4' Turning OFF.
[D][binary_sensor:047]: 'Input 1' >> OFF
[D][binary_sensor:047]: 'Input 2' >> OFF
[D][binary_sensor:047]: 'Input 3' >> OFF
[D][binary_sensor:047]: 'Input 4' >> OFF
[D][binary_sensor:047]: 'Pad RX2 as input' >> OFF
[D][binary_sensor:047]: 'Pad TX2 as input' >> OFF
[C][wifi:475]: Starting
[D][wifi:1098]: Starting scan
[C][component:249]: Setup wifi took 110ms
[W][component:386]: api set Warning flag: unspecified
[I][app:134]: setup() finished successfully!
[W][component:395]: wifi set Warning flag: scanning for networks
[I][app:206]: ESPHome version 2026.1.2 compiled on 2026-02-22 22:02:25 +0100
[I][app:213]: ESP32 Chip: ESP32 r3.1, 2 core(s)
[W][app:222]: Set minimum_chip_revision: "3.1" to reduce binary size
[C][logger:316]: Logger:
  Max Level: DEBUG
  Initial Level: DEBUG
[C][logger:322]:   Log Baud Rate: 115200
  Hardware UART: UART0
[C][logger:332]:   Task Log Buffer Size: 768 bytes
[C][uart.idf:238]: UART Bus 1:
[C][uart.idf:152]:   TX Pin: GPIO19
[C][uart.idf:152]:   RX Pin: GPIO18
[C][uart.idf:243]:   RX Buffer Size: 256
  RX Full Threshold: 8
  RX Timeout: 2
[C][uart.idf:249]:   Baud Rate: 9600 baud
  Data Bits: 8
  Parity: NONE
  Stop bits: 1
[C][status_led:018]: Status LED:
[C][status_led:152]:   Pin: GPIO15
[C][uptime.sensor:016]: Uptime Sensor 'Uptime'
  State Class: 'total_increasing'
  Unit of Measurement: 's'
  Accuracy Decimals: 0
[C][uptime.sensor:026]:   Device Class: 'duration'
[C][uptime.sensor:030]:   Icon: 'mdi:timer-outline'
[C][uptime.sensor:033]:   Type: Seconds
[C][switch.gpio:092]: GPIO Switch 'Output 1'
  Restore Mode: always OFF
[C][switch.gpio:152]:   Pin: GPIO23
[C][switch.gpio:092]: GPIO Switch 'Output 2'
  Restore Mode: always OFF
[C][switch.gpio:152]:   Pin: GPIO5
[C][switch.gpio:092]: GPIO Switch 'Output 3'
  Restore Mode: always OFF
[C][switch.gpio:152]:   Pin: GPIO4
[C][switch.gpio:092]: GPIO Switch 'Output 4'
  Restore Mode: always OFF
[C][switch.gpio:152]:   Pin: GPIO13
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Input 1'
[C][gpio.binary_sensor:152]:   Pin: GPIO25
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Input 2'
[C][gpio.binary_sensor:152]:   Pin: GPIO26
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Input 3'
[C][gpio.binary_sensor:152]:   Pin: GPIO27
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Input 4'
[C][gpio.binary_sensor:152]:   Pin: GPIO33
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Pad RX2 as input'
[C][gpio.binary_sensor:152]:   Pin: GPIO16
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Pad TX2 as input'
[C][gpio.binary_sensor:152]:   Pin: GPIO17
[C][gpio.binary_sensor:073]:   Mode: interrupt
[C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[C][restart.button:014]: Restart Button 'Reboot'
[C][restart.button:017]:   Icon: 'mdi:restart'
[C][safe_mode.button:014]: Safe Mode Button 'Reboot in safe mode'
[C][safe_mode.button:017]:   Icon: 'mdi:restart-alert'
[C][captive_portal:128]: Captive Portal:
[C][wifi:1304]: WiFi:
  Local MAC: ESP32MacAddress(censored)
  Connected: NO
[C][web_server:416]: Web Server:
  Address: relayboard4channel.local:80
[C][esphome.ota:075]: Over-The-Air updates:
  Address: relayboard4channel.local:3232
  Version: 2
[C][esphome.ota:082]:   Password configured
[C][safe_mode:021]: Safe Mode:
  Successful after: 60s
  Invoke after: 10 attempts
  Duration: 300s
[C][safe_mode:038]:   Bootloader rollback: support unknown
[C][web_server.ota:231]: Web Server OTA
[C][api:221]: Server:
  Address: relayboard4channel.local:6053
  Listen backlog: 4
  Max connections: 8
[C][api:228]:   Noise encryption: YES
[C][wifi_signal.sensor:016]: WiFi Signal 'WiFi Signal Sensor'
  State Class: 'measurement'
  Unit of Measurement: 'dBm'
  Accuracy Decimals: 0
[C][wifi_signal.sensor:026]:   Device Class: 'signal_strength'
[C][mdns:177]: mDNS:
  Hostname: relayboard4channel
[C][debug:018]: Debug component:
[C][debug:017]:   Device info 'Device Info'
[C][debug:024]:     Icon: 'mdi:chip'
[C][debug:016]:   Free space on heap 'Heap Free'
    State Class: ''
    Unit of Measurement: 'B'
    Accuracy Decimals: 0
[C][debug:030]:     Icon: 'mdi:counter'
[C][debug:016]:   Largest free heap block 'Heap Max Block'
    State Class: ''
    Unit of Measurement: 'B'
    Accuracy Decimals: 0
[C][debug:030]:     Icon: 'mdi:counter'
[C][debug:016]:   CPU frequency 'CPU Frequency'
    State Class: ''
    Unit of Measurement: 'Hz'
    Accuracy Decimals: 0
[C][debug:030]:     Icon: 'mdi:speedometer'
[D][debug:032]: ESPHome version 2026.1.2
[D][debug:036]: Free Heap Size: 235564 bytes
[D][debug:175]: Flash Chip: Size=4096kB Speed=40MHz Mode=DIO
[D][debug:197]: Chip: Model=ESP32, Cores=2, Revision=301
[D][debug:201]: CPU Frequency: 160 MHz
[D][debug:206]: Framework: Arduino
[D][debug:216]: ESP-IDF Version: 5.5.2
[D][debug:221]: EFuse MAC: ESP32MacAddress(censored)
[D][debug:082]: Reset Reason: Reboot request from api
[D][debug:110]: Wakeup Reason: undefined
[D][text_sensor:119]: 'Device Info' >> '2026.1.2|Flash: 4096kB Speed:40MHz Mode:DIO|Chip: ESP32 Features:BLE, BT, 2.4GHz WiFi Cores:2 Revision:301|CPU Frequency: 160 MHz|Framework: Arduino|ESP-IDF: 5.5.2|EFuse MAC: ESP32MacAddress(censored)|Reset: Reboot request from api|Wakeup: undefined'
[D][debug:082]: Reset Reason: Reboot request from api
[D][text_sensor:119]: 'Reset Reason' >> 'Reboot request from api'
[C][debug:116]: Partition table:
  Name         Type Subtype  Address    Size
[C][debug:123]:   otadata      1    0        0x00009000 0x00002000
[C][debug:123]:   phy_init     1    1        0x0000B000 0x00001000
[C][debug:123]:   app0         0    16       0x00010000 0x001C0000
[C][debug:123]:   app1         0    17       0x001D0000 0x001C0000
[C][debug:123]:   nvs          1    2        0x00390000 0x0006D000
[D][sensor:129]: 'Heap Free' >> 234524 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][wifi:1227]: Found networks:
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) β–‚β–„β–†β–ˆ Ch:11 -53dB P:0
[I][wifi:1188]: - 'MyWiFiAccessPointName' (MyWiFiAccessPoint2Mac) β–‚β–„β–†β–ˆ Ch: 1 -91dB P:0
[D][wifi:1259]: - 8 non-matching (VERBOSE to show)
[D][wifi:1563]: Retry phase: INITIAL_CONNECT β†’ SCAN_CONNECTING
[I][wifi:899]: Connecting to 'MyWiFiAccessPointName' (MyWiFiAccessPoint1Mac) (priority 0, attempt 1/2 in phase SCAN_CONNECTING)...
[D][sensor:129]: 'Uptime' >> 3 s
[D][esp-idf:000][wifi]: E (7517) wifi:
[D][esp-idf:000][wifi]: sta is connecting, cannot set config
[D][esp-idf:000][wifi]:
[D][sensor:129]: 'WiFi Signal Sensor' >> -53 dBm
[D][sensor:129]: 'WiFi Signal Sensor' >> -52 dBm
[I][wifi:1329]: Connected
[D][wifi:1346]: Disabling AP
[C][wifi:1037]:   IP Address: 192.168.23.117
[C][wifi:1048]:   SSID: 'MyWiFiAccessPointName'
  BSSID: MyWiFiAccessPoint1Mac
  Hostname: 'relayboard4channel'
  Signal strength: -52 dB β–‚β–„β–†β–ˆ
  Channel: 11
  Subnet: 255.255.255.0
  Gateway: 192.168.23.1
  DNS1: 192.168.23.1
  DNS2: 0.0.0.0
[C][wifi:1068]:   BTM: enabled
  RRM: enabled
[W][component:426]: wifi cleared Warning flag
[D][api:139]: Accept 192.168.23.150
[W][component:426]: api cleared Warning flag
[D][api:139]: Accept 192.168.23.160
[W][component:543]: api took a long time for an operation (111 ms)
[W][component:546]: Components should block for at most 30 ms
[D][api.connection:2221]: ESPHome Logs 2026.1.2 (192.168.23.150): connected
[D][api.connection:2221]: Home Assistant 2026.2.2 (192.168.23.160): connected
[D][sensor:129]: 'Heap Free' >> 227800 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228224 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228196 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228196 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228196 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228196 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'WiFi Signal Sensor' >> -51 dBm
[D][sensor:129]: 'Heap Free' >> 228196 B
[D][sensor:129]: 'CPU Frequency' >> 160000000 Hz
[D][sensor:129]: 'Heap Max Block' >> 110592 B
[D][sensor:129]: 'Heap Free' >> 228196 B

In my Home Assistant the uptime chart looks like this, and the device info is here:

Ok, I had an issue a bit like this - my CPU was too busy on the ESP device.

Why arduino and not esp-idf? Try with esp-idf?

Test without web server?

I would actual test without any component and just WiFi config and logging.

2 Likes

Also what does the contents of this sensor say?

text_sensor:
  - platform: debug
    device:
      name: "Device Info"
    reset_reason:
      name: "Reset Reason"

This is a classic case of the device being too busy and blocking the WiFi loop.

Remove these

  enable_btm: True
  enable_rrm: True

Add

fast_connect: true

Are all your varied power supply ground connectors connected? No switching power supply noise issues?

Do you have a static IP Address allocated to your device from the router?

I tried several changes, but by themselves they didn’t solve the issue:

  • Replaced the framework type with esp-idf
  • Removed WebUI and Captive Portal
  • Removed Modbus UART
  • Removed WiFi btm and rrm
  • Added fast_connect
  • Added electrolytic capacitors to VIN, 5V, 3V3

Despite these changes, the problem was still present.

However, the following modification worked for me. After changing the WiFi configuration, the device became stable and has now been running for about 16 hours without any issues:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: NONE
  output_power: 8.5

It seems that, in my case, the WiFi output power settings were the key to achieving stability.
Can someone explain to me why this solved the problem? :smile:

I did suggest you remove the meshing options - I’d say it was that rather than the power setting.

Sorry, I forgot to mention that based on your recommendation I removed BTM and RRM (edited). However, it was not stable without output_power settings. :frowning:
With fast connect and without output power limit it was not stable. :frowning:

1 Like