-->
Page 1 of 5

Problem getting WiFi begining tutorial to work

PostPosted: Mon May 07, 2018 12:12 pm
by SupDoc
This is a tutorial. Code is below. It returns only "square symbol )" in the serial monitor. This code is supposed to deliver:
connecting
"Connected, IP address:"
This is very simple code. It compiles & uploads, Can someone tell how to make it won't work. I put in the correct network name & password.
---------------------------------
#include <ESP8266WiFi.h>

void setup()
{
Serial.begin(115200);
Serial.println();

WiFi.begin("network-name", "pass-to-network");

Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();

Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}

void loop() {}

Re: Problem getting WiFi begining tutorial to work

PostPosted: Mon May 07, 2018 1:21 pm
by mgsecord62
I assume you have the serial monitor baud rate set to 115200.

SupDoc wrote:This is a tutorial. Code is below. It returns only "square symbol )" in the serial monitor. This code is supposed to deliver:
connecting
"Connected, IP address:"
This is very simple code. It compiles & uploads, Can someone tell how to make it won't work. I put in the correct network name & password.
---------------------------------
#include <ESP8266WiFi.h>

void setup()
{
Serial.begin(115200);
Serial.println();

WiFi.begin("network-name", "pass-to-network");

Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();

Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}

void loop() {}

Re: Problem getting WiFi begining tutorial to work

PostPosted: Mon May 07, 2018 2:25 pm
by SupDoc
Yes I have the baud rate @115200. In fact the code in IDE is exactly as indicated in my statement of the problem, except for the network name & password, which I checked 3X to make sure that was right.
Is it possible there could be something wrong with the library version of the ESP8266WiFi.h. I read on a different forum something about a library version, versus a direct version. Regretably, I didn't understand what they were saying.

Re: Problem getting WiFi begining tutorial to work

PostPosted: Mon May 07, 2018 3:25 pm
by cicciocb
Put a delay(0) in the loop function :

void loop() { delay(0); }