Electron Cellular RSSI returns 0

When I tried to run the following snippet on my electron, I got value 0. I tried to find the return value of RSSI and found either I get range from -113dBm to -51dBm or error values that are positive
1: indicating a Cellular module or time-out error
2: the module responded that the rssi value is not known, not detectable or currently not available.
from particle docs (https://docs.particle.io/reference/firmware/electron/#rssi-)

CellularSignal sig = Cellular.RSSI();
Serial.println(sig.rssi);

But there is no mention of 0 anywhere in docs. Is there something wrong with my code.

Where and how often in your code are you executing the request?
What does the example provided in the docs give you?

I’m getting the expected readings with this (slightly adapted) code

void setup() {
  pinMode(D7, OUTPUT);
}

void loop()
{
  static uint32_t lastUpdate = 0;
  uint32_t now = millis();
  
  // Print two methods of signal strength and signal quality every 20 seconds
  if (now - lastUpdate > 20000UL) {
    digitalWrite(D7, !digitalRead(D7));
    lastUpdate = now;
    CellularSignal sig = Cellular.RSSI();
    String s = String(sig.rssi) + String(",") + String(sig.qual);
    Serial.print(s);
    Serial.print(" is the same as ");
    Serial.println(sig);
  }
}
1 Like

Thanks for reply Scruff. I’m creating the CellularSignal object sig initially above setup and printing the value inside the loop. Would that cause an issue?

It should not really make a difference, but without seeing a working test code it’s not easy to tell.

However, you can take my code and gradually adapt it the way you want it and see if/when the issue comes back and if it does you may find out which change made the difference.