Post topics, source code that relate to the Arduino Platform

User avatar
By AlexPilk
#23901 I uploaded the access point example to the module:

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

/* Set these to your desired credentials. */
const char *ssid = "ESPap";
const char *password = "thereisnospoon";

ESP8266WebServer server(80);

/* Just a little test message.  Go to http://192.168.4.1 in a web browser
 * connected to this access point to see it.
 */
void handleRoot() {
   server.send(200, "text/html", "<h1>You are connected</h1>");
}

void setup() {
   delay(1000);
   Serial.begin(115200);
   Serial.println();
   Serial.print("Configuring access point...");
   /* You can remove the password parameter if you want the AP to be open. */
   WiFi.softAP(ssid, password);

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

   Serial.println("done");
   IPAddress myIP = WiFi.softAPIP();
   Serial.print("AP IP address: ");
   Serial.println(myIP);
   server.on("/", handleRoot);
   server.begin();
   Serial.println("HTTP server started");
}

void loop() {
   server.handleClient();
}


Was able to connect to the access point, "ping 192.168.4.1" in cmd works well, but when I try to go to 192.168.4.1 in the browser it says the webpage is not available. Tried changing the ip address of the access point, same thing. It worked correctly before, I was able to see the "You are connected" message. What could cause this issue?
User avatar
By Freecanadian
#24115 I have the same problem. It was working earlier today, but now it is stuck in the loop of waiting to set up the AP? Just keeps returning "………"

I have tried it with and without the password option, but no change. Seems unable to set up an IP, although its SSID does show up on my list of WiFi networks, there is no connection available and no IP address returned through Serial Monitor (previously it was 192.168.4.1).
User avatar
By Vinylon
#25070 I have the same problem. By the way, you don't need this line when you're using the ESP as an access point:

Code: Select allwhile (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }


Anyways, I can connect to the access point fine, but the server doesn't seem to work. I ran a port scan, and it looks like the ESP has no ports open. Not 53, not 80, nothing. So it looks like the server isn't starting up correctly.

I've tried a few different things, but the only way I've gotten it to work is by not using a password on the AP. Not an ideal solution.
User avatar
By martinayotte
#25086
Vinylon wrote:I've tried a few different things, but the only way I've gotten it to work is by not using a password on the AP. Not an ideal solution.

Do you means that your server is working if you start the softAP without password and doesn't work if you have a password ?
Strange, mine is working fine with a password ... Is your password has 8 or more characters ?
Maybe you can provide your sketch, I will be happy to try it out.
You can also try mine that I posted few weeks ago : viewtopic.php?f=27&t=4080#p23577