-->
Page 1 of 1

ESP8266 not listening on specified port

PostPosted: Mon Mar 14, 2016 1:37 am
by ScottCypher
My goal is to exchange information between my ESP8266 and another device.

When I try to connect my device to the ESP8266 on 192.168.4.1 (port 80), my connection is being refused because the ESP8266 is not listening on this port.

I'm new to the ESP8266 so it's probably something minor. Any links or help would be appreciated. Here is my code:

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

const char *ssid = "Test SSID";
const char *password = "thereisnospoon";

ESP8266WebServer server(80);

void setup() {
   delay(1000);
   Serial.begin(115200);
   Serial.print("Configuring access point...");
   WiFi.softAP(ssid, password);

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

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

Re: ESP8266 not listening on specified port

PostPosted: Tue Mar 15, 2016 2:23 am
by eduperez
I would configure a minimal test page on that server before concluding that it is not listening to the port.

Re: ESP8266 not listening on specified port

PostPosted: Tue Mar 15, 2016 8:20 am
by martinayotte
First, we don't see any server.on() handler in your sketch.
Second, make sure that all your client devices are in STA mode only, otherwise, if they are in STA+AP, they will try to connect to themselves since they will also have an local IP 192.168.4.1.