By default the Raspberry Pi’s serial port is configured to be used for
console input/output, it means you can't use the Serial Port in your
programs and needs to be
disabled.To enable the serial port for your own use you need to disable login on the port. There are two files that need to be edited
The first and main one is
The first and main one is
/etc/inittab
This file has the command to enable the login prompt and this needs to be disabled. Edit the file and move to the end of the file. You will see a line similar to