节点红色 - 无法连接:getAddrinfo enotfound xxx-device-hub.azure-devices.net&quot&quot&quot
我是Node-Red的新手,我正在尝试使用Node-Red创建一个简单的将数据发送到我的Azure Iot Hub的流程。但是,每当我发送数据时,获取以下错误“无法连接:getAddrinfo enotfound xxx-device-hub.azure-devices.net”
。我尝试使用不同的所有权限使用不同的共享访问键,但仍然相同。我正在通过代理网络工作。请提供帮助,因为我无法工作,因此
您可以导入我的节点红色流:
[
{
"id": "6f18f82cf1fb4430",
"type": "tab",
"label": "Flow 5",
"disabled": false,
"info": "",
"env": []
},
{
"id": "191eb7ca.b71a8",
"type": "azureiothub",
"z": "6f18f82cf1fb4430",
"name": "Azure IoT Hub",
"protocol": "mqtt",
"x": 640,
"y": 340,
"wires": [
[
"39c7854c.56d18a"
]
]
},
{
"id": "39c7854c.56d18a",
"type": "debug",
"z": "6f18f82cf1fb4430",
"name": "",
"active": true,
"console": "false",
"complete": "payload",
"x": 870,
"y": 340,
"wires": []
},
{
"id": "b73c20238ff65f0f",
"type": "inject",
"z": "6f18f82cf1fb4430",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 340,
"wires": [
[
"d9b5bad69079e9ea"
]
]
},
{
"id": "d9b5bad69079e9ea",
"type": "function",
"z": "6f18f82cf1fb4430",
"name": "",
"func": "msg.payload ={\"deviceID\":\"DC_Tower_Clock\",\"SAK\":\"<Shared-access-key>\",\"Protocol\":\"mqtt\",\"Data\":{\"DC_sensor1values\":[0],\"DC_sensor1timestamp\":[1651774945]}}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 340,
"wires": [
[
"191eb7ca.b71a8"
]
]
}
]
I'm new to node-red and I'm trying to create a simple flow of sending data to my Azure IoT hub using node-red. But whenever I send the data the get the following error "Could not connect: getaddrinfo ENOTFOUND xxx-device-hub.azure-devices.net"
. I tried with different Shared access keys with all permission but still the same. I am working over a proxy network. Please help as I'm not able to work because of this
you can import my node-red flow :
[
{
"id": "6f18f82cf1fb4430",
"type": "tab",
"label": "Flow 5",
"disabled": false,
"info": "",
"env": []
},
{
"id": "191eb7ca.b71a8",
"type": "azureiothub",
"z": "6f18f82cf1fb4430",
"name": "Azure IoT Hub",
"protocol": "mqtt",
"x": 640,
"y": 340,
"wires": [
[
"39c7854c.56d18a"
]
]
},
{
"id": "39c7854c.56d18a",
"type": "debug",
"z": "6f18f82cf1fb4430",
"name": "",
"active": true,
"console": "false",
"complete": "payload",
"x": 870,
"y": 340,
"wires": []
},
{
"id": "b73c20238ff65f0f",
"type": "inject",
"z": "6f18f82cf1fb4430",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 340,
"wires": [
[
"d9b5bad69079e9ea"
]
]
},
{
"id": "d9b5bad69079e9ea",
"type": "function",
"z": "6f18f82cf1fb4430",
"name": "",
"func": "msg.payload ={\"deviceID\":\"DC_Tower_Clock\",\"SAK\":\"<Shared-access-key>\",\"Protocol\":\"mqtt\",\"Data\":{\"DC_sensor1values\":[0],\"DC_sensor1timestamp\":[1651774945]}}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 340,
"wires": [
[
"191eb7ca.b71a8"
]
]
}
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题不是访问键,而是与您的经纪人的主机名一起使用。
错误
enotfound
表示您正在运行的系统上的操作系统无法解析xxx-device-hub.azure-devices.net
到IP地址。确保您输入了合适的主机名,它们没有错别字。
您可以首先尝试通过ping ping ping the node-red ping进行测试。
The problem is not with the access keys, it's with the hostname for your broker.
Error
ENOTFOUND
means that the OS on the system you are running can not resolvexxx-device-hub.azure-devices.net
to an IP address.Make sure you have entered the right hostname and their are no typos.
You can test by trying to ping the address outside Node-RED first.
我的流程有两个问题:
There were couple of issues with my flow: