Raspberry Pi Notes (E-Next - In)
Raspberry Pi Notes (E-Next - In)
• The Raspberry Pi, unlike the Arduino, wasn’t designed for physical computing at all, but rather, for
education.
• Uses Broadcom BCM2835 system-on-chip, powerful graphics processing unit (GPU), capable
of high-definition video and fast graphics rendering.
• the Raspberry Pi is effectively a computer that can run a real, modern operating system,
communicate with a keyboard and mouse, talk to the Internet, and drive a TV/monitor with
high-resolution graphics.
• Operating System
• Although many operating systems can run on the Pi, we recommend using a popular Linux
distribution, such as
• Raspbian:
• Released by the Raspbian Pi Foundation, It is based on Debian.
• This is the default “official” distribution and is certainly a good choice for general work with a Pi.
https://E-next.in
• Occidentalis:
• This is Adafruit’s customised Raspbian.
• Unlike Raspbian, the distribution assumes that you will use it “headless”—not connected to
keyboard and monitor—so you can connect to it remotely by default.
• The main advantages are that
◾ The sshd (SSH protocol daemon) is enabled by default, so you can connect to the console
remotely.
◾ The device registers itself using zero-onfiguration networking (zeroconf) with the name
raspberrypi.local, so you don’t need to know or guess which IP address it picks up from the
network in order to make a connection.
• The following command, from a Linux or Mac command line, lets you log in to the Pi just as
you would log in to a remote server:
• $ ssh [email protected]
• From Windows, you can use an SSH client such as PuTTY
Programming Language
• One choice to be made is which programming language and environment you want to use.
• Python is a good language for educational programming (and indeed the name “Pi” comes
initially from Python).
https://E-next.in
Raspberry Pi Notes
Debugging
While Python’s compiler also catches a number of syntax errors and attempts to use
undeclared variables, it is also a relatively permissive language (compared to C++) which
performs a greater number of calculations at runtime.
This means that additional classes of programming errors won’t cause failure at compilation
but will crash the program when it’s running, Python code on Linux gives you the
advantages of both the language and the OS.
You could step through the code using Python’s integrated debugger, attach to the process
using the Linux strace command, view logs, see how much memory is being used, and so
on.
As long as the device itself hasn’t crashed, you may be able to ssh into the Raspberry Pi and
do some of this debugging while your program has failed.
Because the Pi is a general-purpose computer, without the strict memory limitations of the
Arduino, you can simply use try... catch... logic so that you can trap errors in your
Python code and determine what to do with them.
OPENNESS
Many of the components are indeed highly open: the customised Linux distributions such
as “Raspbian” (based on Debian), the ARM VideoCore drivers, and so on.
The core Broadcom chip itself is a proprietary piece of hardware.
https://E-next.in