You can find the approximate location of a device by retrieving its network Cell ID and Location Area Code (LAC) or Tracking Area Code (TAC). This information can be obtained byviewing session history in the Soracom User Console, issuing AT commands directly to your cellular module, or using the Soracom API.
Please note that AT commands can vary between cellular modules. Always refer to your module manufacturer's documentation for specific commands and syntax.
Using the Soracom User Console
You can find cell information for previous network sessions directly from the Soracom User Console.
- Log into the User Console.
- Select the target IoT SIM from your SIM list.
- Click the Details button.
- Select the Session Details tab.
The session events listed on this tab will include the MCC, MNC, Location Area Code, and Cell ID for each session.
Using AT Commands
You can query your cellular module directly to get its current network registration information. For more details on checking network status, please refer to the Troubleshooting Guide.
2G/3G Connections
Use the AT+CGREG? command to get the Location Area Code and Cell ID.
AT+CGREG?
+CGREG: 0, 1, "0021", "0404404F", 4
In this response, 0021 is the Location Area Code (LAC) and 0404404F is the Cell ID (in hexadecimal).
LTE Connections
Use the AT+CEREG? command to get the Tracking Area Code and Cell ID.
AT+CEREG?
+CEREG: 2,1,"00C3","00002654",7
In this response, 00C3 is the Tracking Area Code (TAC) and 00002654 is the Cell ID.
Finding Location with Third-Party Tools
Once you have the Cell ID and LAC/TAC, you can combine them with the SIM's Mobile Country Code (MCC) and Mobile Network Code (MNC) to look up the approximate location in a third-party database, such as OpenCellID.
- Note: If a database does not return a result, the cell tower may not be registered in that particular service.
Using the Soracom API
Soracom provides a dedicated API endpoint that allows you to resolve a device's location using its cell information. You can use the GET /cell_locations endpoint to submit one or more sets of cell tower data and receive corresponding location estimates.
For full implementation details, please refer to the Soracom API Reference: cell_locations.