Disable Linux serial console
By default, the primary UART is assigned to the Linux console. If you wish to use the primary UART for other purposes, you must reconfigure Raspberry Pi OS. This can be done by using raspi-config:
- Start raspi-config:
sudo raspi-config
. - Select option 3 – Interface Options.
- Select option P6 – Serial Port.
- At the prompt
Would you like a login shell to be accessible over serial?
answer ‘No’ - At the prompt
Would you like the serial port hardware to be enabled?
answer ‘Yes’ - Exit raspi-config and reboot the Pi for changes to take effect.