问题标签 [azure-iot-edge]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1151 浏览

docker - How can I change the hosts file in windows docker container

In our solution we want to connect our Edge module to the servicebus of a host on a different network.

The dns server is not allowed (per design) to have the dns mapping to that host, hence I need to do the dns mapping in the hosts file of the Windows container that the Edge module is running in.

I have done some tests with the docker run and docker build commands, setting the --add-host parameter, but this doesn't seem to be supported in Windows containers. Looking at the file after the container has been started with that flag at least suggests that it is not.

Moreover I'm not sure I can use this since the Edge runtime is in control of the running of containers (please correct me if I'm wrong here).

In my desperation I tried to modify the hosts file through code, but got stopped due to administrative previledges not beeing met. Anyways this feels like a hack and is not what one should have to do.

Is there an easier way to add a dns host mapping?

0 投票
2 回答
845 浏览

azure - 从叶设备发送消息 未由在透明网关上运行的 IoT Edge 处理的下游设备

我已按照所有说明设置“下游设备”以通过在透明网关中运行的 IoT Edge 发送消息。我相信我的路由规则是正确的,但我的功能模块没有通过消息流接收任何消息。

这些是我遵循的指令: https ://docs.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway-linux

我正在使用 2 个 Linxu 虚拟机(ubuntu 16.04.5)。

  1. IoT Edge 透明网关 VM 配置了正确设置、配置和验证的所有证书。我已经能够使用来自

openssl s_client -connect {my-gateway-machine-name-dns-name}.centralus.cloudapp.azure.com:8883 -CAfile /certs/certs/azure-iot-test-only.root.ca.cert.pem -演出证书

  1. 在安装并验证了证书的 Linux VM 上运行的下游设备。我的连接字符串如下:

    HostName={IoTHubName}.azure-devices.net;DeviceId=TC51_EdgeDownStreamDevice01;SharedAccessKey={My-Shared-Access-Key}=GatewayHostName={my-gateway-machine-name-dns-name}.centralus.cloudapp.azure。 com

一个。我已经验证我使用 openssl 工具成功验证了 SSL 证书。湾。我在我的下游设备中使用以下内容来使用 NodeJS SDK 进行连接

var client = DeviceClient.fromConnectionString(connectionString, Mqtt); C。我可以看到消息显示在云中的 Azure IoT 中心,但我无法让我的模块在 IoT Edge 透明网关上运行以被命中。

  1. 这是我为 edgeHub 配置的路由规则,如示例文档页面中的“来自下游设备的路由消息”中指定的。

这是示例文档显示的内容: { "routes":{ "sensorToAIInsightsInput1":"FROM /messages/* WHERE NOT IS_DEFINED($connectionModuleId) INTO BrokeredEndpoint(\"/modules/ai_insights/inputs/input1\")", " AIInsightsToIoTHub":"FROM /messages/modules/ai_insights/outputs/output1 INTO $upstream" } }

这是我的路由配置设置为: "routes": { "downstreamBatterySensorToBatteryDataFunctionInput1": "FROM /* WHERE NOT IS_DEFINED($connectionModuleId) INTO BrokeredEndpoint(\"/modules/BatteryDataFunctionModule/inputs/input1\")", "BatteryDataFunctionModuleToIoTHub ": "从 /messages/modules/BatteryDataFunctionModule/outputs/* INTO $upstream" }

