Загрузка страницы

Raspberry PI 3 B+ How to Enable & Test UART Tx/Rx

This video explains how to enable UART on RPI 3 B+ for a serial communication.
On a Raspberry Pi 3, you should use /dev/ttyS0 for UART communication.
/dev/ttyS0: This is typically the UART serial port available for general use.

Disable LOGIN SHELL to be accessible over serial
Serial port hardware only to be enabled
serial login shell disabled
Serial interface is enabled
REBOOT required for changes to take effect
On the Raspberry Pi, the serial port /dev/serial0 is a symlink that points to the actual UART device, which can be either /dev/ttyAMA0 (the primary UART) or /dev/ttyS0 (the secondary UART).

ls -l /dev/serial0

This will show you whether /dev/serial0 points to ttyAMA0 or ttyS0.
in code you can use the symlink serial0 instead of ttyS0

Before executing a python script
prefer using a virtual environment, first create and activate it:

python3 -m venv myenv
source myenv/bin/activate

Then install pyserial within the virtual environment:

pip install pyserial

Видео Raspberry PI 3 B+ How to Enable & Test UART Tx/Rx канала Saravanan AL
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
6 сентября 2024 г. 7:43:39
00:08:22
Яндекс.Метрика