The use of the ESP8266 in the world of IoT

User avatar
By dominmdoom
#89859 Greetings to all, I need help to send data to my website using php via the url:

pagina.com/lapagina.php?variable=data

the problem is that my website has SSL certification and there is no longer communication; I could make it work with fingerprint but this is renewed every 3 months which is not practical, I tried the examples of safe communication but I did not work any.

I leave the code I use with fingerprint.

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

const char* ssid = ".......";
const char* password = "........";
String requestResult = "";
String requestResult1 = "";
void setup()
{
Serial.begin(115200);
delay(10);

// Conecta a la red wifi.
Serial.println();
Serial.print("Conectando con ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Conectado con WiFi.");

// Esta es tu IP
Serial.print("Esta es tu IP: ");
Serial.print(WiFi.localIP());
String completeURI = "https://www.pagina.com/lapagina.php?variable=data";

//send HTTP request
HTTPClient http;
http.begin(completeURI, "42dfb9904f978d2b9e7f41ec65032a910a91636a");
requestResult = http.GET();
requestResult1 = http.getString();
Serial.println(requestResult);
Serial.println(requestResult1);
}

void loop()
{
}
User avatar
By davydnorris
#89867 You may get better responses if you move this to the Arduino section, as this code is Arduino, however you will need to use a secure HTTP Client and right now you're not.

Check out this example:

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino