I'm facing a quite contradictory problem.
When I run my program, it's saying "init sim error" but the D3 LED on my SIM808 is bipping every 5seconds(which means it has established the connection). Kinda weird.. Because I checked on a phone and my SIM is definitely unblocked,
Does somebody have a possible answer to this ?
In case, here is my program
Arduino | module
PIN_TX | TX1
PIN_RX | RX1
Power the module, which is successful when the power indicator on the module is ON /
// #define CONNECT_BY_JUMPER 1 #if CONNECT_BY_JUMPER #define PIN_TX 7 #define PIN_RX 8
SoftwareSerial mySerial(PIN_TX, PIN_RX);
DFRobot_SIM808 sim808(&mySerial);
/*
Use Leonardo for push-in connection
Set DIP switch to 3-Arduino, and use the Serial1 of Leonardo for communication / #elif defined(ARDUINO_AVR_LEONARDO)
DFRobot_SIM808 sim808(&Serial1);
/*
Use UNO & MEGA2560 for push-in connection
Set DIP switch to 3-Arduino, and use the Serial of UNO and MEGA2560 for communication
*/ #else
DFRobot_SIM808 sim808(&Serial); #endif
//Mobile phone number,need to change #define PHONE_NUMBER "009665******15"
//The content of messages sent #define MESSAGE "hello,world"
Tx to Tx is wrong! One Tx must be connected to Rx of the receiver and vice vers.
What about the powering?
Schematics would make the suggestions better. Guesses are..... guesses, often wrong.
You need to be better at cleaning up the code after copy/paste from HTML.
/*
Arduino | module
PIN_TX | TX1
PIN_RX | RX1
Power the module, which is successful when the power indicator on the module is ON
*/
// #define CONNECT_BY_JUMPER 1
#if CONNECT_BY_JUMPER
#define PIN_TX 7
#define PIN_RX 8
SoftwareSerial mySerial(PIN_TX, PIN_RX);
DFRobot_SIM808 sim808(&mySerial);
/*
Use Leonardo for push-in connection
Set DIP switch to 3-Arduino, and use the Serial1 of Leonardo for communication
*/
#elif defined(ARDUINO_AVR_LEONARDO)
DFRobot_SIM808 sim808(&Serial1);
/*
Use UNO & MEGA2560 for push-in connection
Set DIP switch to 3-Arduino, and use the Serial of UNO and MEGA2560 for communication
*/
#else
DFRobot_SIM808 sim808(&Serial);
#endif
// Mobile phone number,need to change
#define PHONE_NUMBER "009665******15"
// 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
}