树莓派3b串口登录前准备工作

树莓派三种登录方式

1 串口登录 TX---rx RX--tx
2 ssh (网络接入)
3 远程桌面登录

树莓派默认链接方式

树莓派默认链接的是蓝牙 要修改 config conline文本文件

修改文件

conlinetxt 替换的内容(如下)

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

注意波特率就行了

config 替换下列所有内容

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=pi3-disable-bt
start_x=1
gpu_mem=128

上电步骤

在这里插入图片描述

在这里插入图片描述

树莓派是这么放  和电路图对应就行了

成功界面

在这里插入图片描述

1 插入 com 选 com 3 最后上电 树莓派

在这里插入图片描述

因为之前登录过了 sudo reboot 就可以看到串口的登录页面

在这里插入图片描述
可能出现的问题

如果 出现 wlan0 有了 但是配置了wife 连接不上 那就是config 和confline 有问题 
因为启动文件就是他们两个 ssh出现问题 90%就是出现在这里了
### 树莓派3B UART串口调试方法 对于树莓派3B型号而言,其UART串口的配置与使用存在一定的复杂性。为了实现有效的UART串口调试,需遵循特定的操作流程。 #### 配置准备 确保已安装适当版本的操作系统,并更新至最新状态[^1]。这一步骤至关重要,因为不同版本间的差异可能导致某些配置不再适用。 #### 修改配置文件 编辑`/boot/config.txt`文件以调整UART设置: ```bash sudo nano /boot/config.txt ``` 添加或修改如下参数以便禁用蓝牙占用UART资源并启用物理UART接口: - `enable_uart=1`: 启用UART端口。 - `dtoverlay=pi3-disable-bt`: 禁用蓝牙模块对UART的影响。 保存更改后重启设备使新配置生效[^4]。 #### 开启串口功能 进入图形界面后可通过偏好设置中的Raspberry Pi Configuration工具开启串口支持。具体路径为:Preferences -> Raspberry Pi Configuration -> Interfaces -> Serial Port 设置为 Enabled[^5]。 #### 测试连接 完成上述步骤之后,建议先测试基本的数据传输能力。可利用minicom或其他类似的终端模拟软件来进行简单的读写操作验证是否正常工作。 如果遇到任何异常状况比如输出乱码等问题,则可能是由于波特率不匹配或是其他高级选项未正确设定所引起;此时应仔细核对双方设备之间的协议细节以及查阅官方文档获取更详细的指导信息[^2]。 #### 常见问题及其解决方案 - **无法接收发送数据**:确认接线无误后再检查驱动加载情况,必要时重新编译内核加入相应模块支持。 - **启动时自动登录到TTY1影响正常使用**:可以通过命令行执行`sudo systemctl stop getty@ttyS0.service && sudo systemctl disable getty@ttyS0.service` 来阻止此行为发生[^3]。 - **与其他外设冲突**:当发现有多个外围装置争夺同一个I/O资源时,尝试更换不同的引脚组合或者调整优先级顺序来解决问题。 ```python import serial ser = serial.Serial('/dev/ttyS0', baudrate=9600, timeout=1) print(ser.name) # check which port was really used ser.write(b'hello') # write a string line = ser.readline() # read back the response ser.close() ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值