Connect WEMOS D1 R32 and SIM800L

2.3k Views Asked by At

few day I'm trying to connect SIM800L module and WeMos D1 R32 board. But any response from SIM module (SIM module is connected to GSM network, LED blink slow. But any response to commands Also I triedy SIM900). WIFI works fine.

WEMOS D1 R32 SKETCH

Main task why I decided to use Wemosd D1 R32 and SIM module is connection to server by wifi check for (new) data and (if any new data occured) send message to phone. Maybe exist another better solution how handle this process. If someone has an better idea, let me know.

Ther is a part of code :

void setup() {

  Serial.begin(9600);
  Serial2.begin(9600);

  delay(1000);
  
  while (!Serial);
   
    tNow = millis(); //Set timer for connection
    
    WiFi.begin(ssid, passphrase);
    //  Wait up to 30 seconds to connect.
    while ((WiFi.status() != WL_CONNECTED) && (millis() - tNow < 30000))
    {
        delay(250);
        Serial.print(".");
    }

    if (WiFi.status() == WL_CONNECTED)
    {
        Serial.println("");
        Serial.print("IP address: "), Serial.println(WiFi.localIP());
    }
  
  Serial.println("Check for signal...");
  Serial2.println("AT");
  delay(2000);
  Serial2.println("AT+CGATT?");
  delay(2000);
  
}

void loop() {
  
  //If some data income read => available while data downloading
  while (client.available()) {
    char c = client.read();
    Serial.write(c); 
  }

  while (Serial2.available()){  
    Serial.write(Serial2.read());
  }

}
0

There are 0 best solutions below