I’m currently using the CellularHelper by @rickkas7 and getting the devices location and cell towers but is there any way to get the RSSI of each cell tower not just the single tower.
I like the getLocation() process ( it seems to work very well ) - but where does it get the actual coordinates from? Is it calling an external service to get the cell towers longitude / latitude then calculating the triangulation based upon these?
CellularHelper.getEnvironment(CellularHelper.ENVIRONMENT_SERVING_CELL_AND_NEIGHBORS, cellLocate_envResp);
if (cellLocate_envResp.resp != RESP_OK) {
// We couldn't get neighboring cells, so try just the receiving cell
CellularHelper.getEnvironment(CellularHelper.ENVIRONMENT_SERVING_CELL, cellLocate_envResp);
}
//cellLocate_envResp.logResponse();
CellularHelperEnvironmentCellData *CD = &cellLocate_envResp.service;
cellLocte_towers = "{" + String(CD-> mcc) + "," + String(CD-> mnc) + "," + String(CD-> lac) + "," + String(CD-> ci) + "," + String(rssiQual.rssi) +"}"; // string of the tower found MCC, MNC, LAC, CELLID, Qlty
for(size_t ii = 0; ii < cellLocate_envResp.getNumNeighbors(); ii++) {
CellularHelperEnvironmentCellData *CDn = &cellLocate_envResp.neighbors[ii];
// Serial.println(String(CDn));
// really want CDN -> rssi -- but that does not work
cellLocte_towers = cellLocte_towers + ",{" + String(CDn-> mcc) + "," + String(CDn-> mnc) + "," + String(CDn-> lac) + "," + String(CDn-> ci) + "," +"}"; // string of the tower found MCC, MNC, LAC, CELLID, Qlty
}
If i can get the RSSI then i can also triangulate the cell towers in my own server side process.
Just trying to understand if its using any hidden 3rd party services or not… I do not want to use the google service due to licensing restrictions.
I think you should be able to use CDn->getRSSI(). You can’t access it as a variable because the cell tower doesn’t directly return it. The getRSSI() method calculates it from the rscpLev for 3G and rxlev for 2G.
As for the other question, there are two ways to get location information. Using the CellularHelperLocationResponse getLocation() method in CellularHelper uses the cellular modem which does it in the hardware, not requiring a 3rd-party service, however it’s rather slow.
The other option is to take the IDs for the nearby tower(s) and pass them to an external service to get coordinates. The catch to that is that 3G Electrons only return the connected tower, not all towers, so the location isn’t that accurate. But it’s fast. One such service is the Google Geolocation service. There’s an official integration for that.