Solar Tracker using a ESP8266.
I have updated the ESP8266:-
AT version:1.7.5.0(Oct 9 2021 09:26:04)
SDK version:3.0.5(b29dcd3)
compile time:Oct 15 2021 18:05:30
The problem is I cannot get it to post the data, all other commands work OK
I was trying originally with 8 variables but have now just setup a 2 field
Database to test it. Sending a POST from a browser using the same PHP files
it works OK. But when sent from ESP8266 it comes up with "Undfined Array Key"
which is because the server is not reciveing the POST variable information.
This is the Commads sent:-
Code: Select all
AT+CIPSTART=0,"TCP","192.168.1.103",80\r\n
AT+CIPSEND=0,132\r\n
POST /insert.php, HTTP/1.1\r\n
Host: 192.168.1.103\r\n
User-Agent: Mozilla\r\n
Content-Type: application/x-www-form-urlencoded\r\n\r\n"]
\r\n\r\n
Content-Length: 20\r\n
\r\n\r\n
Col_1=,Dec Value1,&Col_2=,Dec Value2,\r\n\r\n
\r\n\r\n
The response from ESP8266:-
AT+CIPSTART=0,"TCP","192.168.1.103",80
0,CONNECT
OK
AT+CIPSEND=0,132
OK
>
Recv 132 bytes
SEND OK
+IPD,0,488:HTTP/1.1 302 Found
Date: Wed, 18 May 2022 17:00:17 GMT
Server: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.5
X-Powered-By: PHP/8.1.5
Location: http://192.168.1.103/
Content-Length: 254
Content-Type: text/html; charset=UTF-8
<br />
<b>Warning</b>: Undefined array key "Col_1" in <b>
C:\xampp\htdocs\insert.php</b> on line <b>17</b><br />
<br />
<b>Warning</b>: Undefined array key "Col_2" in <b>
C:\xampp\htdocs\insert.php</b> on line <b>18</b><br />
record created successfully
0,CLOSED
It does access the PHP file and adds a record to the Database but
the field values are empty.
Obviously the command sequence is not correct or I have somthing wrong
any help or suggestions would be good, thank you.