I have a ESP8266 and a website i want it to do something to visit the website

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

how is that a command line tool question?

If I understand you and you want that visitor counter URL to be issued when someone opens your "hello world " web page in their Web browser, you embed some html or javascript in that Web page.

yes I want it to do something so the count visit increases check the websigte when you visit it it has a new "1" in the list.

Sorry I barely understand your categrories with all the respect.

Hello,

this is where you have posted

do yourself a favour and please read How to get the best out of this forum and modify your post accordingly

Maybe it is not so easy to do in a browser as I first suggested. Requests to severs other than the one hosting the webpage are usually blocked by a "cross-origin request" rule.

There are a number of examples of using ESP8266 AT commands to issue an HTTP GET instruction, for example here: arduino uno - Get data from website with ESP8266 using AT commands - Arduino Stack Exchange.

One difference is that your send here: sendData("AT+CIPSEND=5\r\n", 4000, DEBUG); //0 HERE is not followed by a "GET /" statement which would appear to be an essential part of issuing a URL. Note also that CIPSEND also has a length parameter of the item to be sent, including the trailing CRLF characters.

ok I have found this I will keep you POSTed.....ESP8266 Send Data To a Website (ESP-01/ESP-12) - YouTube

I moved your topic to a more appropriate forum category @deltaneonrobot.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.