透明网关GatewayHostName [英] Transparent Gateway GatewayHostName

查看:58
本文介绍了透明网关GatewayHostName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试将Iot Edge设备配置为透明网关但未成功,请遵循以下教程:  HTTPS ://docs.microsoft.com/pt-pt/azure/iot-edge/how-to-create-transparent-gateway ;



  • 是否应该使用IP连接?如果是这样,我是否必须将我的IP地址设为静态?我的下游设备需要知道边缘设备IP吗?
  • 将下游设备连接到的所需参数是什么边缘设备通过MQTT ??


我使用此代码通过MQTT与Iot Hub进行通信:

  public void run (){

        尝试{

     ;        的Thread.sleep(10000);

       &NBSP ;     MyMQTTClient Mqtt_c = new MyMQTTClient(DeviceName," MuvuIoT.azure-devices.net");

              Mqtt_c.setOption(" port"," 8883");

      & nbsp;       Mqtt_c.setOption(" log"," 1");

             Mqtt_c.setOption(" keepalive"," 300");

              Mqtt_c.setOption(" PROTOCOLVERSION&qu​​ot;," 3.1.1");       

              Mqtt_c.setOption(" cafile"," / usr /" +" BaltimoreCyber​​TrustRoot.pem");

             Mqtt_c.setOption(" CertFile"," /usr/flexy.crt");

             Mqtt_c.setOption(" KeyFile"," /usr/flexy.key" ;);

              Mqtt_c.setOption(" Password"," HostName = HUBNAME; DeviceID =" + DeviceName +" ;; x509 = true");

              Mqtt_c.connect();


如何更改它,以便我可以透明地与网关通信?






解决方案

嗨保罗,


看看Steve Bus对此相关的答案MSDN主题:  https://social.msdn.microsoft.com/For UMS / EN-US / 2d54b3c5-eda3-4201-9d55-2b1a96a6dbfe /问题的发送的消息到一个透明的网关?论坛= iotedge


在短:


您在config.yaml文件中用于'主机名'的名称   a)
不能是localhost,b)需要小写,c)不能是IP地址,d)必须与您在GatewayHostName参数中使用的名称完全相同,并且e必须从您的客户端设备中解析。


感谢


Hi,
I'm trying to configure my Iot Edge device into a transparent gateway without success, following this tutorial: https://docs.microsoft.com/pt-pt/azure/iot-edge/how-to-create-transparent-gateway;

  • Is it supposed to use the IP to connect ? If so, do I have to make my IP address static ? My downstream devices need to know the edge device IP ?
  • What parameters I need to connect a downstream device to an edge device through MQTT ??

I was communicating with Iot Hub through MQTT with this code :
 public void run() {
        try {
            Thread.sleep(10000);
            MyMQTTClient Mqtt_c = new MyMQTTClient(DeviceName, "MuvuIoT.azure-devices.net");
            Mqtt_c.setOption("port", "8883");
            Mqtt_c.setOption("log", "1");
            Mqtt_c.setOption("keepalive", "300");
            Mqtt_c.setOption("TLSVERSION", "tlsv1.2");
            Mqtt_c.setOption("PROTOCOLVERSION", "3.1.1");       
            Mqtt_c.setOption("cafile", "/usr/" + "BaltimoreCyberTrustRoot.pem");
            Mqtt_c.setOption("CertFile", "/usr/flexy.crt");
            Mqtt_c.setOption("KeyFile", "/usr/flexy.key");
            Mqtt_c.setOption("Username", "HUBNAME.azure-devices.net/" + DeviceName + "/?api-version=2018-06-30");
            Mqtt_c.setOption("Password", "HostName=HUBNAME;DeviceID=" + DeviceName + ";x509=true");
            Mqtt_c.connect();

How can I change it, so I can communicate with my Gateway transparent ?


解决方案

Hi Paulo,

Take a look at Steve Bus answer on this related MSDN Thread: https://social.msdn.microsoft.com/Forums/en-US/2d54b3c5-eda3-4201-9d55-2b1a96a6dbfe/problem-sending-messages-to-a-transparent-gateway?forum=iotedge

In short:

the name that you used for the 'hostname' in the config.yaml file  a) cannot be localhost, b) needs to be lowercase, c) cannot be an IP address, d) has to be EXACTLY the same name you use in your GatewayHostName parameter, and e) MUST be resolvable from your client device.

Thanks!


这篇关于透明网关GatewayHostName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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