本文介绍了我应使用哪个服务器地址(mosquitto代理URL)将节点红色连接到mosquitto?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的情况

  1. 我有两台计算机.一个是我的计算机,另一个是Amazon Web Services.我的计算机上安装了Node-red,Amazon Web Services上安装了mosquitto(照片1).
  2. 我在Amazon Web Services上运行mosquitto,然后键入mosquitto_sub -t "test"来接收数据.(照片2)
  3. 我需要在节点红色中输入服务器"(mosquitto代理URL)和主题",以将数据从节点红色发送到mosquitto.目前,我已经输入172.26.12.244:1880和'test'. 但是红色节点和蚊子未连接. (照片3)
  1. I have two computers. One is my computer, the other is Amazon Web Services. Node-red is installed on my computer, and mosquitto is installed on Amazon Web Services (Photo 1).
  2. I run mosquitto on Amazon Web Services, and type mosquitto_sub -t "test" for receive data.(photo 2)
  3. I need to enter 'server' (mosquitto broker url) and 'topic' in node-red to send data from node-red to mosquitto. Currently I have entered 172.26.12.244:1880 and 'test'. But node-red and mosquitto are not connected. (Photo 3)

问题

  1. Photo4是Amazon Web Services的控制台屏幕.当我键入ifconfig时,我得到几个IP地址.我应该在服务器"中输入什么IP? (照片4)
  2. 我到目前为止已经完成了所有步骤吗?
  3. 像现在一样上传我的IP有危险吗?我是一个学习服务器的初学者.
  1. Photo4 is the console screen for Amazon Web Services. When I type ifconfig, I get several ip addresses. What ip should I enter in 'server'? (photo 4)
  2. Are all the steps I've done so far right?
  3. Is it dangerous to upload my IP as I do now? I am a beginner studying about studying server.

ps)

随着时间的流逝,连接是通过节点红色建立的,因此,当我从节点红色发送数据时,会看到成功注入"消息.但是在蚊子中看不到任何消息.我的猜测是,当我从红色节点发送数据时,该数据应输出到蚊帐屏幕.是不是(照片5)

Over time, a connection is made from node-red, so when I send data from node-red, I see a "Successfully injected" message. But in mosquitto no messages can be seen. My guess is that when I send data from node-red, that data should be output to the mosquitto screen. Isn't it? (photo5)

(照片1)

(照片2)

(照片3)

(照片4)

(照片5)

推荐答案

这里有几个问题,因此,如果有任何遗漏的评论要提出,请尝试一一回答.

There are several questions here so will try answering one by one if any question is missed out comment to ask.

  1. 您用于mosquitto服务器的IP是错误的,您需要找到可在aws EC2 Web控制台中找到的外部IP
  2. ifconfig没有为您提供外部IP
  3. 仅当您公开授予该IP地址后,才可以公开您的IP地址.
  4. 正如@Rafael Muynarsk指出的那样,一旦有了外部IP,请确保安全组允许从计算机到mosquitto端口上的mosquitto的连接正在运行.

这篇关于我应使用哪个服务器地址(mosquitto代理URL)将节点红色连接到mosquitto?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 17:29