Boron - getBandAvailable and getBandSelect not working

I am using these two functions within my device code but they return ‘0’ instead of the actual bands. In my case the device is connected to the network and i can also publish events to the cloud. The network supports Band 20.

CellularBand band_avail;
Cellular.getBandAvailable(band_avail);

CellularBand band_sel;
Cellular.getBandSelect(band_sel);

Did anyone use this already and get it to work?

thanks
Marc

It’s not yet supported (as of 0.8.0-rc.27). It will be implemented, but I’m not sure when.

Thanks a lot. This explains it. Will wait for a version that supports it then. I hope soon. At least getBandAvailable to detect if a usefull network is present.

is this feature enable getBand Select?

@rickkas7 does this function format look ok? It works and returns band 12 when I run it.

I only included bands 2,4,12 initally because ATT LTE M1 only uses those

It looks like it is not yet implemented, so i made my own function.
Using this table to convert the earfcn to a band: https://www.cablefree.net/wirelesstechnology/4glte/lte-carrier-frequency-earfcn/


int earfcn = 1; //E-UTRAN Absolute radio frequency channel number; the range is 0-6449, 65535 if not known or not detectable
  
int callbackUCGED(int type, const char* buf, int len, char* response) {
    // buf format:+RSRP: 162,5110,"-075.00",
    sscanf(buf, "\r\n+RSRP: %*d,%d*,\"%*s\",\r\n", &earfcn);
    if (earfcn >= 600 && earfcn <=1199) earfcn = 2; //1900Mhz
    else if (earfcn >= 1950 && earfcn <=2399) earfcn = 4; //1700Mhz
    else if (earfcn >= 5010 && earfcn <=5179) earfcn = 12; //700Mhz
    else if (earfcn == 65535) earfcn = 0; //not known or not detectable
    return WAIT;
}

void loop() {

char response[1] = "";

if (Cellular.ready()) {
    if (RESP_OK == Cellular.command(callbackUCGED, response, 200, "AT+UCGED?\r\n")) {
    Serial.print("Band: "); Serial.println(earfcn);
} else Serial.println("error");
}
2 Likes