Nice! Sounds like you saved a device! I eventually want to create a “where in the US are my devices” dashboard but didn’t get around to it yet. I currently use the cell_global_identity located in the Device Vitals on my backend to determine the approximate lat/long of the cell tower it connected to. Similar to you… it’ll get me close enough for my needs. I.e. I Use this information:
"cellular":{
"radio_access_technology":"LTE"
"operator":"AT&T Wireless Inc."
"cell_global_identity":{
"mobile_country_code":310
"mobile_network_code":"410"
"location_area_code":17154
"cell_id":78364944
}
With this Python Code used on my back end that process device Vitals events:
def getLongLatitude(msg):
jsonCellTower = {
"cellTowers": [
{
"cellId": msg['data']['device']['network']['cellular']['cell_global_identity']['cell_id'],
"locationAreaCode": msg['data']['device']['network']['cellular']['cell_global_identity']['location_area_code'],
"mobileCountryCode": msg['data']['device']['network']['cellular']['cell_global_identity']['mobile_country_code'],
"mobileNetworkCode": msg['data']['device']['network']['cellular']['cell_global_identity']['mobile_network_code']
}
]
}
#Request GeoLocation (long, latitude) given cell tower data from the device.
response = requests.post('https://www.googleapis.com/geolocation/v1/geolocate?key='+Config.GOOGLEMAPS_TOKEN, json=jsonCellTower)
jsonLatLon = response.json()
return jsonLatLon
Now the fun part… how can I take the Latitude, Longitude, zip code or some other type of data and plot it on an interactive map for all the devices in the product. It’s been low on the development list but eventually would be nice to show on an interactive map all the devices and where they are located. If I could make this customer facing that would be interesting and possibly even the data from the devices “public” if a user consents to it. It’s on the back burner but it’s been an idea I’ve been toying with. Would non-customers come to the site to see the data from customers, get confidence in the connectivity of a device if they see other remote areas with the device and then want to purchase a device for themselves… not sure. It’s a vague concept right now.