Hi freands i am trying to get a sms Signal Quality Report to my sellphone from my sim 800l ,but i cant read it . on my sms i get the reading AT+CSQ .I am doing somthing wrong here
mySerial.write("AT+CSQ"); can somwone help
Hi friends, im still trying to get sms signal quality .on this code i get a read sms ( zero 0 )on my sellphone . i searched the liberys for sim800l and faound this methods and functions, signalQuality() String return info about signal quality. what am i doing wrong ,help please. thanks
#include <Sim800L.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
Sim800L gsm;
void setup()
{
int gsm , ( signalQuality) ;
Serial.begin(9600);
mySerial.begin(9600);
delay(1000);
mySerial.println("AT");
updateSerial();
mySerial.println("AT+CSQ");// SEE SIGNAL IN MONETER
updateSerial();
mySerial.println("Serial");
updateSerial();
mySerial.println("AT+CMGF=1");
updateSerial();
mySerial.println("AT+CMGS=\"+************\"");
updateSerial();
mySerial.println("Signal quality is ");
mySerial.println(gsm);// SEND SMS SINGNALQUALITY TO MT SELLPHONE
mySerial.write(26);
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());
}
while (mySerial.available())
{
Serial.write(mySerial.read());
}
}
hi thanks for your reply ,( signalQuality ) i put it in parentheses to read it from the libary,am not shure if i am doing it right .can you help me . write it .
yes i recive the message , the message i get is * Signal quality is 0 * zero is what mySerial.println(gsm);// SEND SMS SINGNALQUALITY TO MT SELLPHONE . Does it have to do with the libarys
void updateSerial() {
char c; // local temp variable to hold each character
// delay(500); // what's this for... bad program style !! ###
while (Serial.available()) { // are there characters waigint in the serial RX buffer
c = Serial.read(); // get a SINGLE character from console - once
Serial.write(mySerial.read()); // echo to console
mySerial.write(c); // send to mySerial
}
}
Something like this, but you need to collect the whole reply sentence and parse it, not just single character by character if you want to process it.
A simple way of capturing the contents of the serial input buffer into a String variable, then printing that variable to the serial tx.
//zoomkat 6-29-14 Simple serial echo test
//type or paste text in serial monitor and send
String readString;
void setup() {
Serial.begin(9600);
Serial.println("Simple serial echo test"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the String readString
delay(3); //slow looping to allow buffer to fill with next character
}
if (readString.length() > 0) {
Serial.println(readString); //so you can see the captured String
readString = "";
}
}
Naughty, naughty...
Teaching beginners to use the String class. >:(
String should be avoided on small-memory micocontrollers like the 8-bit AVRs, due to memory fragmentation issues.
Its not forbidden, but as your programs get 'smarter', you're ore likely to experience unpredictable* crashes, and think it's your code - while it's actually the intenrals failing.
Where possible use c-strings... a little more complicated, but you're far more 'in control'.
logically predictable in code execution, but effectively unpredictable to the typical user!