gpt4 book ai didi

Azure IoT 访问失败 [401 未经授权]

转载 作者:行者123 更新时间:2023-12-03 01:40:31 25 4
gpt4 key购买 nike

由于未经授权的访问,我面临着从 IoT Edge 设备到其 IoT 中心的连接问题(显然)。同样的设置在个人(常规路由器-ISP)网络连接下工作正常,但一旦在更大、更安全的网络中设置就失败了。

我已确保为设备的静态 IP 打开所有必需的端口,并且连接字符串没有拼写错误,但问题仍然存在。经过研究,我发现一些有类似问题的用户在 SAS 身份验证方面遇到了麻烦,尽管我从未更改过它,也没有在之前运行的任何测试中接触过它,所以我对此很确定。我收到的错误日志如下:

-- Logs begin at Thu 2016-11-03 14:16:42 -03, end at Sun 2019-01-13 03:36:22 -03. --
Jan 13 03:05:21 camaraIQF0 systemd[1]: Started Azure IoT Edge daemon.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Starting Azure IoT Edge Security Daemon
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Version - 1.0.5 (d76e0316c6f324345d77c48a83ce836d09392699)
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Using config file: /etc/iotedge/config.yaml
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Using runtime network id azure-iot-edge
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Initializing the module runtime...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Initializing module runtime...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Successfully initialized module runtime
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Finished initializing the module runtime.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Configuring /var/lib/iotedge as the home directory.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Configuring certificates...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Transparent gateway certificates not found, operating in quick start mode...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Finished configuring certificates.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Initializing hsm...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Finished initializing hsm.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Detecting if configuration file has changed...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - No change to configuration file detected.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Obtaining workload CA succeeded.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Provisioning edge device...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Manually provisioning device "camaraIQF_0" in hub "camarasIQF.azure-devices.net"
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Finished provisioning edge device.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Starting management API...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Starting workload API...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Starting watchdog with 60 second frequency...
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Listening on fd://iotedge.mgmt.socket/ with 1 thread for management API.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Listening on fd://iotedge.socket/ with 1 thread for workload API.
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Checking edge runtime status
Jan 13 03:05:21 camaraIQF0 iotedged[724]: 2019-01-13T06:05:21Z [INFO] - Creating and starting edge runtime module edgeAgent
Jan 13 03:05:22 camaraIQF0 iotedged[724]: 2019-01-13T06:05:22Z [WARN] - Error in watchdog when checking for edge runtime status:
Jan 13 03:05:22 camaraIQF0 iotedged[724]: 2019-01-13T06:05:22Z [WARN] - A module runtime error occurred.
Jan 13 03:05:22 camaraIQF0 iotedged[724]: 2019-01-13T06:05:22Z [WARN] - caused by: Could not get identity $edgeAgent
Jan 13 03:05:22 camaraIQF0 iotedged[724]: 2019-01-13T06:05:22Z [WARN] - caused by: Could not get module $edgeAgent
Jan 13 03:05:22 camaraIQF0 iotedged[724]: 2019-01-13T06:05:22Z [WARN] - caused by: HTTP request failed: [401 Unauthorized] {"Message":"ErrorCode:IotHubUnauthorizedAccess;Un authorized","ExceptionMessage":"Tracking ID:876068fddc8545f799e54da7f991d694-G:10-TimeStamp:01/14/2019 15:19:50"}

在最后一条警告消息之后,它会不断循环检查边缘运行时状态并无法连接,因此它永远不会下载模块,因此无法正常运行。该设备是运行 raspbian 的树莓派。

关于这个问题有什么想法吗?

谢谢!

最佳答案

发现问题,在此发布以防有人遇到同样的问题。

设备无法自动获取日期和时间,因此该设备与 Azure 的日期和时间不匹配,从而导致身份验证错误。

将树莓派的日期和时间设置为我所在地区的当前日期和时间解决了问题。

关于Azure IoT 访问失败 [401 未经授权],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54185168/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com