问题标签 [azure-sphere]

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 投票
3 回答
208 浏览

ssl - Azure Sphere 无法连接到 Edge 设备——TLS 握手失败

我正在尝试以嵌套方式将 Azure Sphere 设备配置和设置为 IoT Edge 设备的子设备。以下是程序

  1. 按照此链接https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge?view=iotedge-2020-11形成 Azure IoT Edge 设备的层次结构(顶层+ 低层 1 + 低层 2),共 3 层

  2. 按照https://docs.microsoft.com/en-us/azure-sphere/app-development/setup-iot-edge?tabs=cliv1将SPhere配置为顶层的子设备。

  3. 我正在使用 Azure 示例、Azure IoT 示例连接到边缘设备。对 CMakeLists.txt 和 app_manifest.json 文件进行了必要的更改(主机名作为边缘设备的 IP 地址,证书作为在上面第 1 步生成的根证书 (iotedge_config_cli_root.pem))

  4. 通过 Azure 门户将 Azure Sphere 设备设置为边缘设备(顶层)的子设备。

  5. Azure Sphere 设备是按照链接https://docs.microsoft.com/en-us/azure-sphere/app-development/setup-iot-hub?tabs=cliv2beta中的说明手动预配的

  6. Azure Edge 设备,按照步骤 6。将 Azure Sphere 设备的租户 CA 证书提供给 IoT Edge 设备,将 PEM 格式的租户 CA 证书附加到 iotedge_config_cli_root.pem。

  7. 重新启动边缘设备并尝试将设备尝试连接到边缘设备。但它没有成功。以下是 edgeHub 模块的错误

    <4> 2021-08-18 13:09:00.901 +00:00 [WRN] - TLS handshake failed., System.AggregateException: One or more errors occurred. (Authentication failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate --- End of inner exception stack trace --- at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, ArraySegment1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions) --- End of inner exception stack trace --- at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) at System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslStream.ThrowIfExceptional() at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult) at System.Net.Security.SslStream.<>c.<AuthenticateAsServerAsync>b__68_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task``1 promise, Boolean requiresSynchronization) --- End of inner exception stack trace ---, 734368d8 <4> 2021-08-18 13:10:01.660 +00:00 [WRN] - TLS handshake failed., System.IO.IOException: Channel is closed, 5cc9b5ea

  8. 在下面的球体一侧是错误的

    IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. INFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. INFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. /run/daa/41d781ff-519a-406d-b1dd-c4078f372dff [Azure IoT] Using HSM cert at /run/daa/41d781ff-519a-406d-b1dd-c4078f372dff [Azure IoT] Using HSM cert at /run/daa/41d781ff-519a-406d-b1dd-c4078f372dff [Azure IoT] Using HSM cert at /run/daa/41d781ff-519a-406d-b1dd-c4078f372dffINFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. INFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. INFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started. INFO: Azure IoT Hub connection complete. Azure IoT connection status: IOTHUB_CLIENT_CONNECTION_NO_NETWORK INFO: Azure IoT Hub connection started.**'

  9. 根据https://github.com/Azure/azure-sphere-samples/blob/master/Samples/AzureIoT/Troubleshooting.md错误指向这些错误可能会在以下情况下发生:

  10. IoT Edge 设备上尚未打开入站端口 8883。有关详细信息,请参阅打开 IoT Edge 网关设备端口进行通信中的步骤 3。

  11. 该示例使用了不正确或无效的 IoT Edge 设备根 CA 证书。

  12. edgeAgent 和 edgeHub 模块未在 IoT Edge 设备上运行。

但是可以排除原因1和3。入站端口 8883 在边缘设备上打开,并且所有边缘模块都在运行。

需要您的帮助来解决此问题。请注意,球体设备能够直接连接到 IoT 中心。

谢谢,吉文

0 投票
2 回答
136 浏览

azure - 正在使用设备消息,但未转发到 Azure IOT Hub 中的内置端点

我是使用 Azure IoT Hub 的新手,正在尝试将消息从 Azure Sphere 设备发送到 IotHub。

如果我查看 IotHub 中的指标部分,我可以看到指标“使用的消息总数”,记录确实到达了。

但是,如果我查看“传递到消息/事件的路由消息”,我可以看到没有传递。

在此处输入图像描述

我没有在iothub中添加任何自定义路由,所以它应该使用内置端点来插入消息,对吗?

此外,如果我转到“查询资源管理器”,我可以看到数据,但在使用az iot hub monitor-events --hub-name HubName --output table` 命令时我看不到任何事件。

这可能是什么原因造成的?我是否需要将消息显式重定向到内置端点?

谢谢你。

0 投票
0 回答
14 浏览

azure - 在 Azure Sphere 设备上使用 DHCP 服务器时如何找到 DHCP 客户端?

我在我的 Sphere 设备上设置了一个 DHCP 服务器。我想知道,您如何获得租用客户的地址?我可以从 DHCP 起始地址迭代并尝试连接,但我想知道是否有内置函数来获取这些。