Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE
could be problems with SoftwareSerial or power supply or noise
if you power the UNO and SIM808 from a USB is it OK?
I have used this to check AT commands on a SIM800
// SIM800l AltSoftSerial test
#include <AltSoftSerial.h>
#include <SPI.h>
#include <Wire.h>
// Mega SIM800l test
//SIM800L 5V POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L TXD to Mega RX pin 48
//SIM800L RXD to Mega TX pin 46
//SIM800L VDD to Mega 5V
//SIM800L UART TTL GND and RST not connected
//SIM800L TXD to UNO RX pin 8
//SIM800L RXD to UNO TX pin 9
// taking the RST pin to GND for a couple of seconds which will reset the device
// RS232 shield
// RS232 TXD to UNO pin 9
// =[===RS232 RXD to UNO pin 8
AltSoftSerial simSerial;
void setup() {
Serial.begin(115200);
Serial.println("AltSoftSerial test");
//Begin serial communication with Arduino and SIM800L
simSerial.begin(9600);
Serial.println("SIM module intialized");
}
void loop() {
if (Serial.available()) {
char command = Serial.read();
//Serial.println(command);
simSerial.print(command);
}
while (simSerial.available()) {
char reponse = simSerial.read();
Serial.print(reponse);
}
}
connected to a UNO pins 8 and 9 it displays
AT
OK
AT+CGMI
SIMCOM_Ltd
OK
AT+CGMM
SIMCOM_SIM800L
looking at the sim808 Hardware design manual it states " User can power on the SIM808 by pulling down the PWRKEY for at least 1 second"
what SIM808 module is it?
This one is responding that the sim has initialized but I havent a clue where to put phone numbers in.. I am very new, and the code is still escaping me a bit.
#include <DFRobot_SIM808.h>
#include <sim808.h>
#include <SoftwareSerial.h>
#define MESSAGE_LENGTH 160
char message[MESSAGE_LENGTH];
int messageIndex = 0;
char MESSAGE[300];
char lat[12];
char lon[12];
char wspeed[12];
char phone[16];
char datetime[24];
#define PIN_TX 3
#define PIN_RX 2
SoftwareSerial mySerial(PIN_TX,PIN_RX);
DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,
void setup()
{
mySerial.begin(9600);
Serial.begin(9600);
//******** Initialize sim808 module *************
while(!sim808.init())
{
Serial.print("Sim808 init error\r\n");
delay(1000);
}
delay(3000);
if( sim808.attachGPS())
Serial.println("Open the GPS power success");
else
Serial.println("Open the GPS power failure");
Serial.println("Init Success, please send SMS message to me!");
}
void loop()
{
//*********** Detecting unread SMS ************************
messageIndex = sim808.isSMSunread();
//*********** At least, there is one UNREAD SMS ***********
if (messageIndex > 0)
{
Serial.print("messageIndex: ");
Serial.println(messageIndex);
sim808.readSMS(messageIndex, message, MESSAGE_LENGTH, phone, datetime);
//***********In order not to full SIM Memory, is better to delete it**********
sim808.deleteSMS(messageIndex);
Serial.print("From number: ");
Serial.println(phone);
Serial.print("Datetime: ");
Serial.println(datetime);
Serial.print("Recieved Message: ");
Serial.println(message);
while(!sim808.getGPS())
{
}
Serial.print(sim808.GPSdata.year);
Serial.print("/");
Serial.print(sim808.GPSdata.month);
Serial.print("/");
Serial.print(sim808.GPSdata.day);
Serial.print(" ");
Serial.print(sim808.GPSdata.hour);
Serial.print(":");
Serial.print(sim808.GPSdata.minute);
Serial.print(":");
Serial.print(sim808.GPSdata.second);
Serial.print(":");
Serial.println(sim808.GPSdata.centisecond);
Serial.print("latitude :");
Serial.println(sim808.GPSdata.lat);
Serial.print("longitude :");
Serial.println(sim808.GPSdata.lon);
Serial.print("speed_kph :");
Serial.println(sim808.GPSdata.speed_kph);
Serial.print("heading :");
Serial.println(sim808.GPSdata.heading);
Serial.println();
float la = sim808.GPSdata.lat;
float lo = sim808.GPSdata.lon;
float ws = sim808.GPSdata.speed_kph;
dtostrf(la, 0, 2, lat); //put float value of la into char array of lat. 6 = number of digits before decimal sign. 2 = number of digits after the decimal sign.
dtostrf(lo, 0, 2, lon); //put float value of lo into char array of lon
dtostrf(ws, 0, 2, wspeed); //put float value of ws into char array of wspeed
//sprintf(MESSAGE, "Latitude : %s\nLongitude : %s\nWind Speed : %s kph\nMy Module Is Working. Try With This Link.\nhttp://www.latlong.net/Show-Latitude-Longitude.html\nhttp://maps.google.com/maps?q=%s,%s\n", lat, lon, wspeed, lat, lon);
sprintf(MESSAGE, "Latitude : %s\nLongitude : %s\nWind Speed : %s kph\nMy Module Is Working.\nhttp://maps.google.com/maps?q=%s,%s\n", lat, lon, wspeed, lat, lon);
Serial.println("Sim808 init success");
Serial.println("Start to send message ...");
Serial.println(MESSAGE);
Serial.println(phone);
sim808.sendSMS(phone,MESSAGE);
//************* Turn off the GPS power ************
//sim808.detachGPS();
}
}
you need to read the library documentation
I tend to use AT commands directly, e.g.send a SMS text
AT+CMGS=”+TTTTT” where TTTTT is the destination number
e.g. AT+CMGS="+447967123456" you must use International Dialling code format
My goal is to make my own alarm system for my shop that will text me, l am very new to this. That last link you sent looks promising, I will follow the instructions and see if that works.