hi
I am having problems with the GSM SIM800L module, I want to use this GSM SIM800L module as a replacement for WiFi so that the data I send can be input to IFTTT. but the program I created doesn't run and doesn't even appear on the serial monitor. Using a SIM CARD is also appropriate and can still be used, but when using the GSM SIM8000L module it cannot run. what's the solution?
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <SoftwareSerial.h>
#define SIM800_TX_PIN 27
#define SIM800_RX_PIN 26
SoftwareSerial SIM800(SIM800_TX_PIN, SIM800_RX_PIN);
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme; // I2C
const char* IFTTT_API_KEY = "dUAMY_6tEaE9doYwCO0gl2OVmUL-bu4IjVilYf25L24";
void setup() {
Serial.begin(9600);
SIM800.begin(9600);
if (!bme.begin()) {
Serial.println("Could not find BME280 sensor, check wiring!");
while (1);
}
delay(5000);
connectGPRS();
}
void loop() {
float temperature = bme.readTemperature();
float humidity = bme.readHumidity();
float pressure = bme.readPressure() / 100.0F;
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
sendToIFTTT(temperature, humidity, pressure);
delay(60000); // Wait for 1 minute before sending data again
}
void connectGPRS() {
Serial.println("Connecting to GPRS...");
SIM800.println("AT+SAPBR=3,1,\"Contype\",\"GPRS\"");
delay(1000);
SIM800.println("AT+SAPBR=3,1,\"APN\",\"indosatgprs\"");
delay(1000);
SIM800.println("AT+SAPBR=1,1");
delay(5000); // Wait for GPRS connection
Serial.println("Connected to GPRS");
}
void sendToIFTTT(float temp, float humidity, float pressure) {
String url = "https://maker.ifttt.com/trigger/GSM_COBA/with/key/dUAMY_6tEaE9doYwCO0gl2OVmUL-bu4IjVilYf25L24";
url += IFTTT_API_KEY;
url += "?value1=";
url += String(temp);
url += "&value2=";
url += String(humidity);
url += "&value3=";
url += String(pressure);
Serial.print("Sending data to IFTTT: ");
Serial.println(url);
SIM800.println("AT+HTTPINIT");
delay(2000);
SIM800.println("AT+HTTPPARA=\"CID\",1");
delay(2000);
SIM800.print("AT+HTTPPARA=\"URL\",\"");
SIM800.print(url);
SIM800.println("\"");
delay(2000);
SIM800.println("AT+HTTPACTION=0");
delay(10000); // Delay to ensure request is processed
SIM800.println("AT+HTTPTERM");
}

