AT Command to Get the Signal Quality Report in GSM Engine, While running Blynk

how is it going to work if we are using blynk already?

You’d need to use the code with care, to ensure that you don’t cause a Blynk timeout while you’re waiting for the serial response, but it should work.


My devices is installed somewhere deep and it is difficult to test the code. I could use some more info before I get to test it on my project. Your help is much appreciated!

So can i just run a function like this in the middle of programming every x seconds?

void checkSignall() 

  SerialSIM800L.write("AT+CMGF=1\r");           //set GSM to text mode
  SerialSIM800L.write("AT+CSQ=?\r");             //Test Command for Signal Quality Report
  SerialSIM800L.write("AT+CMGF=0\r");           //set GSM back to the previous state??

How can I return the module to the initial config so it can work normally with Blynk without loosing the connection to the Blynk Server?

And how do I convert the returned values into a percentage ? What it should be the value for full strength signal? The values look kinda strange to me.


I don’t know, I haven’t tried this technique and stopped using a SIM900 several years ago.


Well, you can map the received RSSI like map(rssi,0,31,0,100) and you “should” be good. That delay isn’t good though… substitute it with millis() instead…
Oh, yeah… you’ll need to parse that value out, because you get two values, rssi and ber…

I got this info from a java application used for testing this type of modules.

The signal strength range is -53 dbm (Excellent) to -109 dbm (Marginal).

As this is a “solved” post I would expect @Gunner to split this one into your own :thinking: :smiling_imp:
As per your question… if you use the code provided by @PeteKnight (in January 2018) and read what you get, you’ll see, that the code (well SIM900 via AT commands) returns two values, comma seprated. First one being rssi where 0 is around -115dBm and 31 is -52dBm, second value is BER where 0 is no BER, and 7 is cr*p.

1 Like

Looks like I missed one :blush: no one is perfect :wink:

As I suspect there is more to running AT commands on the same module that Blynk is connected to, I also suspect this particular question isn’t resolved yet. The OP may have some more work to do to figure it out. Perhaps some trial and error?

So… consider it moved.

1 Like

In the TinyGSMClientSIM800.h i found:

  int getSignalQuality() {
    if (waitResponse(GF(GSM_NL "+CSQ:")) != 1) {
      return 99;
    int res = stream.readStringUntil(',').toInt();
    return res;

so… apparently is as simple as:

void checkSignall() 
  Serial.println("Signall Quality:" + String( modem.getSignalQuality( ) ));

… But, using that function it gets it the RSSI only ? How is it going to work if the ber is >0 ? And most important how should I simplify the ber and rssi ratio into a single % value? as it is on any mobile device.

Description: AT+CSQ AT command returns the signal strength of the device. Possible values are, 0 113 dBm or less 1 111 dBm 2...30 109... 53 dBm 31 51 dBm or greater 99 not known or not detectable Examples: AT+CSQ? +CSQ:18,99 AT+CSQ +CSQ: 4,0 OK



+CSQ: 24,0

Signal level is -65 dbm. Signal condition is excellent.The signal strength range is -53 dbm (Excellent) to -109 dbm (Marginal).

The description is taken from a java app called AT Command Tester

I am happy with only the RSSI for now.
I guess now you can mark it as SOLVED , but the title probably needs updated again :smiley: