console - 安卓事物 : Connect to Serial Debug Console

标签 console uart android-things

我一直在尝试连接到 serial console of a Raspberry Pi 3 with Android Things使用USB to TTL cable从我的 Linux (Ubuntu) 机器。尽管我按照文档连接了电缆,但执行 minicom 命令时得到的结果如下

enter image description here

没有机会输入任何字符。所以我既看不到任何内核消息,也看不到设备的 shell。

我错过了什么?

最佳答案

Linux (Ubuntu)

<小时/>

里面有什么?

  • GNU 屏幕
  • Minicom
    • minicom 单行命令(简答)
    • minicom UI(长答案,详细)
<小时/>

GNU 屏幕

在终端中运行

sudo screen port_name 115200

请参阅下文(步骤 2)找出port_name,例如 /dev/ttyUSB0。按 Ctrl-AKY 退出屏幕。如果未安装,请执行sudo apt-get install screen

<小时/>

迷你通讯

  • 简短回答

在终端中运行

sudo minicom -b 115200 -o -D port_name

请参阅下文(步骤 2)找出port_name,例如 /dev/ttyUSB0。按 Ctrl-A,然后按 X 退出 minicom

  • 长答案(UI)

minicom 应正确配置才能打开连接。一般步骤如下:

  1. 安装 minicom

    sudo apt-get install minicom
    
  2. Connect Rpi3 with your host machine using USB-to-TTL cable并打开终端。 查找tty连接

    dmesg | grep -e tty
    

就我而言,我得到

enter image description here

其中 ttyUSB0 是主板。

  • 运行 minicom 并选择串行端口设置

    sudo minicom -s
    
  • 你应该看到

    enter image description here

  • 检查(或设置)tty连接的设置。确保 /dev/ttyX 对应于您的连接,即您在步骤 2 中获得的连接,而不是 XBps/Par/Bits > 按照 documentation 设置.
  • 类似于

    enter image description here

  • 现在点击退出,如果一切都已正确设置,连接应该正在运行。如果您输入 ls 命令,您应该会看到 Android Thing 的根目录
  • enter image description here

  • 退出 minicom,请按 Ctrl-A,然后按 Q,然后:
  • enter image description here

    关于console - 安卓事物 : Connect to Serial Debug Console,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43554006/

    相关文章:

    c - 在Linux AUART内核驱动中,如何使用I2C GPIO扩展器的管脚代替RTS来控制RS485方向?

    android-things - Android Things RPI3 相机挂起图像阅读器

    user-interface - 如何从控制台或 GUI 应用程序检测是否运行?

    java - 在终端 (ubuntu) 中输出 log4j 日期的问题

    javascript - 需要帮助使用 jquery 从浏览器控制台选择标签

    windows - 使用 git bash 的自定义控制台

    java - PeripherialManager.getInstance() 抛出 java.lang.RuntimeException : Stub

    c - 操作系统会向设备请求中断吗?

    Android Things 用户传感器 : how should I set the accuracy of a sensor?

    gpio - android.os.ServiceSpecificException : GPIO2_IO02 is already in use (code 16)