Instructions

Negate the question Would you like a login shell to be accessible via
serial? .
Agree with the following question.
You have now successfully enabled the serial communication. Now
restart your device once to apply the changes.
Make sure that the serial library is installed on your Raspberry Pi. To do
this, run the following command in your console.
sudo apt-get install python-serial
For the code example, however, you need an end device for the RS485
connection to enable a communication. In this example, we have used
the USB-RS485 adapter (SBC-TTL-RS485) from Joy-it.
Note, that A+ is connected to A and B- is connected to B.
You can create a file with the following command. Paste the following
code there.
nano ttlToRS485.py