Hola comunidad de Arduino,
Estoy trabajando en un proyecto que implica el uso de un módulo SIM900 para realizar conexiones HTTPS a mi servidor. Tengo un certificado SSL configurado correctamente en el servidor, y la conexión HTTPS funciona cuando utilizo una URL diferente.
Sin embargo, al intentar conectarme a mi servidor con la URL específica https://integrabasureros.com/update_datetime.php, el módulo SIM900 devuelve el código de respuesta +HTTPACTION:0,603,0.
He probado varias configuraciones, asegurándome de que el servidor esté accesible y que el módulo SIM900 tenga una conexión GPRS activa. Incluso he considerado si podría haber algo en mi servidor que esté bloqueando la conexión del módulo SIM900.
Adjunto está mi código actual de Arduino.
#include <SoftwareSerial.h>
SoftwareSerial sim900(A8, A9);
const int sim900PowerPin = 23;
void setup() {
Serial.begin(19200);
sim900.begin(19200);
for (byte i = 0; i <= A5; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
pinMode(sim900PowerPin, OUTPUT);
/*
digitalWrite(sim900PowerPin, LOW);
delay(1000);
digitalWrite(sim900PowerPin, HIGH);
delay(1000);
digitalWrite(sim900PowerPin, LOW);
delay(5000);
*/
IniciarSim900();
}
void loop() {
if (sim900.available()) {
char incoming_char = sim900.read();
mensaje = mensaje + incoming_char;
Serial.write(incoming_char);
if (Serial.available()) {
sim900.write(Serial.read());
}
}
}
void IniciarSim900() {
Serial.println("Inicializando el módulo SIM900...");
for (int j = 0; j <= 10; j++) {
Serial.print(((j * 100) / 10));
Serial.print("% Completado");
Serial.println();
delay(1000);
}
Serial.println("Módulo SIM900 encendido");
SendATCommand("AT+SAPBR=3,1,\"Contype\",\"GPRS\"");
SendATCommand("AT+SAPBR=3,1,\"APN\",\"internet.itelcel.com\"");
SendATCommand("AT+SAPBR=1,1");
SendATCommand("AT+SAPBR=2,1");
SendATCommand("AT+CGATT?");
SendATCommand("AT+HTTPINIT");
SendATCommand("AT+HTTPPARA=\"CID\",1");
SendATCommand("AT+HTTPPARA=\"URL\",\"http://integrabasureros.com/update_datetime.php\"");
SendATCommand("AT+HTTPACTION=0"); //AT+HTTPACTION=0 petición GET AT+HTTPACTION=1 petición POST
SendATCommand("AT+HTTPREAD");
SendATCommand("AT+HTTPTERM");
SendATCommand("AT+SAPBR=0,1");
}
void SendATCommand(String command) {
sim900.println(command);
delay(3000);
while (sim900.available()) {
String response = sim900.readString();
delay(2000);
Serial.println(response);
delay(2000);
}
}
la sitio al que quiero acceder es un archivo php que hice para que cada vez que se conecte a el se actualice la fecha y hora y se haga update en una base de datos, si accedo directamente a esta URL funciona sin problemas el archivo php.
Alguien me podría ayudar ?