ESP32 WiFi Reception

I'm currently using an ESP32-WROOM32 (30pin) for a project, but the WiFi reception struggles in rooms away from the router - even where my other devices work ok all round the house.

There wasn't a 30pin board I could find that has an external antenna, so I'm wondering if another type of 30pin board would have better reception?

I've found a tutorial on how to add an external antenna by scraping away at the PCB tracks, but I'm not fancying that option.

Thanks :blush:

Those 30-pin boards work quite well for me, but they may not all be identical. If the antenna is in some way obstructed by the PCB it is soldered onto, that can cause issues. There is a chance of it being a power supply issue. Wifi connection to a network is the most power demanding feature generally.

Some ESP32 board have the option of either using the PCB antenna or using an ipex socket for an external antenna. You probably have to select which antenna to use by moving a small surface mount resistor.

But there are ESP32 boards with no PCB antenna, just an ipex connector for an external antenna.

devBoards ? I haven't seen any. Barebones ESP32 yes, and i have some. tested to 380m reception with clear line of sight.

I actually just remove the ( 0R / 805 ) resistor and solderblob the connection.

This is a 38pin board, but I actually need a 30pin.

Here's the setup I'm using... The esp plugs into a pair of 15pin headers.


It's powered via the usb port, and I've tried powering via mains usb adaptor and battery packs.

The 38-pin boards are usually not so good. Setup looks fine. 30-pin boards have a different pinout and don't exposed GPIO 0 but the other pins are anyway not usable.
Getting a 30-pin may improve things. The variety in devboards is huge ! and not all were designed by people who really knew what they were doing, other than making a buck,

Tbf, the existing board was an AliExpress special. It actually works ok, just that the distance you start to lose reception from the WiFi router is ridiculously low.

I'm talking directly below (~5m) is ok, but the next room (~10m) is a fail.

It will be quite east to plug in a new esp, so I just need to figure out which one to try...

I live on those, and most are quite Ok. maybe that one is just not good.

Post#6
You should have mounted the board on that sub board with the stripline aerial outside the sub board. The traces under the aerial are likely influencing the footprint of the reception.
Leo..

Not good, you have metal under the antenna and wires/components blocking it.

Thanks, I will remember for next time.

For this project I was following an existing design, which includes the 3d printed casing and the associated mounting points and clearances.

by the way I have been using many different ESP32 boards with WiFi and none of them had a reasonable reception distance. looks like typical issue

I have used the ESP32 devkit and sent video between two buildings 200 feet apart, going through several walls.
You must be doing something wrong.

Agreed with you there. Even the setup doesn't look like it could be causing you that much trouble. The devboard is sufficiently elevated unless the direction of the router is towards the bottom. Those few wires don't help, but they are not that near the antenna either.

I've got a different 30pin board on the way.

Once fitted, I will update.

I guess a new board won't be any different. Your router could be the problem.
I have a free router from the internet provider that also has a poor WiFi footprint and range.
If you mount a new board, the drill out all the holes of the base board under the aerial first.
Or cut out a section with a dremel tool.
You could also try forcing your router to a different WiFi channel.
Leo..

getting back to this issue which I have too. Of course there must be something wrong, but what ?
Here my simple code and the result from 5m distance to the router. On 3m it works.

// Digital Clock Galactico
// Test for ESP32C3 Supermini
// November 2023
// Bernardo Gullasch
// including Wifi, OLED, Setbuttons

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#include <Adafruit_SSD1306.h>
#include <SPI.h>
#include <WiFi.h>
#include <time.h>
#include <ESP32Time.h>

#define I2Cadd 0x3C
//*******************************************************************************
#define MY_TZ "<-04>4<-03>,M9.1.6/24,M4.1.6/24" // for time() ctime()
#define MY_NTP_SERVER "cl.pool.ntp.org"
//*******************************************************************************
// WiFi setup data
//const char* ssid = "Galactico_Salon"; // Name of the Wi-Fi box
//const char* password = "saturno002"; // MDP of the Wi-Fi box
const char* ssid = "GalacticoVTR"; // Name of the Wi-Fi box
const char* password = "19Galactico"; // MDP of the Wi-Fi box

//*******************************************************************************
/* Globals */
time_t now;  // this are the seconds since Epoch (1970) - UTC
tm timeinfo; // the structure tm holds time information in a more convenient way *
//*******************************************************************************

// Create the OLED oled
//Adafruit_SH1106G oled = Adafruit_SH1106G(128, 64, &Wire, -1);
Adafruit_SSD1306 oled = Adafruit_SSD1306(128, 64, &Wire, -1);

int AdjustPin = 4; // black button
int SetPin = 2; // yellow button

ESP32Time rtc;

const char *WeekDay[] = {"Domingo  ", "Lunes    ", "Martes   ", "Miercoles", "Jueves   ", "Viernes  ", "Sabado   ", "Domingo  "};
bool END;
int Block[7];
int setVal=0;
int dispPos=0;

int count;



// --------- SETUP ---------
void setup() 
{
   //Serial.begin(115200);
   //Serial.println("start setup.....");
   //oled.begin(I2Cadd, true);
   
   oled.begin(SSD1306_SWITCHCAPVCC, I2Cadd);
   oled.setTextSize(1);
   oled.setTextColor(SH110X_WHITE);
   oled.clearDisplay();
   oled.fillRect(0,0,128,64,SH110X_BLACK);
   oled.display();

  delay(100);

  pinMode(AdjustPin, INPUT); // right button
  pinMode(SetPin, INPUT); // left button

  //Serial.println(" ***** Start Setup *****");
  
  WiFi.persistent(false);
  WiFi.mode(WIFI_STA); // Optional
  WiFi.begin(ssid, password);

  oled.setCursor(0,10);
  oled.println("  Time init");
  oled.println("  Connecting");
  while (WiFi.status() != WL_CONNECTED) 
  {
    oled.print("."); oled.display();
    count++;
    if(count>100) 
    {
      oled.clearDisplay(); 
      oled.setCursor(0,40); 
      oled.println("connection failed"); 
      oled.display(); 
      delay(1000); 
      oled.clearDisplay();
      break;
    }
    delay(200);
  }
  if(WiFi.status() == WL_CONNECTED)
  {
  oled.clearDisplay();
  oled.setCursor(0,8);  
  oled.println("Connected to ");
  oled.println(); 
  oled.println(ssid);
  oled.println();
  oled.println("Local ESP32 IP: ");
  oled.println();
  oled.println(WiFi.localIP());
  oled.display();

  delay(2000);
  //while (!digitalRead(SetPin)) {;}
  oled.clearDisplay();
  oled.setCursor(0,10);
  oled.println("get Time from NTP...");
  oled.display();

//  We configure the NTP server
  //*******************************************************************************
  configTime(0, 0, MY_NTP_SERVER);  // 0, 0 because we will use TZ in the next line
  setenv("TZ", MY_TZ, 1);            // Set environment variable with your time zone
  tzset();
  //*******************************************************************************

  }
  if (!getLocalTime(&timeinfo)) 
   { 
    oled.setCursor(0,40);
    oled.println("Failed to obtain time");
    oled.println("adjust time manually");
    oled.display();
    delay(2000);
    
    InputTime();
   }
  else
  {    
    rtc.setTimeStruct(timeinfo);
  
    oled.clearDisplay();
    oled.setCursor(0,40);
    oled.println("Time set succesfully");
    oled.display();
   }
    WiFi.disconnect();
    
  //Serial.println("ready for Setup ...");
  
    Block[0] = rtc.getYear();
    Block[1] = rtc.getMonth()+1;
    Block[2] = rtc.getDay();
    Block[3] = rtc.getDayofWeek();
    Block[4] = rtc.getHour(true);
    Block[5] = rtc.getMinute();
    Block[6] = rtc.getSecond();
    
   oled.setCursor(0,10);
   oled.println("RTC actual time is ");
   oled.println("---------------------");
   
   if (Block[2]<10) {oled.print("0");} 
   oled.print(Block[2]);
   oled.print(".");
   if (Block[1]<10) {oled.print("0");}
   oled.print(Block[1]);
   oled.print(". ");
   //oled.print("20"); oled.print(Block[0]);
   oled.print(" ");

   oled.print(Block[4]); 
   oled.print(":");
   oled.print(Block[5]);
   oled.print(":");
   oled.println(Block[6]);
   oled.println(" ");
   /*
   oled.println("Left  -> set time");
   oled.println(" ");
   oled.println("Right -> continue");
   */
   oled.display(); 
 
  delay(1000);
    oled.clearDisplay();
    oled.setCursor(5,30);
    oled.print("* Time Set *");
    oled.display();
  delay(1000);
  // LET´S GO
} // --------------------- finish Setup ------------------------ 

void loop() 
{ 
  showTime();
} 
// ------------------------------------- End Loop ------------------------------


void InputTime()
  {
       while (setVal<7) // input date/time values
        {
        if (digitalRead(AdjustPin)) // ajust actual value
         {
          Block[setVal]++ ;
          if (Block[0] > 32) {Block[0] = 22;}
          if (Block[1] > 12) {Block[1] = 1;}
          if (Block[2] > 31) {Block[2] = 1;}
          if (Block[3] > 7 ) {Block[3] = 1;}
          if (Block[4] > 23) {Block[4] = 0;}
          if (Block[5] > 59) {Block[5] = 0;}
          if (Block[6] > 59) {Block[6] = 0;}      
          
          delay(100);      
         }
         
         if (digitalRead(SetPin)) // set value and goto next 
         {
          setVal++;
          delay(100);
         }  
         showInput();
         delay(200);    
        } // ready input date/time values 0 to 5

        

    oled.clearDisplay();
    //oled.setCursor(0,10);
    //oled.print("Ready for adjust time");
    BlockOnOLED();
        
    SetClock();
  }


void showInput()
{
  oled.clearDisplay();
  oled.setCursor(0,8);
  oled.setTextSize(1);
  oled.println("ingresar fecha/hora");
  oled.println("---------------------");

  oled.setCursor(0,24);
  oled.println("Ano   Mes  Dia  Sem");
  for (dispPos=0; dispPos<4; dispPos++)
  {
    oled.setCursor((dispPos*34),33);
    if (dispPos==setVal) {oled.setTextColor(SH110X_BLACK, SH110X_WHITE);} else {oled.setTextColor(SH110X_WHITE, SH110X_BLACK);}
    if (Block[dispPos] < 10) {oled.print("0"); oled.print(Block[dispPos]);} else  {oled.print(Block[dispPos]);}
  }
  oled.setTextColor(SH110X_WHITE, SH110X_BLACK);
  oled.setCursor(0,46);
  oled.print("Hora Minuto Segundo");
  for (dispPos=4; dispPos<7; dispPos++)
  {
  oled.setCursor(((dispPos-4)*36),54);

  if (dispPos==setVal) {oled.setTextColor(SH110X_BLACK, SH110X_WHITE);} else {oled.setTextColor(SH110X_WHITE, SH110X_BLACK);}
  oled.setTextSize(1);
  if (Block[dispPos] < 10) {oled.print("0"); oled.print(Block[dispPos]);} else  {oled.print(Block[dispPos]);}
  oled.setTextSize(1);
  //oled.display();
  }
  oled.display();
  oled.setTextColor(SH110X_WHITE, SH110X_BLACK);
 } 

void SetClock()
  {
   rtc.setTime(Block[6],Block[5],Block[4],Block[2],(Block[1]),Block[0]+2000);

   oled.clearDisplay();
   oled.setCursor(30,24);
   oled.print("* READY *");
   oled.display();
   delay(1000);      
  }


void showTime()
{   
   oled.clearDisplay();
   oled.setTextSize(1);
   oled.setCursor(0,8);
   if(rtc.getDay() < 10) {oled.print("0");}
   oled.print(rtc.getDay());
   oled.print(".");
   if(rtc.getMonth() < 10) {oled.print("0");}
   oled.print(rtc.getMonth() +1);
   oled.print(". ");
   //oled.print("20"); 
   oled.print(rtc.getYear());
   oled.print(" ");
   oled.print(WeekDay[rtc.getDayofWeek()]);
   
   oled.setTextSize(2);
   oled.setCursor(15,33);
   if ((rtc.getHour(true)) < 10){oled.print("0");}
   oled.print(rtc.getHour(true));
   oled.print(":");
   if ((rtc.getMinute()) < 10){oled.print("0");} 
   oled.print(rtc.getMinute());
   oled.print(":");
   if ((rtc.getSecond()) < 10){oled.print("0");}
   oled.print(rtc.getSecond());
   oled.print("  ");

   oled.drawRoundRect(0,25,128,32,10,WHITE);
   oled.drawRoundRect(1,26,126,30,10,WHITE);
   
   oled.display();
}

void BlockOnOLED()
{
   oled.clearDisplay();
   oled.setCursor(0,0);
   for(int i=0; i<7; i++)
    {
      oled.print("Block "); 
      oled.print(i); 
      oled.print(" -> "); 
      oled.println(Block[i]);
    }
    oled.display();
    while (!digitalRead(SetPin)) {;}
}


Different problem.
It seems you're using the bad (AliExpress) version of the ESP32-C3.
Most of those boards are crap regarding WiFi.
They sometimes work at a distance, but most of the times not.
If you want to use a single-core ESP32C3, then use the Seeed XIAO ESP32C3.
They come with an external stick-on aerial with a good range.
Leo..

I second @Wawa 's opinion. You are not the first person on this forum that has complained about range problems with that module.

The little red thing is the antenna. You might get a little more range if you mount the module such the antenna is not near any other objects especially metal.