** 请注意,我使用了“FROM /* WHERE NOT IS_DEFINED”和“FROM /messages/* WHERE NOT IS_DEFINED”

  1. 我在 IoT Edge 上的模块设置为函数。当我使用开箱即用的示例时,其中模拟器设备是在 IoT Edge 上运行的另一个模块,然后我的函数被正确命中。只有当我尝试使用“下游设备”时才会触发模块。

我已启用在透明网关上运行的“IoT Edge 服务的调试日志记录”。

我如何才能弄清楚如何让我的模块在 IoT Edge 中运行以从下游设备被点击/触发?

0 投票
1 回答
910 浏览

ssl - 如何从根证书生成公共证书、私钥?

我有来自 Linux 服务器的根证书 pem 文件。需要连接到该服务器的应用程序告诉我它需要一个 publicCert pem 文件和一个 privateKey pem 文件才能与服务器通信。

我是否从根证书生成这些?我的想法是,我会向 openssl 提供根证书的路径,然后它会转储出我想要的 publicCert/privateKey。

我已经按照此处所述在服务器上创建了证书。现在我需要按照此处所述安装在下游设备上。

我需要使用的客户端连接的输入需要这些参数:

  • 证书格式:pem
  • 认证格式:x509
0 投票
1 回答
1839 浏览

azure - Azure IoT Edge 模块的装载路径

我按照文档https://docs.microsoft.com/en-us/azure/iot-edge/how-to-develop-python-module中的示例进行了操作,并且玩了一下。

我尝试像在 docker 中那样将路径安装到 IoT 模块容器中,但没有成功。我在 deployments.template.json 中的 createOptions 中添加了以下内容:

这会导致 RUNTIME RESPONSE: 400 - 部署配置格式错误或无效。

我的问题:

  • 是否可以像在 docker 中那样安装从主机到 IoTEdge 模块的路径?
  • 如果是,如何?
  • 在哪里可以找到所有 createOptions 参数的参考?
0 投票
1 回答
122 浏览

azure - Azure EdgeHub 是否加密 MessageStore 中的消息?

edgeHub 模块是否对从下游设备接收到的数据进行加密?另外,edgehub 在容器文件系统中的什么位置存储数据?我试过 sudo docker exec -t -i edgeHubContainerID /bin/sh 来寻找它,但运气不佳。(我知道消息存储只是临时缓存数据,以防与 iot 集线器的连接丢失。我们将边缘配置为透明网关。)

0 投票
1 回答
1243 浏览

azure-iot-edge - 模块 xxx/xxx 未在树莓派上连接

所有,我将一些模块从 Ubuntu 移植到 Raspbain 并使用 Python 模块,我收到错误:

2018-10-03 17:52:11.964 +00:00 [WRN] - 模块 pi/sample 未连接 2018-10-03 17:52:39.530 +00:00 [WRN] - TLS 握手失败。,系统。 IO.IOException:通道已关闭,555eae73

我正在使用来自 VS Code 的示例 python 模块。完全相同的“main.py”在 ubuntu 上工作。

在 Ubuntu 上重现:1. 关注:https ://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux 。2.在VS Code中新建一个示例模块python。将其推送到您的 docker 存储库 3. 在 portal.azure.com 中,使用以下路由将两个模块推送到您的 iot edge 主机:

4. 运行 docker logs edgeHub 几分钟后你会看到:

018-10-03 17:51:53.270 +00:00 [INF] - 成功为 clientId ubuntu1/sample 和用户名 ksayeaz3166.azure-devices.net/ubuntu1/sample/?api-version=2017-11-08 生成身份-preview&DeviceClientType=iothubclient%2f1.2.5%20(native%3b%20Linux%3b%20x86_64) 2018-10-03 17:51:53.275 +00:00 [INF] - ClientAuthenticated, ubuntu1/sample, 2ae77b92 2018-10- 03 17:51:53.345 +00:00 [INF] - 设备 ubuntu1/sample 的新设备连接

在 Pi 上重现:1. 关注:https ://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux 。2.在VS Code中新建一个示例模块python。将其推送到您的 docker 存储库 3. 在 portal.azure.com 中,使用以下路由将两个模块推送到您的 iot edge 主机:

4. 运行 docker logs edgeHub 几分钟后你会看到:

2018-10-03 17:52:11.964 +00:00 [WRN] - 模块 pi/sample 未连接 2018-10-03 17:52:39.530 +00:00 [WRN] - TLS 握手失败。,系统。 IO.IOException:通道已关闭,555eae73 2018-10-03 17:53:11.966 +00:00 [WRN] - 模块 pi/sample 未连接 2018-10-03 17:54:03.357 +00:00 [INF] ] - 重新验证连接的客户端 2018-10-03 17:54:12.079 +00:00 [警告] - 模块 pi/sample 未连接

我对 python 模块示例代码没有更改模式。

PI 信息:root@raspberrypi:/home/pi# uname -a Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l GNU/Linux

root@raspberrypi:/home/pi# docker 版本客户端:版本:18.06.0-dev API 版本:1.37 Go 版本:go1.10.2 Git 提交:daf021fe 构建:2018 年 6 月 27 日星期三 00:53:52 OS/Arch:linux /arm 实验性:false 编排器:swarm

服务器:引擎:版本:dev API 版本:1.37(最低版本 1.12) Go 版本:go1.10.2 Git 提交:9aac187 构建:2018 年 6 月 26 日星期二 23:27:27 OS/Arch:linux/arm 实验性:false

Ubuntu信息:

ksaye@ksaye-700T:~/iotedge$ uname -a Linux ksaye-700T 4.13.0-41-generic #46~16.04.1-Ubuntu SMP Thu May 3 10:06:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ksaye@ksaye-700T:~/iotedge$ docker 版本客户端:版本:17.12.0-ce API 版本:1.35 Go 版本:go1.9.2 Git 提交:c97c6d6 内置:2017 年 12 月 27 日星期三 20:11:19 OS/Arch: linux/amd64

服务器:引擎:版本:17.12.0-ce API 版本:1.35(最低版本 1.12) Go 版本:go1.9.2 Git 提交:c97c6d6 构建:2017 年 12 月 27 日星期三 20:09:53 OS/Arch:linux/amd64 实验:假 ksaye@ksaye-700T:~/iotedge$

0 投票
1 回答
584 浏览

azure - Azure IoT 上的软件更新

我目前正在使用 Microsoft azure 在 iot 设备上进行软件更新。我正在关注以下链接

我指的是这个链接。我对此链接毫无疑问。如果您查看整体架构图,它会显示 IOT 开发套件包含带有 OTA 处理程序的 IOT C SDK、OTA 实用程序 API、用于 IOT 网关/设备端的固件更新 API。我找不到这个 IOT 开发套件。

我刚开始使用 Azure,对此我没有太多想法。我在哪里可以获得启用了所有 OTA 功能的 IOT 开发套件。我实际上是在尝试软件更新而不是固件更新。为此应该采取什么方法?

0 投票
1 回答
54 浏览

azure - 我可以将 Azure webjobs 部署为 IoT Edge 模块吗?

我在 azure 中有这个网络作业,它保存遥测数据并针对给定条件进行处理(例如,温度超过给定阈值),我想将此网络作业部署为我的 IoT 中心中的 IoT Edge 模块。可能吗?

如果是,我可以获得一些指向所需信息的链接吗?

0 投票
1 回答
234 浏览

azure-iot-edge - 无法使用 NetworkId 将 Azure IoT Edge 模块启动到指定的 docker 网络

我正在尝试将我的 IoT 边缘设备上的模块启动到我已经设置的一些指定的 docker 网络中。

查看此处的自述文件(github iotedge/edge-agent),似乎表明我可以NetworkId在模块上设置一个环境变量edgeAgent,这将导致它在该 docker 网络中启动新模块。

在我的边缘主机上,我有以下网络:

我在我的 Azure 门户中设置NetworkId环境变量。edgeAgent无论我是否将其设置为my-network585545f54602,新模块总是会启动到azure-iot-edge网络中。

我是否遗漏了一些关于它应该工作的方式,还是有更好的方法来实现我所追求的结果?

0 投票
2 回答
543 浏览

azure - 下游设备可以使用共享访问策略签名的 SAS 令牌进行连接吗?

使用 Azure IoT Edge 作为透明网关时,下游设备是否可以使用共享访问策略密钥使用 SAS 令牌进行身份验证?(设备、iothubowner 等?)。我们已经能够使用由设备主键签名的 SAS 令牌成功连接,但尝试使用共享访问策略密钥似乎不起作用。

注意:设备使用 MQTT