-->
Page 1 of 1

What's wrong with my very simple sketch ??

PostPosted: Wed May 20, 2015 4:51 am
by papeyeku
Hello,

I met a lot of problem to make an HTTP request with the ESP. So i try with a very very simple skectch, but i still have some troubles :
ESP connect to wifi network in about 2 sec and get an IP --> good. But next, i have no ping response, or the firsts 7~8 packet. Yet, the serial is displaying "3" (WL_CONNECTED).
Is it something wrong ?

Thanks (sorry if my english is bad)

Code: Select all#include <WiFiUdp.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WiFi.h>

const char* ssid = "**********";
const char* password = "*********";

void setup() {

  Serial.begin(9600);
delay(10);
   
  WiFi.begin(ssid, password);
  Serial.println(""); 
  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  delay(1000);
  Serial.println(WiFi.status());
}

Re: What's wrong with my very simple sketch ??

PostPosted: Wed May 20, 2015 9:23 am
by jh1995
The sketch looks good. I get very bad ping RTT values when the 3.3V power supply is unstable/noisy. Try to add a 10uF electrolytic cap as close as possible to the ESP module and retry. Note that the USB-to-serial adapter does not provide enough current to keep the 8266 happy. Else, a noisy switching supply increases the RF noise level and increases packet loss. Decouple.

My ESP-01 pings in 3 ms when everything is good! (on an unloaded home WiFi network)

Re: What's wrong with my very simple sketch ??

PostPosted: Wed May 20, 2015 2:45 pm
by papeyeku
My bad ! It seem that the problem is... a Wifi repeater with the same SSID. It work good with other devices, but not with the ESP apparently.
Since I disconnect the repeater, everything work fine.
Sorry, and thanks for your help.

For power supply, i use the 5V output of the USB-TTL, and an ams1117.

Regards,