Xiao ESP32c3 cannot reconnect to esphome after power cycle

I utilized the xiao esp32c3 home assistant setup guide here: Connect Grove Modules to Home Assistant using ESPHome - Seeed Wiki

I was able to flash the esphome firemware successfully when hardwired, but when I unplug the xiao and plug into simply a usb power source, I can no longer connect to the device via esphome. While testing, I setup an LED on D0 and when the board is unresponsive, this pin is actually blinking high/low every 3 seconds or so, which is strange.

Below is the error when trying to connect from esphome logs:

INFO Starting log output from esp32-c3-test1.local using esphome API
WARNING Can't connect to ESPHome API for esp32-c3-test1.local: Error resolving IP address: [Errno -5] No address associated with hostname
INFO Trying to reconnect to esp32-c3-test1.local in the background

Hello, it looks like your unlimited network is not connected, so that Xiao can not connect to ESPhome, you can check the configuration of the wifi

The xiao connects to the wifi correctly during that initial flash. I can send an ota update via wifi just fine. Its just when I unplug power to the board and then plug back in does it seem be wiped somehow and cannot connect at all

1 Like

Hi there. I can confirm the same behavior.

The XIAO-ESP23C3 only seems to be started while connected to a pc and start a serial terminal. In my case “picocom /dev/ttyACM0 -b115200” on my Linux pc.
Only then, I can see the divice connects wifi by simply pinging its fixed IP address. I also see all the start and run messages in the terminal.
After exiting picocom the device is still running fine. Both pinging and control by HomeAssistant keeps working. But after a reset by the button on the device or by cycling usb-power it stays unreachable.

So I guess this is just some boot issue. Probably done by control of RTS/DTR when using serial communication.
Does anybody know the secret?

I will attach the esphome yaml file I use for this test:

esphome:
  name: xiaoesp32c3
  #  platformio_options:
  #  board_build.flash_mode: dio

esp32:
  board: seeed_xiao_esp32c3
  variant: esp32c3
  framework:
     type: arduino
     version: 2.0.5
     platform_version: 5.2.0

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: "MySSID"
  password: "MyWPA"
  use_address: 10.0.0.119
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 10.0.0.119
    # Set this to the IP address of the router. Often ends with .1
    gateway: 10.0.0.254
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "HomelabFallbackHotspot"
    password: "anything123"

captive_portal:
#
switch:
  - platform: gpio
    name: "Living Room119 LED"
    pin: GPIO5
#
sensor:
  - platform: adc
    pin: 3
    name: "Living Room119 Temperature"
    update_interval: 60s
1 Like

Your response does not really make any sense. Unlimited network?? and the configuration of the wifi is correct, as I and Zanzani have shown.

1 Like

I’m having the same issue, after upload it’s works (ONLINE), but if i disconnect (OFFLINE) and connect, it doesn’t start and still on OFFLINE.

But if i press “LOGS” buttons it’s staring to work and goes to ONLINE, so this is the minimal code:

esphome:

  name: clamps-tacos-casa

esp32:

  board: seeed_xiao_esp32c3

  variant: esp32c3

  framework:

    type: arduino

# Enable logging

logger:

# Enable Home Assistant API

api:

  encryption:

    key: "iPa741IokyToGQvHGMmFaIelorpMRiV4fxKA/5aYJXE="

ota:

  password: "21c6a0beb7b6ada8c405699a93d20088"

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "Clamps-Tacos-Casa"

    password: "OBOOn5pxkTC9"

captive_portal:

Ok, i found this and now it works for me…

esphome:

  name: clamps-tacos-casa

  platformio_options:

    board_build.flash_mode: dio  

esp32:

  board: seeed_xiao_esp32c3

  variant: esp32c3

  framework:

    type: esp-idf

# captive_portal:
3 Likes

Thanks, @Diego_VL, I didn’t try that combo. I would still like to see Xiao address the original issue, but your solution works for now.

Also take a look at this related to the web portal and others. I haven’t gotten this to work with the ESPHome Addon in Home assistant but maybe others will have more luck:

Thank you Diego_VL. I got it working.
This esp-idf does te trick. Me, as a noob, I don’t even know what it means yet.
It came out that I need some of the newest esphome build environments. 2022.9.4 on my laptop is too old to know esp-idf.

Anyway, using these devices can begin by now.

I own the S3 variant of the seeed_xiao_esp32c3 board, I am also facing same boot/reconnect problems after power cycle.
any idea wich is the right config (board, variant, framework, version and platform_version) for esphome with the S3 variant?

I was facing the same Problem with starting the Seeed ESPC3 only while connected to my PC with serial terminal. With the current Framework this Problem seems to be solved!

My Settings are:

esp32:
board: seeed_xiao_esp32c3
variant: esp32c3
framework:
type: arduino
version: 2.0.9
platform_version: 6.3.2

I hope that helps :slight_smile: