I am trying to get a sms Signal Quality Report to my sellphone

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

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); 

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);
  delay(1000);
  mySerial.println("AT");
  updateSerial();
  mySerial.println("AT+CMGF=1"); 
  updateSerial();
  mySerial.println("AT+CMGS=\"+************\"");
  updateSerial();
  mySerial.write("AT+CSQ");
  updateSerial();

  mySerial.write(26);

}

void loop()
{
}

void updateSerial()
{
  delay(500);
  while (Serial.available())
  {
    mySerial.write(Serial.read());
  }
  while (mySerial.available())
  {
    Serial.write(mySerial.read());
  }
}

help pls

Is your project/code based on a known fact or other peoples successful similar projects that demonstrate what you want to do can be done?

No CR (carriage return) after writing the CSQ.

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());
  }
}
  int  gsm , ( signalQuality) ;

You already have an object of type Sim800L called "gsm", and I'm unclear why "signalQuality" is in parentheses.

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 .

Have you been able to get the Signal Quality Report to simply display in the serial monitor?

Hi ,yes on the serial monitor i get the csq readings . but i can't send it to my sellphone.

JOHN_1973:
Hi ,yes on the serial monitor i get the csq readings . but i can't send it to my sellphone.

Have you been able to send a simple test message to your cell phone?

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

"* Signal quality is 0 *"

You may need to see if the form that the "CSQ" is being sent in is acceptable to the phone. Is it being sent as text or something else?

Inside updateSerial(), you are reading the incoming bytes to display them, then there’s nothing left in the buffer to read & send to the modem.

You need to read the value into a variable, then you can use it as many times as you want.

I faound this page in github it has the Methods and functions am i suppose to do somthing with, signalQuality() String return info about signal quality,here is the page .GitHub - vittorioexp/Sim800L-Arduino-Library-revised: The SIM800L Arduino Library is a simple and easy-to-use library for the SIM800L module, allowing for quick and efficient communication with the module using the Arduino platform.

Hi lastchancename , can you give me an example i'm not got in codes thanks for your reply.

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!