DFRobot SIM808 init error

Hey y'all. I have a DFRobot SIM808 which sits with all its pins on an Arduino Uno. I am trying to send SMS using this module but it keeps bringing me init error and the next line says AT. By the way, the code is an example code for this module. The error in getting is

Sim808 init error
AT

here is the code

#include <DFRobot_SIM808.h>

#if CONNECT_BY_JUMPER
  #define PIN_TX    10
  #define PIN_RX    11
  SoftwareSerial mySerial(PIN_TX, PIN_RX);
  DFRobot_SIM808 sim808(&mySerial);

#elif defined(ARDUINO_AVR_LEONARDO)
  DFRobot_SIM808 sim808(&Serial1);

#else
  DFRobot_SIM808 sim808(&Serial);
#endif

#define PHONE_NUMBER "0996205639"

//The content of messages sent
#define MESSAGE  "hello,world"

void setup() {
  #if CONNECT_BY_JUMPER
    mySerial.begin(9600);
  #elif defined(ARDUINO_AVR_LEONARDO)
    Serial1.begin(9600);
  #endif
  Serial.begin(9600);

  //******** Initialize sim808 module *************
  while(!sim808.init()) {
      delay(1000);
      Serial.print("Sim808 init error\r\n");
  }  
  Serial.println("Sim808 init success");
  Serial.println("Start to send message ...");

  //******** define phone number and text **********
  sim808.sendSMS((char *)PHONE_NUMBER, (char *)MESSAGE); 
}

void loop() {
  //nothing to do
}

How is your device connected... this part of the code is looking for:

#define CONNECT_BY_JUMPER 1

This example has instructions in the sketch...

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