I have by one site the esp 8266 controlled via serial.....
#include <SoftwareSerial.h>
SoftwareSerial esp8266A(10,11);
#define serialCommunicationSpeed 9600
#define DEBUG true
String ServerToPing = "https://www.google.com";
//here you send info to website
void setup()
{
Serial.begin(serialCommunicationSpeed);
esp8266A.begin(serialCommunicationSpeed);
InitWifiModule();
}
void loop()
{
if(esp8266A.available())
{
if(esp8266A.find("+IPD,"))
{
delay(1000);
Serial.println("FROM Loop arudiono reading");
int connectionId = esp8266A.read()-48;
String webpage = "<h1>Hello World!</h1> <head><title>HTML Elements Reference</title></head>";
String cipSend = "AT+CIPSEND=";
cipSend += connectionId;
cipSend += ",";
cipSend +=webpage.length();
cipSend +="\r\n";
sendData(cipSend,1000,DEBUG);
sendData(webpage,1000,DEBUG);
String closeCommand = "AT+CIPCLOSE=";
closeCommand+=connectionId; // append connection id
closeCommand+="\r\n";
sendData(closeCommand,3000,DEBUG);
}
}
}
String sendData(String command, const int timeout, boolean debug)
{
String response = "";
esp8266A.print(command);
long int time = millis();
while( (time+timeout) > millis())
{
while(esp8266A.available())
{
char c = esp8266A.read();
response+=c;
}
}
if(debug)
{
Serial.print(response);
}
return response;
}
void InitWifiModule()
{
sendData("AT+RST\r\n", 2000, DEBUG);
sendData("AT+CWMODE=1\r\n", 1500, DEBUG);
sendData("AT+CWJAP=\"Meu\",\"1234567890\"\r\n", 2000, DEBUG);
delay (3000);
sendData("AT+CWMODE=1\r\n", 1500, DEBUG);
delay (1500);
sendData("AT+CIFSR\r\n", 1500, DEBUG);
delay (1500);
sendData("AT+CIPMUX=1\r\n", 1500, DEBUG);
delay (1500);
sendData("AT+CIPSERVER=1,80\r\n", 1500, DEBUG);
delay (2500);
sendData("AT+CIPSTART=0,\"TCP\",\"185.27.134.176\",80\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPSEND=5\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPCLOSE=\"185.27.134.176\"\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPSTART=0,\"TCP\",\"185.27.134.176\",80\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPCLOSE=\"185.27.134.176\"\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPSTART=0,\"TCP\",\"185.27.134.176\",80\r\n", 4000, DEBUG); //0 HERE
delay (10000);
sendData("AT+CIPCLOSE=\"185.27.134.176\"\r\n", 4000, DEBUG); //0 HERE
delay (10000);
}
And this connects just fine, the problem is that when it gets to acces the visit the http://boarvisitor.infinityfreeapp.com/?i=1 it never ever does increase the visits.... any idea how you would make the esp 8266 when doing a cipsen or cipstart AT commands make this 1 go up so, or add another 1 in this case....
My website runs with PHP everytime you visit it you get a +1 ...
I am using the serial softwareserial.h header to communicate arduino to the esp8266 esp 01 module.
How do you go and make it "visit" your php website?
Also the serial says this
07:21:20.794 -> OK
07:21:20.794 -> Linked
07:21:34.831 -> AT+CIPSTATUS=0,"TCP","185.27.134.176",80,0
07:21:34.909 -> no this fun
07:21:54.914 -> AT+CIPSEND=0,39
07:21:54.914 -> > AT+CIPCLOSE="185.27.134.176"
07:22:18.990 -> OK
07:22:18.990 -> Unlink