I am using an ESP8266 module with the current ESP8266_NONOS_SDK_V2.0.0_16_08_10 firmware.
I am making GET requests via AT commands to PHP+MySQL servers.
Web servers - ESP8266 works fine .
Here everything works ok.
Whether I call the url in the browser: http://zzzzzzz.zzzzzzzzz.zz/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
or with AT commands in the ESP8266 module:
.
the server responds correctly:
.
and the data lands in a database on a server somewhere in Poland.
Server on local network - ESP8266 problem .
I have installed Apache + MySQL + PHP server on a computer with IP address 192.168.1.51 listening on port 80.
Typing the address 192.168.1.51 correctly runs the index.php script.
Calling the url in your browser:
http://192.168.1.51/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
or
192.168.1.51/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
correctly runs php script and adds record to database.
The server is seen by other computers, tablets or smartphones on the network by which the use of in a browser the above url correctly works regardless of whether the device is connected via LAN or WiFi.
The problem occurs when I want to do the same thing using the ESP8266 pointing to the IP address of a server on the local network:
.
CIPSTART responds, correctly connecting to the server
CIPSSEND also responds correctly with a prompt > and the ESP8266 waits for a GET to be sent.
After the GET is sent, it correctly reports that the correct number (81) of bytes have been received:
.
but generates a 400 Bad Request error:
.
I attach the Apache and PHP configuration files.
I've spent hours on this, searched the web for information, but found nothing that solves the problem or at least gives the cause.
I even tried specifying the port number in GET additionally by sending 84 characters:
.
but the effect is the same - connection ok, confirmation of receiving the correct number of GET bytes also ok, but unfortunately again error 400 Bad Request.
I am making GET requests via AT commands to PHP+MySQL servers.
Web servers - ESP8266 works fine .
Here everything works ok.
Whether I call the url in the browser: http://zzzzzzz.zzzzzzzzz.zz/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
or with AT commands in the ESP8266 module:
Code: Bash
the server responds correctly:
Code: Bash
and the data lands in a database on a server somewhere in Poland.
Server on local network - ESP8266 problem .
I have installed Apache + MySQL + PHP server on a computer with IP address 192.168.1.51 listening on port 80.
Typing the address 192.168.1.51 correctly runs the index.php script.
Calling the url in your browser:
http://192.168.1.51/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
or
192.168.1.51/dodaj_rek.php?n=129&u=1488723073&d=-51&s=203
correctly runs php script and adds record to database.
The server is seen by other computers, tablets or smartphones on the network by which the use of in a browser the above url correctly works regardless of whether the device is connected via LAN or WiFi.
The problem occurs when I want to do the same thing using the ESP8266 pointing to the IP address of a server on the local network:
Code: Bash
CIPSTART responds, correctly connecting to the server
CIPSSEND also responds correctly with a prompt > and the ESP8266 waits for a GET to be sent.
After the GET is sent, it correctly reports that the correct number (81) of bytes have been received:
Code: Bash
but generates a 400 Bad Request error:
Code: Bash
I attach the Apache and PHP configuration files.
I've spent hours on this, searched the web for information, but found nothing that solves the problem or at least gives the cause.
I even tried specifying the port number in GET additionally by sending 84 characters:
Code: Bash
but the effect is the same - connection ok, confirmation of receiving the correct number of GET bytes also ok, but unfortunately again error 400 Bad Request.