Using the same code between a U260 module and a E402 module the RSSI value in the E402 always returns 1 while the U260 returns expected values.
Below is the code I’m using. Is there a difference with how the E402 returns RSSI?
void wirelessSignalDisplay() {
static int16_t wirelessRSSI = -1;
static uint32_t prevRSSIMillis = 0; // timer to only read the cellular rssi at certain frequency
static const uint8_t x = 160;
static const uint8_t y = 16;
if (millis() - prevRSSIMillis >= 500){
if (Particle.connected()) {
#if PLATFORM_ID == PLATFORM_ELECTRON_PRODUCTION //This is broken out seperately due to uint64 var size.
#define RADIO Cellular
CellularSignal sig = Cellular.RSSI();
Serial.print("sig: "); Serial.println(sig);
wirelessRSSI = sig.rssi;
Serial.println(wirelessRSSI);
#elif PLATFORM_ID == PLATFORM_P1
#define RADIO WiFi
wirelessRSSI = WiFi.RSSI();
#endif
if (wirelessRSSI < -95){ //low
// pxs.drawCompressedBitmap(x, y, img_wifi_0_BL_png_comp);
drawConnectionStatusIcon(x, y, WIRELESS25);
} else if (wirelessRSSI < -85){ //25%
// pxs.drawCompressedBitmap(x, y, img_wifi_33_BL_png_comp);
drawConnectionStatusIcon(x, y, WIRELESS50);
} else if (wirelessRSSI < -70){ //50%
// pxs.drawCompressedBitmap(x, y, img_wifi_66_BL_png_comp);
drawConnectionStatusIcon(x, y, WIRELESS75);
} else if (wirelessRSSI < -1){ //75%
// pxs.drawCompressedBitmap(x, y, img_wifi_full_BL_png_comp);
drawConnectionStatusIcon(x, y, WIRELESS100);
} else {
// pxs.drawCompressedBitmap(x, y, img_wifi_0_BL_png_comp);
drawConnectionStatusIcon(x, y, WIRELESS0);
}
eraseWirelessExclamation(x, y);
} else if (RADIO.connecting()){
drawConnectionStatusIcon(x, y, WIFICONNECTING);
} else if (battPower){
pxs.setColor(DK_BLUE_BACK);
pxs.fillRectangle(x,y,30,20);
}
prevRSSIMillis = millis();
}
}
Also my above program started to report expected RSSI vaulues on 10/22 and I didnt change anything, but today it is now reporting RSSI as 1. This is strange behavior. I am having my device go to Deep sleep frequently, so maybe the procedure to turning off the LTE is causing something to happen…
It seems that thiss issue happens after the device goes to deep sleep and then wakes up. When RSSI was returning 1 i removed all power (hard reset) and then the RSSI values showed up correctly.
@rickkas7, I’ve found that the only way to clear up the RSSI of returning 1 while the device is still connected to Particle and able to publish events is to deep sleep the device for 5 or 10 seconds.
This is less than ideal becasue it is a device that a user intacts with multiple times a day.