当前位置:   article > 正文

树莓派c语言usb转串口通信,Mac OS X上使用USB转串口线连接树莓派

树莓派用usb通信c语言

3e4d78c1a5b6da7160dfed5c813bb9c5.png

因为没有HDMI的显示器,总之就是没有显示器来显示,想起RPi上有TXD和RXD加上手头上刚好有一个usb to ttl。

Mac OS Usb TTL驱动

驱动下载地址: PL2303 Mac OS X Driver Download

如果不是对最新版本有强迫症的话,安装文件: md_PL2303_MacOSX-10.6up_v1.5.1.zip。

安装完后重启系统,查询串口设备:

cd /dev

ls tty.usbserial*

mac os 安装 screen

这里用到的串口工作是screen

brew install screen

或者

sudo port install screen

然后连接Raspberry Pi

可参考这篇文章 RPi Serial Connection

Raspberry PI串口通信

接着把我们TTL板子上的

GND->Groud

RXD->GPIO 14(TXD)

TXD->GPIO 15(RXD)

!注意:TXD连接的是RXD,不要接成一样的。

034d31b3be377d6c5b5726cb14992835.png

Mac OS ttl 设置 raspberry pi

进行串口通讯

screen /dev/tty.usbserial 115200

接着我们就可以看到系统启动了,要我们输入用户名和密码

Raspbian GNU/Linux 7 raspberrypi ttyAMA0

raspberrypi login: pi

Password:

Last login: Sat Apr 26 05:58:07 UTC 2014 on ttyAMA0

Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

ls

NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'

然后

sudo raspi-config

选择第一个,下面就可以继续了

Expand Filesystem Ensures that all of the SD cards

重启完,目测好像新版的raspberry pi带有openssh-server。

顺便提供一个卸载驱动的方法

rm -rf /System/Library/Extensions/XXXX.kext

rm -rf /System/Library/Extensions.kextcache

rm -rf /System/Library/Extensions.mkext

kextcache -k /System/Library/Extensions

这些指令需要管理员权限,建议使用root用户或者sudo -s。其中XXXX.kext就是驱动的名字,比如这里的两种USB-Serial驱动分别是Prolific和FDTI打头的。

via

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/893182
推荐阅读
相关标签
  

闽ICP备14008679号