raspberry-pi - Raspberry Pi 串口未找到,.NET
问题描述
我有一个用 .Net 5.0 编写的 Raspberry Pi 上的 Web 应用程序。此外,我通过蓝牙模块 (HC-05) 与带有 Raspberry Pi 的 Arduino 进行通信。当我尝试在 Web 应用程序中显示来自 Arduino 的数据时,我收到以下错误:
**The following serial ports were found:
/dev/ttyAMA0
/dev/ttyS0
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.UnauthorizedAccessException: Access to the port '/dev/rfcomm0' is denied.**
当与 Arduino 建立蓝牙连接时,通过 /dev/rfcomm0 端口提供通信。但是,端口/dev/rfcomm 没有出现在 .Net 的 Raspberry Pi 上,因此出现错误。有没有人可以帮忙?
解决方案
推荐阅读
- c# - 异步返回任务方法
- npm - 安装包时是否从 VCS 克隆 npm 或 yarn 并运行构建脚本?
- javascript - 如何使用简单的 JavaScript 代码计算百分比
- sql-server - 在soapui中使用groovy脚本比较两个表
- c# - Xamarin.Forms ViewModel 中的异步方法不等待 AzureServiceTokenProvider 和 SqlConnection 初始化
- reactjs - ReactJs - 如何映射()地图
- c - 为什么 stm32nucleo 板 uart 使用 HAL_UART_Receive_IT 几乎三四百次后无法接收消息
- firebase - firebase 云函数的函数文件夹是否应该在(公共)文件夹中?
- javascript - 将具有相同日期的数组对象合并为一个 - JavaScript
- gradle - 在 Gradle 中执行 gradlew clean 任务时排除某些文件或文件夹?