如何在Azure IoT中心上获取设备的公共IP地址? [英] How can I get the public IP address of a device on Azure IoT Hub?

查看:134
本文介绍了如何在Azure IoT中心上获取设备的公共IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对获取Azure IoT中心上已连接设备的公共IP地址很感兴趣.

I'm interested by getting the public IP address of a connected device on Azure IoT Hub.

我已经检查了SDK的内容,但看不到任何获得它的方法.

I've checked the SDK's but I cannot see any method to get it.

我的目的是通过IP对设备进行定位(虽然不准确,但对我有用!).

My purpose is to geolocate the device by IP (That's not accurate, but works for me!).

有任何线索吗?

推荐答案

似乎没有现成的功能.

一种解决方法是将设备IP地址保存在设备twin中,并在IP更改时对其进行更新.

A workaround is to save device IP address in device twin and update it when the IP changed.

设备应用可以设置和更新的设备孪生,解决方案后端可以读取并查询它们.

There is Reported properties in device twin that device app can set and update and the solution backend read and query them.

如何通过设备应用程序更新报告的属性,您可以参考本教程:

How to update reported property from device app you can reference this tutorial:

开始使用双胞胎设备

更新:

另一种选择是建议将设备位置存储在云中的设备Twin中.参考:了解并使用设备twin .

Another option, it is suggesting to store device location in device twin in cloud. Ref: Understand and use device twin.

这篇关于如何在Azure IoT中心上获取设备的公共IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