I recently bought a module sim 808 evb-v3.2 and I wanted to do a basic test.
From the following code I want to write AT commands in the serial terminal and get an answer from the module
#include <SoftwareSerial.h>
SoftwareSerial SIM808(7, 8); //Seleccionamos los pines 7 como Rx y 8 como Tx
void setup()
{
SIM808.begin(9600);
Serial.begin(9600);
delay(100);
}
void loop()
{
//Envíamos y recibimos datos
if (Serial.available() > 0)
SIM808.write(Serial.read());
if (SIM808.available() > 0)
Serial.write(SIM808.read());
}
First guess, is the device actually configured for 9600 baud? Second guess, is your Serial Monitor window configured for 9600 baud? The latter is what I expect is wrong.
Oh for the clarity of a simple schematic, even one drawn with pen on an envelope.
Without that,
Is it RX-TX, TX-RX, or RX-RX, TX-TX? The latter is wrong.
Is there a common ground between the two boards? Might be that white wire?
Stick with 9600 or 19200 for software serial.
I really don't know what I am doing wrong here, It looks that the module is fine due the sim led is blinking every 3 seconds and now is getting the proper power (9V 2A)
You were right!
I added that line of code in the first program:
#include <SoftwareSerial.h>
SoftwareSerial SIM808(7, 8); //Seleccionamos los pines 7 como Rx y 8 como Tx
void setup()
{
SIM808.begin(9600);
Serial.begin(9600);
SIM808.println("AT+IPR=9600");
delay(100);
}
void loop()
{
//Envíamos y recibimos datos
if (Serial.available() > 0)
SIM808.write(Serial.read());
if (SIM808.available() > 0)
Serial.write(SIM808.read());
}
and now I can see the answer from the module
I even tried with calling my phone number with the ATD comand and it's working!!
But well I really want to understand what happened here.
Do I need to always set the module baud rate?? It is not getting a default bauld rate to work with? Because in any basic tutorial there isn't a step to set the bauld rate, like it just runs and works with default settings or maybe I'm not understanding things right.