Operation Manual

Human-computer interfacing
114
Notes:
Other common ports include TCP port 25, which is used for the SMTP email
protocol; ports 20 and 21, which are used for the file transfer protocol (FTP); and
port 161, for the SNMP network management protocol. There are thousands of
different ports available to use and hence thousands of different ways to
communicate on the internet!
In this chapter, we are going to use your Raspberry Pi to interface with a range of
internet applications, including Twitter and email. We’ll communicate with each
program via the appropriate port, providing input that causes that program to run
a specific function. And were going to do it all using the Python programming
language. You won’t touch a browser once.
All the examples in this section are designed to be as simple as possible. Each
exercise demonstrates just one type of communication. Think of these examples
as ingredients in a recipe that, when mixed together, produce something much
better than the individual parts. The extent of what you make is only limited by
your imagination! You have your Raspberry Pi – now get cooking!
What tools will I need?
To complete the exercises in this chapter you will need the “IDLE” program that
you used in the last chapter. Some of the exercises also require you to install extra
Python modules. I’ll tell you when this is the case. Wherever possible, I have made
these extras available on the SD card that came with your Raspberry Pi, so look
out for the SD card logo!
These resources are also available on Google Drive, here: http://goo.gl/vK3VP