ESP32 C5 - Page 1
Forum section: electronics / general

author: Miti
author_rank: Super Contributor
timestamp: September 06, 2025, 10:22:14 pm
content: I bought an ESP32 C5 and I can't get it to connect to Wi-Fi using Arduino IDE. The sketch compiles and uploads successfully, but in the serial monitor I get:"Connecting to Wi-FiE (2316) wifi:can not get wifi protocol under WiFi band mode WIFI_BAND_MODE_AUTO, please use esp_wifi_get_protocols instead"I've attached the sketch below. Do you have an example sketch that works for C5?Cheers,MitiCode:#include <WiFi.h>#include "esp_wifi.h"// Replace with your network credentialsconst char* ssid = "myssid";const char* password = "mypassword";// Built-in LED pinconst int ledPin = 13;unsigned long previousMillis = 0;const long interval = 500;bool ledState = LOW;void setup() {Serial.begin(115200);delay(1000);// Set up LED pinpinMode(ledPin, OUTPUT);digitalWrite(ledPin, LOW); // Turn off initiallySerial.println();Serial.print("Connecting to Wi-Fi");WiFi.setBandMode(WIFI_BAND_MODE_5G_ONLY);WiFi.begin(ssid, password);WiFi.STA.begin();// Wait for connectionwhile (WiFi.status() != WL_CONNECTED) {delay(500);Serial.print(".");}Serial.println();Serial.print("Connected! IP address: ");Serial.println(WiFi.localIP());}void loop() {unsigned long currentMillis = millis();if (WiFi.status() == WL_CONNECTED) {if (currentMillis - previousMillis >= interval) {previousMillis = currentMillis;ledState = !ledState;digitalWrite(ledPin, ledState);}} else {digitalWrite(ledPin, LOW);}// No blocking delay here, so Wi-Fi stays responsive}

author: paulca
author_rank: Super Contributor
timestamp: September 07, 2025, 10:52:21 am
content: Does the arduino framework support WIFI 5Ghz?Does it work without the band selection or does it work if you select 2.4?

author: Miti
author_rank: Super Contributor
timestamp: September 07, 2025, 10:53:37 am
content: It’s working. It needs a WiFi.begin() before the WiFi.begin(ssid, password) to initialize the driverapparently.

author: Miti
author_rank: Super Contributor
timestamp: September 07, 2025, 10:56:12 am
content: Quote from: paulca on September 07, 2025, 10:52:21 amThe latest Espressif library has a ESP32C5 Dev Board.No, it didn’t work in any band before.

author: Miti
author_rank: Super Contributor
timestamp: September 11, 2025, 12:14:49 pm
content: The latency and jitter with these modules in terible. I have two of them connected to my home network, one Adafruit Feather on 2.4GHz and an ESP32 C5 on 5GHz, and I see the ping latency bouncing anywhere from 10mS to more than 800mS. They are not doing much, one is just flashing an LED while connected, the other one is an HTTP server simulating three temperature sensors. I ping my Octoprint server runing on Linux Mint on an Intel NUC, it is constant 2mS on 5GHz, wired is 1mS.

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: September 11, 2025, 12:24:37 pm
content: Check that your router does support 5GHz with the modes compatible with ESP32-C5 (802.11ax / WiFi-6) or fallback to 2.4GHz. Sometimes routers have 5GHz channels that aren’t usable by certain devices.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 11, 2025, 12:55:42 pm
content: Quote from: Miti on September 11, 2025, 12:14:49 pmI have tested the ESP32-C6 a while back and here are some real test results:https://www.eevblog.com/forum/microcontrollers/feedback-on-the-esp32-c6/msg5493736/#msg5493736The most likely culprit of the high and varying latency is the power saving mode used. Refer to my post. I have specifically tested the -C6 and not the -C5, but I expect it to be very similar.I have only used ESP-IDF directly. If you use the Arduino framework on these, it's very likely they use a default power saving mode that is favorable for power consumption, but not for latency, and no clue if they allow changing it from Arduino libs. If so, you can check for yourself.Quote from: Miti on September 11, 2025, 12:14:49 pmOf course, you can't compare a mid-range MCU to a mini-PC. The TCP/IP stack overhead is significant, so you'll never go as low as on a PC (even with the lower-end CPU you can find). But still have a look at the power saving parameter, and you'll probably get much better results as I've tested (average 3.5 ms with the WIFI_PS_NONE parameter, of course with much higher average current).

author: Miti
author_rank: Super Contributor
timestamp: September 11, 2025, 01:51:04 pm
content: Quote from: ahsrabrifat on September 11, 2025, 12:24:37 pmIt cannot fall back to 2.4 because I have different SSIDs and passwords for the two bands.

author: Miti
author_rank: Super Contributor
timestamp: September 11, 2025, 01:58:25 pm
content: Quote from: SiliconWizard on September 11, 2025, 12:55:42 pmThanks, I will read.Quote from: SiliconWizard on September 11, 2025, 12:55:42 pmI know, what I really meant was it’s not the router, it’s not the network.