Raspberry Pi Zero W - серийный UART не работает - PullRequest
0 голосов
/ 14 октября 2019

Как правильно настроить последовательный порт в RPi Zero W? У меня есть шапка SIM7000, и мне нужно общаться через UART.

Итак, я захожу на официальную страницу RPI и ... читаю документацию ... Что я сделал:

  1. raspi-config -> отключить последовательную консоль, включить последовательную аппаратную часть

  2. редактировать cmdline.txt -> удалить "console = serial0,115200" (sudo nano /boot/cmdline.txt)

  3. edit config.txt -> проверка, если это enable-uart = 1 (sudo nano /boot/config.txt)

  4. Мне не нужен Bluetooth, поэтому я хочу его отключить. Затем добавьте в config.txt "dtoverlay=pi3-disable-bt"

  5. Отключение системных служб: sudo systemctl disable hciuart

  6. Перезагрузка

Согласно документации все должно работать Ничего не работает. Я пытаюсь подключиться через Minicom или Picocom и не могу ничего отправлять или получать ... sudo minicom -D /dev/serial0 или minicom -D /dev/ttyAMA0 и замораживание терминала picocom --baud 9600 /dev/ttyAMA0 или serial0 и замораживание

Попробуйте с кодом Python, откройте serialпопробуйте отправить и получить что-нибудь, и ничего ...

ls -l /dev показывает мне

serial0 -> ttyAMA0, serial1 -> ttyS0

dmesg | grep tty показывает мне

[0.001271] консоль [tty1] включена [1.051160] 20201000.serial: ttyAMA0 в MMIO 0x20201000 (irq = 81, base_baud = 0) является PL011 rev2

Я посетил все страницы в Google. Я пробовал с pi3-miniuart-bt и sudo systemctl stop serial-getty@ttyS0.service и disable serial-getty...

Кто-нибудь знает, как заставить работать последовательный порт?

Это полностью /boot/config.txt

# 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=off
#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
enable_uart=1
dtoverlay=pi3-disable-bt

[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

Попытка Picocom:

pi@raspberrypi:~ $ picocom /dev/ttyAMA0
picocom v3.1

port is        : /dev/ttyAMA0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        :
omap is        :
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready

И я не могу написать

Попытка Minicom:

Welcome to minicom 2.7.1

OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/serial0, 20:12:31

Press CTRL-A Z for help on special keys

И я не могу писать ....

И я действительно думал с этой страницы: НАСТРОЙКА GPIO SERIAL RPI

...