Cellular
CellularSignal Class
This class allows to query a number of signal parameters of the currently connected Cellular network.
getAccessTechnology()
// SYNTAX
CellularSignal sig = Cellular.RSSI();
int rat = sig.getAccessTechnology();
Gets the current radio access technology (RAT) in use.
The following radio technologies are defined:
NET_ACCESS_TECHNOLOGY_GSM
: 2G RATNET_ACCESS_TECHNOLOGY_EDGE
: 2G RAT with EDGENET_ACCESS_TECHNOLOGY_UMTS
/NET_ACCESS_TECHNOLOGY_UTRAN
/NET_ACCESS_TECHNOLOGY_WCDMA
: UMTS RATNET_ACCESS_TECHNOLOGY_LTE
: LTE RATNET_ACCESS_TECHNOLOGY_LTE_CAT_M1
: LTE Cat M1 RAT
getStrength()
Gets the signal strength as a percentage (0.0 - 100.0). See getStrengthValue()
on how raw RAT-specific strength values are mapped to 0%-100% range.
// SYNTAX
CellularSignal sig = Cellular.RSSI();
float strength = sig.getStrength();
// EXAMPLE
CellularSignal sig = Cellular.RSSI();
Log.info("Cellular signal strength: %.02f%%", sig.getStrength());
Returns: float
getQuality()
Gets the signal quality as a percentage (0.0 - 100.0). See getQualityValue()
on how raw RAT-specific quality values are mapped to 0%-100% range.
// SYNTAX
CellularSignal sig = Cellular.RSSI();
float quality = sig.getQuality();
// EXAMPLE
CellularSignal sig = Cellular.RSSI();
Log.info("Cellular signal quality: %.02f%%", sig.getQuality());
Returns: float
Note: qual
is not supported on 2G Electrons (Model G350) and will return 0.
LTE Cat M1 devices (SARA-R410M-02B modem) only return qual with Device OS 1.5.0 and later. Earlier versions returned 0.
getStrengthValue()
// SYNTAX
CellularSignal sig = Cellular.RSSI();
float strength = sig.getStrengthValue();
Gets the raw signal strength value. This value is RAT-specific. See getAccessTechnology()
for a list of radio access technologies.
- 2G RAT / 2G RAT with EDGE: RSSI in dBm. Range: [-111, -48] as specified in 3GPP TS 45.008 8.1.4.
- UMTS RAT: RSCP in dBm. Range: [-121, -25] as specified in 3GPP TS 25.133 9.1.1.3.
- LTE Cat M1 RAT: Range: [-141, -44] (dBm)
- LTE Cat 1 RAT: Range: [-141, -44] (dBm)
Returns: float
getQualityValue()
// SYNTAX
CellularSignal sig = Cellular.RSSI();
float quality = sig.getQualityValue();
Gets the raw signal quality value. This value is RAT-specific. See getAccessTechnology()
for a list of radio access technologies.
- 2G RAT: Bit Error Rate (BER) in % as specified in 3GPP TS 45.008 8.2.4. Range: [0.14%, 18.10%]
- 2G RAT with EDGE: log10 of Mean Bit Error Probability (BEP) as defined in 3GPP TS 45.008. Range: [-0.60, -3.60] as specified in 3GPP TS 45.008 10.2.3.3.
- UMTS RAT: Ec/Io (dB) [-24.5, 0], as specified in 3GPP TS 25.133 9.1.2.3.
- LTE Cat M1 RAT: Range: [-20, -3] (dB)
- LTE Cat 1 RAT: Range: [-20, -3] (dB)
Returns: float
Note: qual
is not supported on 2G Electrons (Model G350) and will return 0.
Before 0.8.0:
Before Device OS 0.8.0, the CellularSignal
class only had two member variables, rssi
, and qual
. These are removed in Device OS 3.0.0 and later and you should use getStrengthValue()
and getQualityValue()
instead.
// Prior to 0.8.0:
CellularSignal sig = Cellular.RSSI();
Serial.println(sig.rssi);
Serial.println(sig.qual);