Description
The GSMBand class provides methods to read and configure the RAT (radio access technoloy) and RAT search sequence of the modem. The dice-IoT modem can operate in LTE-CAT-M1 (eMTC), EDGE (2G) and NBIoT mode. The GSMBand class is normally not necessary for normal applications, the default settings are good to be used. Also, be aware that the DICENB GSM class automatically sets the RAT sequence to CAT-M1 > EDGE > NBIoT.
To use this class
#include "DICENB.h" GSMBand band;
Syntax
band.begin() – starts the modem. This is only necessary if the modem has not yet been started by any other class (e.g. GSM.begin() etc.)
band.getBand() – returns the modem string information ‘RAT, Operator, Band, Channel’ about the current network registration.
band.getRAT() – returns the configured (allowed) RATs to be searched for. (String):’GSM’, ‘LTE’, AUTO’ – ‘AUTO’=GSM o. LTE.
band.setRAT( os_RAT ) – sets the RAT to be used: “LTE”, “GSM”, “AUTO” (LTE, GSM only or AUTO=both).
band.getSEQ() – returns the search sequence 00=Automatic (eMTC -> NB-IoT -> GSM) 01=GSM 02=eMTC 03=NB-IoT)
band.setSEQ( os_sequence ) – sets the RAT Sequence order to be searched for (default: 020301) 01=GSM 02=eMTC 03=NB-IoT) )
Parameters
String os_RAT – Either “LTE“, “GSM” or “AUTO“
String os_sequence – Recommended: “020103” – means: try LTE-CAT-M1 first, then EDGE and finally NB-IoT.
Returns
getBand(), getRAT() and getSEQ() return String, (note: eMTC=LTE-CAT-M1 / GSM=GSM, GPRS, GSM / NBIoT=LTE-NB-IoT)
setRAT(), setSEQ() return bool, true: success, false: error
begin() returns int: 1: OK modem was started, 0: error
Example Code
This example shows how to read the current technology in use. Please see the more comprehensive example in the Arduino IDE:DICENB -> Tools -> BandManagement
#include "DICENB.h"
GSMBand band;
void setup() {
while(!Serial);
Serial.println("Starting modem...");
band.begin();
Serial.println(" RAT, Operator, Band, Channel");
}
void loop() {
Serial.println("Current band: " + band.getBand());
delay(5000);
}
Notes and Warnings
Note: The DICENB GSM class automatically sets the RAT sequence to CAT-M1 > EDGE > NBIoT.
LTE-CAT-M1 and EDGE are the preferred technologies due to the data throughput, the range and acceptance by international providers. NBIoT seems not as broadly available and has limits in terms of mobility of the clients and in particular the limited data rates provided.