Electronic – ESP8266 AT commands to setup a server

esp8266

I am trying to setup a simple server in the port :80 with a esp8266 module.
I flashed it to the most recent version and it seems to work … but it is like it doesn't respond to request when I access it through the explorer.

The most annoying part for me is about the +CIFS command
It returns the following:

AT+CIFSR

+CIFSR:APIP,"86.186.85.186"
+CIFSR:APMAC,"1a:fe:34:9b:c3:83"
+CIFSR:STAIP,"102.106.51.178"
+CIFSR:STAMAC,"c0:ca:41:00:47:40"

My network is 192.168.1.X , 255.255.255.0, 192.168.1.1

According to this thread I found

Station (STA) is when your ESP is connecting to your home wifi.

Access Point (AP) is when your ESP is broadcasting wifi for you to connect to.

If I execute a ping on the 86.186.85.186 is ok.

Haciendo ping a 86.186.85.186 con 32 bytes de datos:
Respuesta desde 86.186.85.186: bytes=32 tiempo=67ms TTL=51
Respuesta desde 86.186.85.186: bytes=32 tiempo=67ms TTL=51
Respuesta desde 86.186.85.186: bytes=32 tiempo=67ms TTL=51
Respuesta desde 86.186.85.186: bytes=32 tiempo=67ms TTL=51

Estadísticas de ping para 86.186.85.186:
    Paquetes: enviados = 4, recibidos = 4, perdidos = 0
    (0% perdidos),
Tiempos aproximados de ida y vuelta en milisegundos:
    Mínimo = 67ms, Máximo = 67ms, Media = 67ms

Command sequence:

AT
OK

AT+RST
OK
WIFI DISCONNECT
ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x40100000, len 1856, room 16 
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8 
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8 
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
SPI Speed      : 40MHz
SPI Mode       : QIO
SPI Flash Size & Map: 4Mbit(256KB+256KB)
jump to run user1 @ 1000

rlŽ‚rlŒžâ
ready

AT+GMR
AT version:0.60.0.0(Jan 29 2016 15:10:17)
SDK version:1.5.2(80914727)
compile time:Jan 29 2016 19:07:08
OK

AT+CWMODE?
+CWMODE:2
OK

AT+CWMODE_CUR=3
OK

AT+CWJAP_CUR="XXXX","XXXX"
WIFI CONNECTED
WIFI GOT IP
OK

AT+CIFSR
+CIFSR:APIP,"86.186.85.186"
+CIFSR:APMAC,"1a:fe:34:9b:c3:83"
+CIFSR:STAIP,"102.106.51.178"
+CIFSR:STAMAC,"c0:ca:41:00:47:40"
OK

AT+CIPMUX=1
OK

AT+CIPSERVER=1,80
OK

Am I missing something?

EDIT:
Expected result, more or less like (To be clear, I do not use any arduino sketch or whatever. I just use the serial monitor. The behaviour is the same using putty.

I connect to the ESP8266 chip using a usb-to-serial cable.

http response

But right now the explorer just says not found.

Best Answer

You are using IP addresses that are (likely) not LAN addresses. It's very unusual for your local network to run on 86.x.x.x and 102.x.x.x. LAN addresses are typically in 10.0.0./8, 172.16.0.0/12, and 192.168.0.0/16.

Find out what your router is using (you can do this by checking your computer's IP address, on Windows use ipconfig, on Mac use ifconfig). Then pick an address in the same subnet e.g. if your computer is 192.168.1.32, try 192.168.1.200. Note that your choice may collide with another device, if so, change it. You can find all devices on your local network with nmap or similar.

Typically, something like AT+CIPSTA="192.168.1.200","192.168.1.1","255.255.255.0" is what you want.

Once the ESP is configured, see if you can ping the ESP from your computer. Then direct your browser to the ESP's IP address, and see if you get a request in the serial monitor. Don't expect the browser to display a page, you aren't serving any content to the browser; inspecting the HTTP header in the serial monitor is enough to determine a successful connection.