Enable/Disable serial port to Console

During boot, output to the console is sent to the serial port.  That may be behavior you want, but if this interferes with your serial-attached device, here is how to disable it

sudo raspi-config 
Advanced Options 
> A8 Serial 
> Advanced options

--Choose Yes if you want serial output during boot
--Choose No if you do not want serial output during boot

As an alternative, if you can edit two files:  /boot/cmdline.txt and /boot/config.txt

First, edit /boot/config.txt

sudo /boot/config.txt
If you want serial output during boot, then you need a line that reads:  enable_uart = 1

if you do not want serial ouput, add a line that reads:
enable_uart = 0


Second, edit /boot/cmdline.txt

sudo /boot/cmdline.txt
To output serial during boot:
Look for a line that refers to the com port, which has something like the following in it:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2, and add the following (without changing anything else): console=serial0,115200 

To disable serial output during boot, remove: console=serial0,115200 


Save changes and reboot.