Reputation: 31
I have many devices connected to Azure IoT hub. These device are physically located in different part of the world, e.g.
Device A is in USA ; Device B is in France ; Device C is in Japan
All the above devices sending some data to IoT hub. I have a requirement to show the devices along with their Geo location(City and Country).
Does the Azure cloud know where(Geolocation) a device is? and we could use this info to display the device physical location on the web page?
Any help greatly appreciated. Thanks
Upvotes: 0
Views: 366
Reputation: 4085
Azure IoT Hub can't tell where your device is if you don't give it that data. So if you don't have GPS, you won't accurately know the location of your device. But here are a few things you can try, it all depends on your use case!
If this is the case, you could consider adding the location to the Device Twin of the device. If the device never changes its location, and you know the location of the device, this is a valid option. If, as you say, you have a lot of devices, don't do this manually but make it part of your provisioning process.
There are a lot of online services providing what's called geolocation (won't link to any because I haven't tried them in a production setting). They approximate your location by using the public IP address of your network. This won't work on most mobile connections, although even on a mobile connection, you might at least get the country right. In short, your device could use one of those services to find their location and send it to IoT Hub.
Upvotes: 1