ESP32-C3 Super Mini WiFi connection problem

Hi,
I recently purchased a ESP32-C3 Super Mini and i having trouble setting it up with esphome and home assistant.

The code I’m using is the basic generated one with the modified output_power value.

esphome:
  name: motion-p717
  friendly_name: Motion p.717

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "zTbMrd7zzSdlMInqCj4vHV50RaCt3mtBYJf5vLylQww="

ota:
  - platform: esphome
    password: "8b38a39a5e2377290ecdaed3f2ae7de9"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  output_power: 8.5dB

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Motion-P717 Fallback Hotspot"
    password: "LJkNpSMouibu"

captive_portal:

The thing is that most of the time the ESP32-C3 Super Mini can’t connect to the WiFi (which is 4G) and i get this log:

[23:47:51]ESP-ROM:esp32c3-api1-20210207
[23:47:51]Build:Feb  7 2021
[23:47:51]rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
[23:47:51]Saved PC:0x40380836
[23:47:51]SPIWP:0xee
[23:47:51]mode:DIO, clock div:1
[23:47:51]load:0x3fcd6100,len:0x438
[23:47:51]load:0x403ce000,len:0x918
[23:47:51]load:0x403d0000,len:0x24e4
[23:47:51]entry 0x403ce000
[23:47:51][I][logger:156]: Log initialized
[23:47:51][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[23:47:51][D][esp32.preferences:114]: Saving 1 preferences to flash...
[23:47:51][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[23:47:51][I][app:029]: Running through setup()...
[23:47:51][C][wifi:048]: Setting up WiFi...
[23:47:51][C][wifi:061]: Starting WiFi...
[23:47:51][C][wifi:062]:   Local MAC: 3C:84:27:AF:CC:F0
[23:47:51][D][wifi:482]: Starting scan...
[23:47:51][W][component:157]: Component wifi set Warning flag: scanning for networks
[23:47:51][D][wifi:497]: Found networks:
[23:47:51][I][wifi:541]: - '8level-Net' [redacted]▂▄▆█
[23:47:51][D][wifi:542]:     Channel: 5
[23:47:51][D][wifi:543]:     RSSI: -69 dB
[23:47:51][D][wifi:546]: - [redacted] [redacted]▂▄▆█
[23:47:51][D][wifi:546]: - [redacted][D][wifi:546]: - [redacted] [redacted][D][wifi:546]: - [redacted] [redacted][D][wifi:546]: - [redacted] [redacted][D][wifi:546]: - [redacted] [redacted]e
[23:47:51][D][wifi:546]: - [redacted] [redacted]▂▄▆█
[23:47:51][D][wifi:546]: - [redacted] [redacted]0;36m[D][wifi:546]: - [redacted] [redacted][redacted][D][wifi:546]: - [redacted] [redacted]▂▄▆█
[23:47:51][D][wifi:546]: - [redacted] [redacted]▂▄[D][wifi:546]: - [redacted] [redacted][D][wifi:546]: - [redacted] [redacted][D][wifi:546]: - [redacted] [redacted]e
[23:47:51][D][wifi:546]: - [redacted] [redacted]▂▄▆█
[23:47:51][D][wifi:546]: - [redacted] [redacted][I][wifi:313]: WiFi Connecting to '8level-Net'...
[23:47:51][W][wifi_esp32:532][arduino_events]: Event: Disconnected ssid='8level-Net' bssid=[redacted] reason='Auth Expired'
[23:47:51][W][wifi:653]: Error while connecting to network.
[23:47:51][D][wifi:697]: Retrying with hidden networks...
[23:47:51][I][wifi:313]: WiFi Connecting to '8level-Net'...
[23:47:51][W][wifi_esp32:532][arduino_events]: Event: Disconnected ssid='8level-Net' bssid=[redacted] reason='Auth Expired'
[23:47:51][W][wifi:653]: Error while connecting to network.
[23:47:51][D][wifi:697]: Retrying with hidden networks...
[23:47:56][I][wifi:313]: WiFi Connecting to '8level-Net'...
[23:47:59][W][wifi_esp32:532][arduino_events]: Event: Disconnected ssid='8level-Net' bssid=[redacted] reason='Auth Expired'
[23:47:59][W][wifi:653]: Error while connecting to network.
[23:47:59][D][wifi:697]: Retrying with hidden networks...
[23:47:59][I][wifi:313]: WiFi Connecting to '8level-Net'...
[23:48:01][W][wifi_esp32:532][arduino_events]: Event: Disconnected ssid='8level-Net' bssid=[redacted] reason='Auth Expired'
[23:48:01][W][wifi:653]: Error while connecting to network.
[23:48:01][D][wifi:697]: Retrying with hidden networks...
[23:48:06][I][wifi:313]: WiFi Connecting to '8level-Net'...

I also tried with the ESP32-wroom-32 and connects without any problem to my 8level-Net router. I tried other WiFi networks and still get the same problem.

Thanks for your suggestions!

Ive had this error with some of my supermini c3’s. I took them out of rotation because this error would start from out of nowhere and persist for days and then go away.

Maybe try cleaning build files and re-upload a new firmware? The other option is to try the esp-idf framework (you have to flash using usb cable though, not OTA when switching between esp-idf and Arduino).

Your rssi looks alright, so no issues there. Some of the supermini boards have their crystal close to the antenna which causes signal degradation.

1 Like

So you reduced your wifi power and it won’t connect? I think the answer may be in the question.

Alternatively, look to your power supply.

2 Likes

Try to get your ESP a little more far of your router as too powerful signal can be killing for Wifi efficiency :wink:

1 Like

Thanks for your replies, so far with no luck I tried:

  • clean the build files and re-upload a new firmware
  • run the code without modifying the output power
  • increase the distance from the router
  • solder the little antenna rotated 90 degrees to isolate it from the crystal

But what did the job was soldering a tiny piece of wire to the existing antenna and touch it with my finger! Every restart the esp connects right away with my finger on it. Now I’m thinking that the problem could be the built in antenna.

Did you try :point_down:

esp32:
  variant: ESP32C3
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

yet? For me that works a treat :pinched_fingers:

1 Like
output_power: 8.5dB

Why such low output? Thats about 8mW. Go for full power and reduce later when youget it working.

1 Like

Yep, like it recommends in the docs.

1 Like

I had some similar issues and eventually resolved it with this config.

esphome:
  name: bed-occupancy-air-quality-1
  friendly_name: Bed Occupancy
  platformio_options:
    board_build.flash_mode: dio
    
esp32:
  board: esp32-c3-devkitm-1  # Pinout: https://www.sudo.is/docs/esphome/boards/esp32c3supermini/#pinout
  variant: ESP32C3
  framework:
    type: esp-idf

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: x
    gateway: x
    subnet: x
  power_save_mode: none


1 Like

When I try your code I get the similar problem:

[19:12:40][I][wifi:313]: WiFi Connecting to '8level-Net'...
[19:12:40][D][esp-idf:000][wifi]: I (268948) wifi:
[19:12:40][D][esp-idf:000][wifi]: new:<5,2>, old:<5,0>, ap:<5,2>, sta:<5,2>, prof:1
[19:12:40][D][esp-idf:000][wifi]: 
[19:12:40]
[19:12:40][D][esp-idf:000][wifi]: I (269229) wifi:
[19:12:40][D][esp-idf:000][wifi]: state: init -> auth (b0)
[19:12:40][D][esp-idf:000][wifi]: 
[19:12:40]
[19:12:41][D][esp-idf:000][wifi]: I (270231) wifi:
[19:12:41][D][esp-idf:000][wifi]: state: auth -> init (200)
[19:12:41][D][esp-idf:000][wifi]: 
[19:12:41]
[19:12:41][D][esp-idf:000][wifi]: I (270234) wifi:
[19:12:41][D][esp-idf:000][wifi]: new:<5,0>, old:<5,2>, ap:<5,2>, sta:<5,2>, prof:1
[19:12:41][D][esp-idf:000][wifi]: 
[19:12:41]
[19:12:41][W][wifi_esp32:705]: Event: Disconnected ssid='8level-Net' bssid=[redacted] reason='Auth Expired'
[19:12:41][W][wifi:653]: Error while connecting to network.
[19:12:46][I][wifi:313]: WiFi Connecting to '8level-Net'...
[19:12:50][D][esp-idf:000][wifi]: I (279274) wifi:
[19:12:50][D][esp-idf:000][wifi]: new:<5,2>, old:<5,0>, ap:<5,2>, sta:<5,2>, prof:1
[19:12:50][D][esp-idf:000][wifi]: 
[19:12:50]
[19:12:50][D][esp-idf:000][wifi]: I (279555) wifi:
[19:12:50][D][esp-idf:000][wifi]: state: init -> auth (b0)
[19:12:50][D][esp-idf:000][wifi]: 
[19:12:50]
[19:12:51][D][esp-idf:000][wifi]: I (280558) wifi:
[19:12:51][D][esp-idf:000][wifi]: state: auth -> init (200)
[19:12:51][D][esp-idf:000][wifi]: 
[19:12:51]
[19:12:51][D][esp-idf:000][wifi]: I (280560) wifi:
[19:12:51][D][esp-idf:000][wifi]: new:<5,0>, old:<5,2>, ap:<5,2>, sta:<5,2>, prof:1
[19:12:52][D][esp-idf:000][wifi]: 
[19:12:52]

I also tried to disable the output_power parameter but still no connection :frowning:

1 Like

Come to think of it I think my issues were mostly poor rssi related. So perhaps not so related to your cause.

1 Like

It may just be poor materials. I have a super mini board that works fine as long as I don’t seat it into a female pin header. The female pin header isn’t connected to anything, literally just soldered onto a protoboard.

When it isn’t seated, wifi works fine. The moment i seat the male pin header from the super mini into any female pin header, the wifi drops and throws these errors and some other errors that are similar (handshake failed, etc.) which makes me think there is some cold solder joint or something on the board that only shows itself when some flex or pressure is applied.

That’s just some of my observations, I’ve checked the board with a microscope and can’t see anything obvious. Other boards randomly have this issue and it lasts for anywhere from a few minutes to a few days. Needless to say, I’ve since only purchased from vendors who I’ve had good experiences with (tenstar robot seems to be ok on AliExpress).

These boards are very hit and miss, the crystal thing is a known issue, god knows what other corners were cut by various manufacturers to save pennies on BOM.

I haven’t had any issues at all with non super mini style boards, so far.

1 Like

I got an idea to try to solder this type of antenna to the super mini and see if if helps. Has anyone tried it before? I’m not sure about the connection of the two wires, where to connect them.

Use a 3cm wire, will do wonders for your Rx/tx.

1 Like

I saw this elsewhere - might be your problem:

Warning: Some C3 Super Mini boards have a design flaw that ruins Wifi/BT

https://www.reddit.com/r/esp32/comments/1dsh3b5/warning_some_c3_super_mini_boards_have_a_design/?share_id=tW-PKp2v3ZNb832XkHGGt

2 Likes

That’s the crystal too close to antenna issue.

1 Like

funnny I have the same issue with pin headers… Did you solve it by adding a 3cm wire?

No, the 3cm wire just gives me a good signal, the wifi issues still persist when seated, just poor quality boards and components.