100% found this document useful (1 vote)
8 views

Raspberry Pi Robotic Projects 3rd Edition Richard Grimmett download

The document is about the 'Raspberry Pi Robotic Projects 3rd Edition' by Richard Grimmett, which provides a step-by-step guide to various robotic projects using Raspberry Pi. It covers setting up the Raspberry Pi, building different types of robots, and includes practical applications like voice recognition and remote control. The book is aimed at hobbyists and programmers interested in robotics and requires no prior programming experience.

Uploaded by

gubadhaught
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
8 views

Raspberry Pi Robotic Projects 3rd Edition Richard Grimmett download

The document is about the 'Raspberry Pi Robotic Projects 3rd Edition' by Richard Grimmett, which provides a step-by-step guide to various robotic projects using Raspberry Pi. It covers setting up the Raspberry Pi, building different types of robots, and includes practical applications like voice recognition and remote control. The book is aimed at hobbyists and programmers interested in robotics and requires no prior programming experience.

Uploaded by

gubadhaught
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Raspberry Pi Robotic Projects 3rd Edition

Richard Grimmett pdf download

https://ebookgate.com/product/raspberry-pi-robotic-projects-3rd-
edition-richard-grimmett/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Raspberry Pi robotic blueprints utilize the powerful


ingredients of Raspberry Pi to bring to life amazing
robots that can act draw and have fun with laser tag
Grimmett
https://ebookgate.com/product/raspberry-pi-robotic-blueprints-utilize-
the-powerful-ingredients-of-raspberry-pi-to-bring-to-life-amazing-
robots-that-can-act-draw-and-have-fun-with-laser-tag-grimmett/
ebookgate.com

Raspberry Pi Projects for Kids Second Edition Bates

https://ebookgate.com/product/raspberry-pi-projects-for-kids-second-
edition-bates/

ebookgate.com

Raspberry Pi Hardware Projects 2 1st Edition Andrew


Robinson

https://ebookgate.com/product/raspberry-pi-hardware-projects-2-1st-
edition-andrew-robinson/

ebookgate.com

Teach Yourself VISUALLY Raspberry Pi 1st Edition Richard


Wentk

https://ebookgate.com/product/teach-yourself-visually-raspberry-
pi-1st-edition-richard-wentk/

ebookgate.com
Raspberry Pi for Secret Agents 3rd Edition Matthew Poole

https://ebookgate.com/product/raspberry-pi-for-secret-agents-3rd-
edition-matthew-poole/

ebookgate.com

Sensor Projects with Raspberry Pi Internet of Things and


Digital Image Processing 2nd Edition Guillermo Guillen

https://ebookgate.com/product/sensor-projects-with-raspberry-pi-
internet-of-things-and-digital-image-processing-2nd-edition-guillermo-
guillen/
ebookgate.com

Halfacre G Official Raspberry Pi Beginner s Guide 3rd


Edition Gareth Halfacree

https://ebookgate.com/product/halfacre-g-official-raspberry-pi-
beginner-s-guide-3rd-edition-gareth-halfacree/

ebookgate.com

Raspberry Pi Networking Cookbook Second Edition Golden

https://ebookgate.com/product/raspberry-pi-networking-cookbook-second-
edition-golden/

ebookgate.com

Raspberry Pi user guide Fourth Edition / Halfacree

https://ebookgate.com/product/raspberry-pi-user-guide-fourth-edition-
halfacree/

ebookgate.com
Raspberry Pi Robotic Projects
Third Edition

Work through a mix of amazing robotic projects using the


Raspberry Pi Zero or the Raspberry Pi 3

Richard Grimmett

BIRMINGHAM - MUMBAI
Raspberry Pi Robotic Projects
Third Edition

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: February 2014

Second edition: April 2015

Third edition: October 2016

Production reference: 1041016

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78646-796-6
www.packtpub.com
Credits

Author Copy Editor

Richard Grimmett Safis Editing

Reviewer Project Coordinator

Jon Witts Suzanne Coutinho

Commissioning Editor Proofreader

Kartikey Pandey Safis Editing

Acquisition Editor Indexer

Tushar Gupta Rekha Nair

Content Development Editor Graphics

Merint Mathew Abhinash Sahu

Technical Editor Production Coordinator

Hussain Kanchwala Shraddha Falebhai


About the Author
Richard Grimmett has always been fascinated by computers and electronics from his very
first programming project that used Fortran on punch cards. He has a bachelor's and
master's degree in electrical engineering and a PhD in leadership studies. He also has 26
years of experience in the Radar and Telecommunications industries and even has one of
the original brick phones. Currently, he teaches computer science and electrical engineering
at Brigham Young University, Idaho, where his office is filled with many of his robotics
projects.

This book is the result of working with many of the wonderful students at BYU-Idaho. It also
wouldn’t be possible without the help of my wonderful wife, Jeanne.
About the Reviewer
Jon Witts has been working in the IT industry since 2002, specifically in educational IT since
2004. He was introduced to Linux back in 2001 through his collaboration with two German
artists who were visiting the arts organisation he was then working with. Having studied
fine arts and educational technology, he sought to innovate with open and accessible digital
technologies within his creative practice and is happiest when deconstructing technology
and finding its limits.

Jon has embedded the use of Raspberry Pi computers in his school as an integral part of the
delivery of the computer science curriculum, as well as to run various school clubs and
projects. Jon is a Raspberry Pi Certified Educator and also helps to organize and run the
Hull Raspberry Jam events.

I would like to thank my wife, Sally, and our three daughters for putting up with all the cables and
components around the house, and not least for being so tolerant of the need to dodge the robots
racing around the kitchen floor!
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.

Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Table of Contents
Preface 1
Chapter 1: Getting Started with the Raspberry Pi 5
Setting up the Raspberry Pi 3 6
Powering the board 8
Hooking up a keyboard, mouse, and display 9
Installing the operating system 9
Adding Internet access 14
Accessing your Raspberry Pi 3 from your host PC 14
Setting up the Raspberry Pi Zero 29
Powering the board 30
Hooking up a keyboard, mouse, and display 31
Installing the operating system 34
Adding Internet access 35
Summary 39
Chapter 2: Building Your Own Futuristic Robot 40
Modifying the R2D2 41
Adding wheels and motors 42
Connecting to the top of the R2D2 47
Controlling R2D2 using the Raspberry Pi in Python 50
Adding voice recognition 56
Using eSpeak to allow your robot to speak 63
Using PocketSphinx to accept your voice commands 64
Interpreting commands and initiating actions 73
Adding video capability 75
Downloading and installing OpenCV – a fully featured vision library 80
Controlling your R2D2 remotely 85
Summary 86
Chapter 3: Building a Wall-E Robot 87
Creating the hardware platform 88
Adding the Raspberry P and a DC motor controller 95
Building Wall-E's arms 97
Constructing the arms 100
Controlling Wall-E's tracks using a Raspberry Pi in Python 108
How servo motors work 111
Using a servo controller to control the servos 111
Communicating between the servo controller and a PC 115
Controlling the Servo Controller with the Raspberry Pi 117
Adding the Kinect 360 to your Wall-E 123
Accessing the Kinect 360 using the Raspberry Pi 124
Controlling your Wall-E remotely 128
Summary 128
Chapter 4: Building a Robotic Fish 129
Creating the hardware platform 129
Adding the electronics to your fish 136
Adding the RaspiCamera 142
Controlling your fish remotely 147
Summary 150
Chapter 5: Creating a Robotic Hand with the Raspberry Pi 151
Creating the hardware platform 151
Moving the hand 154
Connecting the servo controller to the Raspberry Pi 158
Controlling your hand 161
Following your hand 165
Summary 173
Chapter 6: A Self-Balancing Robot 174
Creating the hardware platform 174
Adding the electronics to your platform 175
Controlling the DC motors 176
Reading the IMU 177
Accessing the compass programmatically 180
The balancing algorithm 184
Summary 189
Chapter 7: Adding the Raspberry Pi to a Quadcopter 190
Accessing the hardware platform 191
Connecting to the hardware 191
Remote communication 194
Configuring the XBee device 196
Communicating over the XBee interface 202
Adding GPS to your quadcopter 204
Connecting the Raspberry Pi to a USB GPS device 204

[ ii ]
Accessing the USB GPS programmatically 212
Summary 218
Index 219

[ iii ]
Preface
With the introduction of the Raspberry Pi just a few short years ago, a whole new world of
do-it-yourself projects have come to life. This inexpensive but powerful processor provides
a wide range of possibilities. When married with third-party hardware and free open source
software, the opportunities are endless.

This book provides a step-by-step guide to at least some of these projects. Each chapter will
introduce you to a new and different type of project. Each project will have very specific
challenges and opportunities to learn new and cool ways to use the Raspberry Pi. Now,
these chapters are really just an introduction to the topic; each of these projects would take
an entire book to cover all the different aspects.

The book will hopefully inspire you to take the many different skills you have learned and
mix and match them into entirely different projects with new and creative capabilities.
Explore, for that is the overall theme of this book and of the Raspberry Pi.

What this book covers


Chapter 1, Getting Started with the Raspberry Pi, covers the details of setting up a useful
development environment on the Raspberry Pi. The chapter begins with a discussion on
how to connect power and continues through setting up a full system that is configured and
ready to begin connecting any of the amazing devices and software capabilities to develop
advanced robotics applications.

Chapter 2, Building Your Own Futuristic Robot, talks about the amazing things you can do
with the Raspberry Pi, such as control a wheeled robot. This chapter will show you how to
add a motor control so you can build your very own autonomous mobile robot.
Additionally, one of the amazing features of today’s computer system is the ability to input
commands and provide output without a screen or keyboard. A few years ago, the concept
of a computer that can talk and listen was science fiction, but today it is becoming a
standard part of new cell phones. You’ll take a standard toy R2D2 and turn it into a
responsive robot.

Chapter 3, Building a Wall-E Robot, talks about another impressive robotic project, which is
a robot modeled after Wall-E—a robot with a tracked base and articulating arms. Servos can
be controlled using the Raspberry Pi and some additional USB-controlled hardware. Our
robot will also use a Microsoft Kinect to not only have vision but depth perception as well.
Preface

Chapter 4, Building a Robotic Fish, shows you how to build your very own robot that can
swim and show you the world under the water—wouldn’t a swimming robot be cool?

Chapter 5, Creating a Robotic Hand with the Raspberry Pi, talks about how you have a full
toolkit of possibilities now, and how you can use them to build and control a robotic hand
that can see and respond to the world around it. In this case, you’ll program your hand to
follow the movements of your hand using a webcam.

Chapter 6, A Self-Balancing Robot, discusses the many recent robotic toys that were built on
the concept of self-balancing two-wheeled platform. This chapter shows you how to build a
robot that can balance and move using only two wheels.

Chapter 7, Adding the Raspberry Pi to a Quadcopter, introduces you to the concept of building
a robot that can fly. A robot that can walk, talk, or move is cool, but one that can fly is the
ultimate.

Who this book is for


This book is for hobbyists and programmers who are excited about using the Raspberry Pi 3
and Raspberry Pi Zero. It is for those who are taking their first steps towards using these
devices to control hardware and software and write simple programs that enable amazing
projects. No programming experience is required, just a little computer and mechanical
aptitude and the desire to build some interesting projects.

What you need for this book


To download the requisite software list, please refer to the following links: https://www.p
acktpub.com/sites/default/files/downloads/RaspberryPiRoboticProjectsSoftware
List.pdf

Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can
include other contexts through the use of the include directive."

[2]
Preface

A block of code is set as follows:


ser = serial.Serial("/dev/ttyACM0", 9600)
setAngle(ser, 0, 90)
setAngle(ser, 1, 90)
setAngle(ser, 2, 90)
time.sleep(1)

Any command-line input or output is written as follows:


sudo apt-get install libasound2-dev

New terms and important words are shown in bold. Words that you see on the screen, for
example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button
moves you to the next screen."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or disliked. Reader feedback is important for us as it helps us
develop titles that you will really get the most out of.

To send us general feedback, simply e-mail feedback@packtpub.com, and mention the


book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.

[3]
Preface

Downloading the color images of this book


We also provide you with a PDF file that has color images of the screenshots/diagrams used
in this book. The color images will help you better understand the changes in the output.
You can download this file from https://www.packtpub.com/sites/default/files/down
loads/RaspberryPiRoboticProjectsThirdEdition_ColorImages.pdf.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you could report this to us. By doing so, you can save other
readers from frustration and help us improve subsequent versions of this book. If you find
any errata, please report them by visiting http://www.packtpub.com/submit-errata,
selecting your book, clicking on the Errata Submission Form link, and entering the details
of your errata. Once your errata are verified, your submission will be accepted and the
errata will be uploaded to our website or added to any list of existing errata under the
Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/conten


t/support and enter the name of the book in the search field. The required information will
appear under the Errata section.

Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable
content.

Questions
If you have a problem with any aspect of this book, you can contact us at
questions@packtpub.com, and we will do our best to address the problem.

[4]
Getting Started with the
1
Raspberry Pi
Welcome to the exciting world of Raspberry Pi! Since its introduction just a few years ago, it
has gained a huge following of Do-It-Yourselfers, who use the small but versatile processor
family to build a wide variety of projects, and for good reason. The entire set of Raspberry
Pi offers a range of solid performance at a low cost. With the addition of inexpensive
additional hardware and free, open source software, the Raspberry Pi can be used to
produce a wide range of projects, including robots that can roll, walk, fly, and swim.

The Raspberry Pi can do amazing things, but first you'll need to understand how to access
all of this capability. In this chapter, you'll learn about the following subjects:

Providing power to the board


Connecting a display, keyboard, and mouse
Loading and configuring the operating system
Configuring the board for remote access

There are several versions of the Raspberry Pi, but there are two versions that you can
choose to do the projects in this book. The first is the Raspberry Pi Zero, the smallest and
least expensive of the Raspberry Pi processor boards. It boasts a Broadcom BCM2835
application processor that features a 1 GHz ARM11 core and 512MB of LPDDR2 SDRAM.
The board also has a microSD card slot, a mini HDMI socket for 1080p60 video output,
micro USB sockets for data and power, and a 40-pin GPIO header in a small form factor.
Getting Started with the Raspberry Pi

The other choice is the Raspberry Pi 3, a slightly larger version, but with higher
performance and more hardware connections built right into the board. The Raspberry Pi 3
offers a 1.2 GHz 64-bit quad-core ARM Cortex-A53 CPU (~3 x the performance of the
Raspberry Pi Zero). In contrast to the Raspberry Pi Zero, it has a built-in microSD card slot,
a standard HDMI socket for 1080p60 video output, a micro USB socket for power, a built-in
four-port USB connector, and a 40-pin GPIO header. It also provides Integrated 802.11n
wireless LAN and Bluetooth 4.1. If you are not sure which board is right for you, it may
make sense to read through this chapter, see how to power up and configure both, and then
decide which is right for you.

Setting up the Raspberry Pi 3


The Raspberry Pi 3, with more hardware available as part of the standard product, is
similar, but a bit easier to configure, than the Raspberry Pi Zero, since almost all the
hardware you need is available right on the Raspberry Pi 3.

Here are the items you'll need to set up the Raspberry Pi 3:

A Raspberry Pi 3
A micro USB cable and power supply to provide power to the board
A display with an HDMI video input
A keyboard and mouse
A micro SD card – with at least 4 GB capacity
A micro SD card writer
Another computer that is connected to the Internet

[6]
Getting Started with the Raspberry Pi

Before you get started, let's get familiar with the Raspberry Pi 3. Here is an image of the
hardware:

Here are the connections labeled for your information:

[7]
Getting Started with the Raspberry Pi

One of the first things you'll need to do is provide power for the board.

Powering the board


One of the first issues you'll want to consider is how to power the board. To do this, you
need to connect through the USB power connection. There are two choices for providing
power to the Raspberry Pi Zero:

1. Connect the micro USB connector labeled power to a 5V DC source powered by a


USB power supply. This can be either a power supply that can plug directly into
an outlet, or power supplied by a powered USB port such as those available on
most computers.
2. Connect the micro USB connector to a battery. The simplest type of connection is
to a battery that has a USB connector, like those used to charge cellphones. Here
is an image of just such a battery:

In both cases, make sure that the unit can supply enough current. You'll need a supply that
can provide at least 1000 mA at 5V. Do not plug in the board just yet; you first need to
connect the rest of the hardware and configure the micro SD card. However, you are now
ready to connect the rest of the hardware.

[8]
Getting Started with the Raspberry Pi

Hooking up a keyboard, mouse, and display


The next step is to connect a keyboard, mouse, and display to the Raspberry Pi 3. For the
Raspberry Pi 3, this is very straightforward: simply plug the USB connectors of the
keyboard and mouse into one of the four USB connectors on the Raspberry Pi 3.

Now, you'll also need a display. There are a number of different video standards; here is an
image of some of the most common ones, for reference:

There is an HDMI connector on the Raspberry Pi 3. You can connect directly to an HDMI
display using an HDMI cable. If your display has a DVI connector, you can purchase an
HDMI to DVI cable.

You are almost ready to plug in the Raspberry Pi 3. Even though your hardware
configuration is complete, you'll still need to complete the next section to power on the
device. So, let's figure out how to install an operating system.

Installing the operating system


Now that your hardware is ready, you need to download and image an operating system to
a microSD card. The Raspberry Pi 3 provides a lot of different choices. You'll stick with
Linux, an open source version of Unix, on your Raspberry Pi 3. Linux, unlike Windows,
Android, or iOS, is not tightly controlled by a single company. It is a grassroots effort from
a wide community, mostly open source and, while it is available for free, it grows and
develops a bit more chaotically.

[9]
Getting Started with the Raspberry Pi

A number of different versions of Linux have emerged, each built on a core set of similar
capabilities referred to as the Linux kernel. These core capabilities are all based on the Linux
specification. However, they are packaged slightly differently, and developed, supported,
and packaged by different organizations. The Raspberry Pi community has become
standardized on Raspbian, a Debian distribution of Linux for the Raspberry Pi. So, you are
going to install and run Raspbian on your Raspberry Pi 3.

The newest version of Debian is called Jessie, after the cowgirl in Toy Story. This is the
naming convention for Debian, and you need to download this version of Raspbian.

You can purchase a card that has Raspbian installed, or you can download it onto your
personal computer and then install it on the card. To download a distribution, you need to
decide if you are going to use a Windows computer to download and create an SD card, a
MAC OS X, or a Linux machine. Here are the steps for Windows and Linux machines:

For directions on the MAC OS X, go to http://www.raspberrypi.org/do


cumentation/installation/installing-images/mac.md.

1. Firstly, you need to download an image. This part of the process is similar for
both Windows and Linux. Open a browser window, go to the Raspberry Pi
Foundation's website, https://www.raspberrypi.org/, and select the
Downloads selection at the top of the page. This will give you a variety of
download choices. Go to the Raspbian section, and select the .zip file just to the
right of the image identifier. You need the latest version, but not the lite one. This
will download an archived file that has the image for your Raspbian operating
system. Note the default username and password; you'll need them later.
2. If you're using Windows, you'll need to unzip the file using an archiving
program such as 7-Zip, available at http://www.7-zip.org/. This will leave you
with a file that has the .img extension—a file that can be imaged onto your card.
Next, you need a program that can write the image to the card. I use Image Writer
for Windows. You can find a link to this program at the top of the download
section on the http://www.raspberrypi.org website.

[ 10 ]
Getting Started with the Raspberry Pi

Plug your card into the PC, run this program, and you should see the following:

3. Select the device card and the image you downloaded earlier; it should look
something like the following screenshot:

4. Click on the Write button. This will take some time, perhaps as long as 15
minutes. When it is complete, exit the program and you'll have your microSD
card with the image.
5. If you are using Linux, you need to unarchive the file and then write it to the
card. You can do all of this with one command. However, you do need to find the
/dev device label for your card. You can do this with the ls -la /dev/sd*
command. If you run this before you plug in your card, you might see something
like the following screenshot:

[ 11 ]
Getting Started with the Raspberry Pi

6. After plugging in your card, you might see something like the following
screenshot:

7. Note that your card is at sdb. Now, go to the directory in which you downloaded
the archived image file and use the following command:

sudo dd if=2015-11-21-raspbian-jessie.img of=/dev/sdX

8. The 2015-11-21-raspbian-jessie.img command will be replaced by the


image file that you downloaded and /dev/sdX will be replaced by your card ID,
in this example, /dev/sdb. Be careful to specify the correct device, as this can
overwrite the data on any of your drives. Also, this may take a few minutes. Once
the file is written, eject the card, and you are ready to plug it into the board and
apply the power.

[ 12 ]
Getting Started with the Raspberry Pi

Now that you have completed those steps, make sure that your Raspberry Pi 3 is unplugged
and install the SD card into the slot. Then power the device. After the device boots, you
should get the following screen:

You are up and running!

If you are using a US keyboard, you may need to edit the keyboard file for
your keyboard to use nano effectively. To do this, use the drop-down
menu in the upper left-hand corner of the screen, choose Preferences |
Mouse and Keyboard Settings, and then select the Keyboard tab. You can
then choose the correct keyboard for your configuration.

Now you are ready to start interacting with the system! You can bring up a Terminal
window and start typing commands.

[ 13 ]
Getting Started with the Raspberry Pi

Adding Internet access


The Raspberry Pi 3 has a standard LAN connector. To connect the Raspberry Pi 3, simply
plug it into an active LAN. The Raspberry Pi also has built-in WLAN capability. If you are
going to connect wirelessly, make sure that you have a wireless access point available. You
can then use the Raspberry Pi's Wireless LAN manager to connect. To do this, select the
LAN manager icon in the upper right-hand corner of the graphical user interface (GUI):

You can then select the network you wish to connect to. Enter your password and you
should be connected.

Accessing your Raspberry Pi 3 from your host PC


Once you have established an Internet network connection with your device, you can access
it from your host computer. There are three ways to access your system from your remote
computer:

1. The first is through a Terminal interface called SSH.

[ 14 ]
Getting Started with the Raspberry Pi

2. The second way is by using a program called VNC server. This allows you to
open a graphical user interface remotely, which mirrors the graphical user
interface on the Raspberry Pi 3.
3. Finally, you can transfer files through a program called WinSCP, which is
custom-made for this purpose. You can use a program called scp for Linux.

So firstly, make sure that your basic system is up and working. Open a Terminal window
and check the IP address of your unit. You're going to need this, however, you
communicate with the system. Do this by using the ifconfig command. It should produce
what is shown in the following screenshot:

[ 15 ]
Getting Started with the Raspberry Pi

You need inet addr to contact your board through the Ethernet. If you are using a
wireless device to gain access to the Internet, your wireless router will set the IPv4addr
shown in the wlan0 section of this information. You also need an SSH terminal program
running on your remote computer. An SSH terminal is a Secure Shell (SSH) connection,
which simply means that you'll be able to access your board and give it commands by
typing them into your remote computer. The response from the Raspberry Pi 3 will appear
in the remote computer's Terminal window.

If you'd like to know more about SSH, visit https://www.siteground.co


m/tutorials/ssh/.

If you are running Microsoft Windows, you can download an alternative application. My
personal favorite is PuTTY. It is free and does a very good job of saving your configuration
so that you don't have to type it in every time. Type putty in a search engine and you'll
soon come to a page that supports a download. Alternatively, you can go to
http://www.putty.org.

[ 16 ]
Getting Started with the Raspberry Pi

Download PuTTY to your Microsoft Windows machine. Then, run putty.exe. You should
see a configuration window that looks something like the following screenshot:

Type the inet addr from the previous page in the Host Name space and make sure that
the SSH selection is selected. You may want to save this configuration under Raspberry Pi
so that you can reload it each time.

[ 17 ]
Getting Started with the Raspberry Pi

When you click on the Open button, the system will try to open a Terminal window onto
your Raspberry Pi through the LAN connection. The first time you do this, you will get a
warning about an RSA key, as the two computers don't know about each other. Windows
therefore, complains that a computer that it doesn't know is about to be connected in a fairly
intimate way. Simply click on the OK button and you should get a Terminal with a login
prompt, as shown in the following screenshot:

Now you can log in and issue commands to your Raspberry Pi. If you'd like to do this from
a Linux machine, the process is even simpler. Bring up a Terminal window and then type
ssh pi@xxx.xxx.xxx.xxx, where xxx.xxx.xxx.xxx is the inet addr of your device.
This will then bring you to the login screen of your Raspberry Pi, which should look similar
to the preceding screenshot.

SSH is a really useful tool to communicate with your Raspberry Pi. However, sometimes
you need a graphical look at your system and you don't necessarily want to connect to a
display. You can get this on your remote computer by using an application called
vncserver. You'll need to install a version of this on your Raspberry Pi by typing sudo
apt-get install tightvncserver in a Terminal window on your Raspberry Pi. This is
a perfect opportunity to use SSH, by the way.

[ 18 ]
Getting Started with the Raspberry Pi

Tightvncserver is an application that allows you to view your complete Raspberry Pi. Once
you have it installed, you need to start the server by typing vncserver in a Terminal
window on the Raspberry Pi. You will be prompted for a password and password
verification, and then you will be asked if you'd like to have a view-only password.
Remember the password that you entered-you'll need it to log in via VNC Viewer remotely.

You need a VNC Viewer application for your remote computer. On my Windows system, I
use an application called RealVNC. When I start the application, it gives me the following:

Enter the VNC Server address, which is the IP address of your Raspberry Pi, and click on
Connect. You will see a pop-up window, as shown in the following screenshot:

[ 19 ]
Getting Started with the Raspberry Pi

Type in the password that you just entered while starting vncserver. You should then get a
graphical view of your Raspberry Pi that looks like the following screenshot:

You can now access all of the capabilities of your system, although they may be slower if
you are doing a graphics-intensive data transfer.

[ 20 ]
Getting Started with the Raspberry Pi

There are ways to make vncserver start automatically on boot. I have not
used them; I prefer to type the vncserver command from an SSH
application when I want the application running. This keeps your running
applications to a minimum and, more importantly, presents fewer security
risks. If you want to start yours each time you boot, there are several
places on the Internet that show you how to configure this. Try the
following website:
http://www.havetheknowhow.com/Configure-the-server/Run-VNC-on-
boot.html

To view this Raspberry Pi desktop from a remote Linux computer running Ubuntu, for
example, you can type sudo apt-get install xtightvncviewer and then start it by
using xtightvncviewer 10.25.155.110:1 and supplying the chosen password.

Linux has viewers with graphical interfaces such as Remmina Remote Desktop Client
(select the VNC-Virtual Network Computing protocol), which might be used instead of
xtightvncviewer. Here is a screenshot of the Remote Desktop Viewer:

[ 21 ]
Getting Started with the Raspberry Pi

Make sure that vncserver is running on the Raspberry Pi. The easiest way to do this is to log
in using SSH and run vncserver at the prompt. Now, click Connect on the Remote Desktop
Viewer. Fill in the screen as follows; in the Protocol selection, choose VNC, and you should
see the following:

[ 22 ]
Getting Started with the Raspberry Pi

Now, enter the Host Internet address, making sure that you include a :1 at the end, and
then click on Connect. You'll need to enter the vncserver password you set up, as shown in
the following screenshot:

Now you should be able to see the graphical screen of the Raspberry Pi. To access the
Raspberry Pi graphically from a Mac or other Apple device, you can still use RealVNC
Viewer. See https://www.realvnc.com/products/ for more information.

[ 23 ]
Getting Started with the Raspberry Pi

The final piece of software that I like to use with Windows is a free application called
WinSCP. To download and install this piece of software, go to https://winscp.net/ and
follow the instructions to download and install. Once installed, run the program. It will
open the following dialog box:

[ 24 ]
Getting Started with the Raspberry Pi

Click on New and you will get the following:

[ 25 ]
Getting Started with the Raspberry Pi

Here, you fill in the IP address in the host name tab, pi in the user name tab, and the
password (not the vncserver password) in the password space. Click on Login and you
should see a warning displayed, as shown in the following screenshot:

The host computer, again, doesn't know the remote computer. Click on Yes and the
application will display the following:

[ 26 ]
Getting Started with the Raspberry Pi

Now, you can drag and drop files from one system to the other. You can also do similar
things with Linux by using the command line. To transfer a file to the remote Raspberry Pi,
you can use the scp file user@host.domain:path command, where file is the
filename, and user@host.domain:path is the location you want to copy it to. For
example, if you wanted to copy example.py from your Linux system to the Raspberry Pi,
you would type scp example.py pi@10.25.155.176:/home/pi/. The system will ask
you for the remote password, which is the login for the Raspberry Pi. Enter the password
and the file will be transferred.

Now that you know how to use ssh, tightvncserver and scp, you can access your
Raspberry Pi remotely without having a display, keyboard, or mouse connected to it.

You only need to connect the power and the LAN, either with a cable or through wireless
LAN. If you need to issue simple commands, connect through SSH. If you need a more
complete set of graphical functionality, you can access this through vncserver. Finally, if
you want to transfer files back and forth, you can use WinSCP from a Windows computer,
or scp from a Linux computer. Now you have the toolkit to build your first functionality.
You can also use scp on a Mac. Here is a link for more information: https://research.csc
.fi/csc-guide-copying-files-from-linux-and-mac-osx-machines-with-scp.

One of the challenges of accessing the system remotely is that you need to know the IP
address of your board. If you have the board connected to a keyboard and display, you can
always just run the ifconfig command to get this information. However, you're going to
use the board in applications in which you don't have this information. There is a way to
discover this by using an IP scanner application. There are several available for free; on
Windows, I use an application called Advanced IP Scanner, available at .

[ 27 ]
Getting Started with the Raspberry Pi

When you start the program, it looks like the following screenshot:

Clicking on the Scan selector scans for all the devices connected to the network. You can
also do this in Linux; one application for IP scanning in Linux is calledNmap. To install
Nmap, type sudo apt-get install nmap. To run Nmap, type sudo nmap -sp
10.25.155.1/154 and the scanner will scan the addresses from 10.25.155.1 to
10.25.155.154.

For more information on Nmap, see http://www.linux.com/learn/tuto


rials/29 879-beginners-guide-to-nmap.

These scanners let you know which addresses are being used, and this should allow you to
see your Raspberry Pi address without typing ipconfig. Your system has lots of
capabilities. Feel free to play around with the system—try to get an understanding of what
is already there and what you'll need to add from a software perspective.

[ 28 ]
Getting Started with the Raspberry Pi

Setting up the Raspberry Pi Zero


While the Raspberry Pi Zero is a powerful computer, you'll need some additional hardware
to access this capability. Here are the items you'll need to set up the Raspberry Pi Zero:

A Raspberry Pi Zero
A micro USB cable and power supply to provide power to the board
A display with an HDMI video input
A keyboard, a mouse, and a powered USB hub
A micro SD card – with at least 4 GB capacity
A micro SD card writer
Another computer that is connected to the Internet
A WLAN USB dongle
A 40×2 pin connector strip

Before you get started, let's get familiar with the Raspberry Pi Zero. Here is an image of the
hardware:

[ 29 ]
Getting Started with the Raspberry Pi

Note that the GPIO pin male headers are not pre-soldered to the board; you'll want to do
that. You can buy these at most online electronics retailers. You should also become familiar
with the various connections on the board. Here, you can see the Raspberry Pi Zero with
the connector soldered and the connections labeled for your information:

Powering the board


One of the first issues you'll want to consider is how to power the board. To do this, you
need to connect through the USB power connection. The same two choices are available to
power the Raspberry Pi Zero as the Raspberry Pi 3. However, you'll need to power the USB
hub as well, so make sure you take that into account in your power choices.

[ 30 ]
Getting Started with the Raspberry Pi

Hooking up a keyboard, mouse, and display


The next step is to connect a keyboard, mouse, and display to the Raspberry Pi Zero. To
connect any device to the Raspberry Pi Zero, you'll need some sort of adapter or hub. You
can buy a simple hub, which goes from the micro USB connector on the Raspberry Pi Zero
to the more common standard connector. You can find these at most online electronics
retailers, and it looks something like the following:

However, there will be projects when you will want to connect more than one device to the
Raspberry Pi Zero. For these cases, you may want to consider purchasing a powered USB
hub. Before deciding on the hub to connect to your board, you need to understand the
difference between a powered USB hub and one that gets its power from the USB port itself.

Almost all USB hubs are unpowered. In other words, you don't plug in the USB hub
separately. The reason for this is that almost all of these hubs are hooked up to computers
with very large power supplies, and powering USB devices from the computer is not a
problem. This is not the case for your board. The USB port on your board has very limited
power capabilities, so if you are going to hook up devices that require significant power—a
WAN adapter or a webcam, for instance—you're going to need a powered USB hub, one
that provides power to the devices through a separate power source. Here is an image of
such a device, available at http://www.amazon.com and other online retailers:

[ 31 ]
Getting Started with the Raspberry Pi

Note that there are two connections on this hub. The one to the far right is a power
connection, which will be plugged into a battery or a USB power adapter with a USB port.
The connection to the left is the USB connection, which will be plugged into the Raspberry
Pi. To connect the powered USB board to the Raspberry Pi Zero, you need a cable that
connects to a micro USB connector. Now, you'll have more connections to add a mouse and
keyboard, webcams, and a USB WLAN device.

Now, you'll also need a display. There is a mini HDMI connector on the Raspberry Pi Zero.
In order to connect it to an HDMI monitor, you'll need a mini HDMI to standard HDMI
adapter or cable. You can also buy a cable that has a mini HDMI connector on one end and
a regular HDMI connector on the other. Here is an image of the adapter:

[ 32 ]
Getting Started with the Raspberry Pi

To use this adapter, simply connect it to your Raspberry Pi Zero, then connect the cable
with the regular HDMI connections to the adapter and your TV or monitor that has an
HDMI input connector. As with the Raspberry Pi 3, you can also buy a cable that goes from
mini HDMI to DVI.

So, connect your HDMI cable to your monitor and the Raspberry Pi Zero. Connect your
USB hub to the Raspberry Pi Zero and connect your keyboard and mouse to the USB hub.
Make sure that you connect all your devices before you power on the unit. Most operating
systems support the hot-swap of devices, which means you are able to connect a device
after the system has been powered on, but this is a bit shaky. You should always cycle
power when you connect new hardware. Here is a picture of everything connected:

The USB connectors are connected to USB power adapters. Even though your hardware
configuration is complete, you'll still need to complete the next section to power on the
device. So, let's figure out how to install an operating system.

[ 33 ]
Getting Started with the Raspberry Pi

Installing the operating system


You'll create a micro SD card with the appropriate operating system, following the same
instructions as for the Raspberry Pi 3. Make sure that your Raspberry Pi Zero is unplugged
and install the SD card into the slot. Then power on the device. After the device boots, you
should get the following screen:

You are up and running!

Note that if you use a powered USB hub, it might provide enough power
to your Raspberry Pi. However, in some circumstances, it might not be
able to provide all the power you need. I strongly suggest you use
different power sources—one for your Raspberry Pi Zero and one for your
hub.

[ 34 ]
Getting Started with the Raspberry Pi

You should be ready to bring up a Terminal window and start typing commands.

Adding Internet access


Unlike the Raspberry Pi 3, the Raspberry Pi Zero does not have a LAN connection. To
connect the Raspberry Pi Zero to the Internet, you have two choices. You can establish a
wireless LAN connection, or you can connect by using a USB to LAN adapter if you want to
connect to an actual LAN port. Let's look at both of these possibilities.

If you are going to connect wirelessly, make sure that you have a wireless access point
available. You'll also need a wireless device. The official Raspberry Pi Foundation markets a
device itself, but other brands also work.
See http://elinux.org/RPi_USB_Wi-Fi_Adapters to identify which wireless devices have
been verified to work with the Raspberry Pi Zero. Here is one that is available at many
online electronics outlets:

You'll also need to connect a powered USB hub for this process so that you can access both
the keyboard and mouse, as well as the USB wireless LAN device. Now, connect the device
to the powered hub.

[ 35 ]
Another Random Scribd Document
with Unrelated Content
realize his dreams of a gallery. There was a cold, numb pleasure in
hearing the clever Jew descant on funds, interest, dividend warrants
and investments. It seemed as if the very soul of gold had spoken to
her with glib tongue and beautiful though ironically curled lips. After
a time she began to understand with a feeling of secret, refreshing
joy how rich she really was.
IV

THE COLD MOMENT

There was a charity fête at the Athletic Ground. The quadrille on


horseback and the bicycle race were over and now people thronged
round the tombola and the stalls.
Stellan did not look up at the sky when he stepped out into the
saddling yard. He did not give a thought to the balloon whose
gigantic yellow silk bubble was already beginning to swell out and
shimmer in the cool September sunshine. No, his looks searched
anxiously amongst the scattered groups of spectators outside the
ring of guard. And he suddenly muttered a half-suppressed oath at
the sight of Peter who, furious and massive as a bull, bore down on
him from his ambush. He awaited the attack in the most deserted
spot he could find. And a certain weariness appeared in the hard
lines of his mouth:
“You have become damned difficult to find,” panted Peter. But
Stellan was already prepared with a smile. It is strange that smiles
can thrive so many degrees below freezing point.
“You can meet me as much as you like when you have got decent
clothes—and a decent face....”
Peter was unshaven. His overcoat dated from the fat and
sentimental period. It now hung on him like a sack. His barge-like
shoes were covered with the dirt of the bad roads of Selambshof
and he had in his hand, not a stick but a cudgel. And he shook the
cudgel and struck the ground with it:
“You are damned smart, you are! But if I take everything this fine
gentleman possesses perhaps he won’t be quite so smart. Tomorrow
I want my seventy-five thousand, or else I’ll make you bankrupt!”
Stellan still smiled. He pointed to the balloon and his tone became
exquisitely ironical:
“Come up with me and then we can talk business.”
Peter looked with a ludicrous expression of suspicion and
disapproval on the expensive and dangerous ascent in which his
seventy-five thousand would soar heavenwards:
“If you were at least decently insured,” he sighed. Then he
suddenly grew furious again and shouted, so that he was overheard
by the people round about them:
“I must have the money tomorrow. I won’t wait any longer.”
Stellan grew pale and came close up to his brother. It was as if he
were abusing some obstinate labourer:
“You lout! You want to get hold of my last share in Selambshof!
But I have already put them up another spout. Curse you, there are
better and bigger creditors than you! Yes, I have nothing but debts,
so my position is really excellent. The only hope for the creditors is
that the bubble won’t burst. But do you think it will improve matters
for a shabby old moneylender to come and hang on to my coat tails
just as I am going up? No, get away and keep quiet and I will show
you something to make you think.”
Stellan suddenly had an idea. He pushed aside the astonished and
hesitating Peter without further ceremony and went straight towards
the steps of the tennis pavilion.
There Miss Lähnfeldt was standing amidst a group of uniforms and
allowed Manne von Strelert to pay her his court. Both had taken part
in the quadrille on horseback and she was dressed in riding
breeches, which at that time was something quite new and bold,
and she stood there amongst all the men, slim and slight, but with
her head held high and with a proud carriage.
Stellan ploughed his way through the group. Not a feature
betrayed what kind of conversation he had just passed through. The
lines round his mouth were gay and slightly cruel. He saluted, kissed
her hand, and said aloud, so that everybody round them should
hear:
“Miss Lähnfeldt, do you remember I promised you a sensation?
Come up with me today.”
Miss Lähnfeldt wanted to appear a sportwoman. She cultivated to
the best of her ability the Anglo-Saxon style. Thanks to persistent
and expensive training she had really developed her little strength
until she was considered a bold rider and a fairly good tennis player.
She did not answer Stellan at once, but bit her lip and cast a glance
at the officers round her. But Manne protested. One had no right to
tempt charming ladies into the clouds, he thought. Charming ladies
might get dizzy....
Stellan looked gratefully at Manne, certain that his words would
only egg her on. She was not a coward, or at least she was more
vain than she was afraid. And a crowd is a bellows to vanity. Elvira
Lähnfeldt was one of those women who are excited by a crowd. The
thought of some kind of notoriety always occupied her thoughts. In
every crowd the desire to be noticed, spoken of, praised and envied,
worked like a stinging poison in her veins. When she now looked at
the group around her it was in order to measure the effect of the
proposal! It would surely create a sensation if she went up, a real
sensation....
She did not say “yes” straight out. She answered by the eternal
feminine question:
“But what shall I put on?”
“My military fur coat,” said Stellan. “Besides, your riding costume
is most suitable. But come along, it is twelve o’clock and the people
are waiting.”
She took his arm and they stepped out into the open space. The
group behind them applauded. Manne was teased at the cavalry
being outdistanced by the air force. There were several people there
who were interested in seeing the two friends’ position improved.
The balloon was already filled. Stellan turned away a poor journalist
who had had half a promise to be allowed to go up with him, and
amidst a murmur of surprise from the crowd he lifted Miss Lähnfeldt
very chivalrously over the edge of the gondola. But he did not give
the order to let go at once. He did not grudge his partner a few
moments of exquisite joy in the polite and encouraging exclamations
of the gentlemen and the little cries of alarm from her lady friends.
Then the attendants let go the ropes and the balloon rose. There
was a flutter of white handkerchiefs from the dark group below in
the grey oval of the cycle course.
As you know, one need not rise very high before everything down
below looks small.
“What mites,” said Miss Lähnfeldt. And her voice sounded a little
malicious.
Stellan cast a side-glance at her in order to gauge the effect of the
increasing depth beneath them. She looked down with an expression
which seemed to say; “This is nothing much.”
“Wait a bit, my dear,” thought Stellan. “You will get as much as
you can stand.” He had already made up his mind that this would
not be a pleasure trip, but an adventure.
The wind was west south-west. The balloon had not had time to
rise much before they were out over Lidingön. Below him Stellan
saw the shining green roof of the Hills’ villa.
Hedvig ... yes, he would have to try there too if everything else
went wrong. If only Percy had been alive.... But Hedvig alone, no,
there wasn’t much chance....
The balloon began to sink very suddenly. One must always be
careful when passing over forests, where the air is warmer and
lighter. But Stellan purposely neglected to cast out any ballast till
they almost swept over the tops of the trees. That was a trick that
used to impress beginners. Stellan looked again at his partner. She
was perhaps a little paler than before and held on a little more
tightly to the edge of the gondola. But if he had hoped for any
frightened screams and looks of anxious appeal he was doomed to
disappointment.
“The balloon must manœuvre badly,” she said.
Stellan flung out ballast, perhaps more than was necessary and
they rose quickly into silent and radiant space over the bright and
dazzling autumn coast landscape. It was really wonderfully beautiful
with the spray of gold that the leafy trees made amongst the dark
pines and the deep solemn September blue of the water in the bays
—which to the far-penetrating gaze of those above shivered in
iridescence of algæ-green, seaweed-brown and shimmering gneiss-
red nearer inshore in the shallower water. In a narrow smooth belt
of calm water a toy steamer drew behind it a silver shimmering fan
of dwarf-like waves. And far away in the east along the strangely
banked up horizon the sea stretched like a low endless blue ridge.
But most wonderful of all was the silence and the stillness, the
incomparable, mighty calm in a balloon that moved with the wind
and in which a candle flame would burn as steadily as in a closed
room.
“Strange ... it is like sitting in a glass cupboard,” said Miss
Lähnfeldt in a low voice and there was after all involuntary
admiration in her voice. But then she added: “Though I must say I
thought it would be more exciting....”
Stellan bit his lip: he was not in the mood for enjoying anything
beautiful just now. He felt like a stage manager who is responsible
for effect before a critical and spoilt public. He thought of Peter, his
affairs, marriage—without any enthusiasm for the last.... He felt
almost hostile to the woman by his side. Her affected indifference
irritated him. He could not manage to pay her any sort of attention.
He felt like a partner who dances out of time and has nothing to
whisper into his partner’s ear. Annoyed, he tapped the barometer. It
sank, though the balloon was sinking slowly. It was already three
o’clock in the afternoon. The sun suddenly disappeared. Behind
them in the west the sky was clouded. The air began to grow a cold,
whitish grey, and clouded over, they no longer saw the earth below
them. In an incredibly short time they had become enveloped in a
dense cloud.
Stellan did not descend, as was his duty with an approaching
storm when he was so near the sea. He was a desperado. Miss
Lähnfeldt was going to have an experience, that was all. He threw
out several sacks of ballast, which disappeared in long brown streaks
in the fog below them.
His manœuvring was not quite planless. He had observed that the
wind in the upper strata was several degrees more southerly and he
began to think of the Åland islands.
Now they were suddenly out in the sunshine again, in the cold
dazzling sunlight over an enormous shimmering sea of cloud. They
soared alone in a dazzling white, ever changing, chaos of snow
mountains and lakes of fog—millions of years before human life
existed....
“I have seen this before in Switzerland,” said Miss Lähnfeldt
shivering with cold.
The balloon had risen rapidly and lost much gas. It soon began to
sink again through the cloud world, which now grew grey. When it
cleared up below them they were already out over a nasty grey,
white-crested sea. A very strong wind was blowing.
Then the first feminine exclamation escaped from Miss Lähnfeldt:
“But, good heavens, how shall we get back?”
Stellan bowed for the first time with a polite and amiable smile:
“By steamer,” he said. “We will sleep at Mariehamn tonight.”
As a matter of fact he was not so sure of it. The wind higher up
had evidently been a few degrees more in the west than he had
counted on. In its present quarter they would pass south of Åland.
But the storm lower down might draw them south ... otherwise ...
well what otherwise? Well, otherwise they would go to hell....
What does a man like Captain Stellan Selamb feel when he
mutters to himself that he might “go to hell”? Nothing really. He has
never properly conceived death. His egoism is so hard and polished
that the thought of death slips off everywhere.
If you want an opinion of a man, try to find out his views of death.
Death comes in life and not after life. And it is what happens in life
that makes us really alive. What else are we but our conception of,
our defiance of, our struggle against, and our victory over, death?
Yes, because there is a real, a living courage which conquers
death....
Stellan had the gambler’s courage. It is always better than
cowardice. But it is really very superficial. A hard frozen surface with
no resilience beneath. Clear but shallow thoughts that have never
penetrated to the depths of life. An inner reflection of a blind, pitiless
Fate.... How much of the courage that meets us in the wild and
bloody history of the world is not of this kind? The great gamblers!
Minds and souls are only cards to them, playing cards or trumps in
the wild gamble of politics and war. They only know themselves even
as trumps in the game. Even their own terrible egoism is really only
a mirage. For death has not made them alive....
The balloon drove eastwards with the gale. Stellan sailed low and
saved his ballast. In the north they could see Åland and Lernland
and Lumparland. The waves washed heavily in the apparent stillness
around them. They were sinking lower and lower. The last sack of
ballast went over. The balloon began to shrink round the valve.
There must be a leakage. Now a giant roaring wave attempted to
grab the gondola.
Stellan had to throw out everything loose, the ballast sacks
themselves, ropes, fur coats, stethoscopes and barometer. He used
the momentary respite to assist Miss Lähnfeldt up into the rigging
where she sat as on a trapeze and held on to the cordage. She was
very pale and looked as if she might faint any moment, so he
thought it best to make her fast.
“This is abominable,” she mumbled, as if she had been exposed to
some clumsiness on the part of a vulgar partner. But she did not
whimper.
They swept in over the breakers and rocks of the wild and
deserted skerries of Kökars. The gondola was already trailing in the
water, and the balloon began to swing and jerk to and fro. Stellan
also climbed up into the rigging. He took the anchor with him. With
violent jerks they trailed over a stony rocky island on the skerries.
Then again they were carried over an empty roaring bay. But now
the wind had really turned into the south and there was some
wooded country ahead of them. Stellan cut away the gondola, as it
made the balloon dip. Then it rose for the last time. They sat as in a
swing over the surging water. Phew! now they were rushing in
towards the land. A jetty and a few red-painted outhouses were
visible in the grey twilight. Stellan dropped anchor in a damp marshy
meadow so that the balloon might trail a little and reduce speed. It
caught in an alder with a terrible jerk. Quick as lightning he tore
open one of the gores—and the balloon partly fell and was partly
flung down into a copse of young birches.
Stellan freed himself at once. He hastened to drag out his fellow
passenger from below the torn, flapping and billowing balloon cloth.
She had fainted....
Some people came running up and he made them carry her in.
They had had the luck to land just beside a country house. Then he
rushed to the telephone and arranged for telegrams....
Miss Lähnfeldt lay ill for a few days, till Stellan one day stepped in
to her with a bundle of Swedish newspapers full of highly coloured
descriptions of the unique and adventurous balloon flight of the well-
known tennis player and rider, Miss Lähnfeldt.
For the first time she looked at Stellan with gratitude and
approval.

Stellan was invited to the autumn shoot at Trefvinge. He gave a


low whistle when he saw the name of Miss Lähnfeldt and not her
father on the invitation card. He understood that the invitation was
from her and not from her father.
But he also whistled, though in another key, when he heard from
the coachman that Captain von Strelert had already arrived. For it
was equally evident that Manne, Baron Manne von Strelert was the
guest of the Count.

Count Lähnfeldt had, as a matter of fact, been extremely angry


over his daughter’s rash action. Busybodies, of course, telephoned at
once to Trefvinge to tell him that his daughter had gone up in a
balloon with Captain Selamb. In a balloon! It seemed almost
indecent to him. He could not remember any really aristocratic ladies
who had gone up in a balloon. And with that Captain Selamb into
the bargain! From Selambshof ... brother of Peter Selamb...!
When, later in the day, there came a telephone message from
Furusund that the balloon had been driven out to sea in the gale,
then he regarded the information as a confirmation of his view that
Captain Selamb was not the sort of gentleman that the daughter of
Count Lähnfeldt should go up in the air with. He was so extremely
vexed that he scarcely felt any anxiety for the life of his only child.
Towards evening he calmed down a little when he received a wire
that they had landed at a quite respectable Finnish-Swedish country
house. And when the following day he read in the papers of the
brave and sporting action of a lady moving in the highest circles, and
of the courage and the self-control of Miss Lähnfeldt, daughter of
the well-known Count Lähnfeldt of the magnificent seat at Trefvinge,
well, then he thought at last that perhaps his daughter’s eccentricity
had something aristocratic in it after all.
But from that admission to the approval of Captain Selamb as in
any sort of capacity suitable company for his daughter was a long
step,—So far Stellan had not yet come, in spite of his well arranged
stage management and press advertisement. It was therefore with
measured dignity and a rather chilly expression that the Lord of
Trefvinge received him. And this occurred in the largest and most
splendid room of the castle, the great tapestry hall, which might well
have subdued even the boldest.
“Good-morning, Captain Selamb! My daughter is just dressing for
a ride with Baron von Strelert.”
“Yes, I heard that Manne had promised to come for a few days,”
answered Stellan in a light, almost insolent, tone. He read the
master of the house quite clearly, so clearly indeed that he
sometimes was afraid of not being able to keep a straight face.
Count Lähnfeldt was a very short man, in spite of the high heels
and extra soles on his shoes. He had an extremely neat face. His
words and his gestures were dignified, slow, and heraldically stiff.
But his eyes showed a continual nervousness, the nervousness of
the actor: “Do I make an impression—do you believe in me?” they
seemed to say.
Alas, nobody believed at all in him. People made most impudent
fun of him behind his back. He was generally called Count Loanfeldt,
and the reason was known to everybody.
The owner of Trefvinge was the son of an unmarried actress, but
whilst still very young he married the extremely wealthy widow of a
brewer, who died when his only daughter was born. The title of
Count was Portuguese. He had received it from King Charles, of the
house of Bragança, after having on a certain delicate occasion lent
him a hundred thousand crowns. This happened in Vienna whilst the
monarch was still only Crown Prince. Lähnfeldt, who had quite early
begun to imagine that his unknown father was a high-born
aristocrat, did everything to correct the unjust fate that had given
him a plebeian name, and when travelling he always used to try to
come into contact with royalty. And now he had managed to procure
rooms at the hotel adjoining the suite of the Crown Prince, Charles.
It struck him at once that the Crown Prince received a lot of people
who did not behave with becoming reverence at all. When he
questioned the porters, he shrugged his shoulders. The callers were
simply creditors. A gentleman of his Highness’ suite had gambled
away all the funds, and for some incomprehensible reason no money
arrived from home. He could not even pay his hotel bill.
Herman Bogislaus Lähnfeldt needed no more. He decided to
intervene at once for the salvation of the monarchic principle.
Bowing, he stepped up to the Crown Prince Charles and begged that
an old admirer of the house of Bragança might be allowed to hand
over to its present august representative an humble gift of a
hundred thousand crowns to be used for some charitable purpose.
The Crown Prince received the cheque with an amazed but
gracious smile.
About half a year later, Lähnfeldt received two large letters with
seals of State and Portuguese stamps. One contained an account of
the use to which his money had been put in an Orphanage in Lisbon,
the other letter contained the letters patent of his title.
He rushed down to Lisbon and threw himself at the feet of the
newly crowned King Charles. Then he rushed home again to buy an
estate as a background to his new dignity. And now he sat here at
Trefvinge, the ancestral home of the Oxenstierna family, and tried to
fill out the magnificent frame.
Such was Count Lähnfeldt’s history.
He had one great grief. The title was not hereditary. Already in
Elvira’s childhood he would look at the little plebeian with
compassion and melancholy. And when she grew up his only hope
lay in a suitable marriage for her.
“You must marry, Elvira,” he preached. “If you don’t marry you will
remain plain ‘Miss’ all your life.”
But it had not pleased Miss Elvira to marry yet. She was already
nearing thirty. Some suitors she had turned away herself, others had
withdrawn of their own accord, to the great astonishment of all but
the initiated.
Neither Stellan nor Manne belonged to the initiated. But both were
in such miserable circumstances. And they knew only too well each
other’s business at Trefvinge. All the same, they kept countenance
when they met out in the sunshine on the steps, at least Stellan did.
Manne was not quite so happy. The poor boy had of course arrived
first at the mill but it hurt him all the same to stand in the way of an
old friend. So he cast timid and remorseful glances at Stellan when
he helped Miss Elvira into the saddle.
She, on the other hand, seemed in excellent spirits this morning.
“Come on, Captain Selamb,” she said with a little side-glance at
her father. “Cæsar II is free. We are riding towards the sand pit.”
Stellan’s voice sounded cold:
“Thank you, but I am too much handicapped.”
She shrugged her shoulders and gave her black mare a light cut
with her whip. But Manne sat still and looked as if he could not get
going. Stellan was cruel enough to wave a glove, with a meaning
wink, to remind his friend of his faithlessness to “The Glove.”
Never before in his life had Manne looked so lost on horseback. He
suddenly set his bay to a gallop and followed his companion, who
was already disappearing through the park gates.
Stellan had settled on an entirely different plan of action to
Manne. He had made up his mind to be indifferent to Miss Lähnfeldt
so as to excite her spirit of contradiction, and to try to win the father
instead. For that reason he at once began to display immense
interest in the history of the castle. Faithfully and indefatigably he
accompanied the Count, as he rattled out a whole armoury of dates,
and roamed around like a parody of greatness in the many splendid
apartments. Patiently he sat for hours in the library amongst
peerages, pedigrees, genealogies, and Gotha-almanacs and listened
to the anecdotes of the lord of the castle. Count Lähnfeldt knew
every anecdote concerning a prince.... Then they walked outside and
down the steps, and Stellan duly admired the Oxenstierna coat of
arms cut in sandstone over the proud Renaissance doorway. He sat
with a becoming thrill of reverence on the seat round the giant oak
which Axel Oxenstierna had planted with his own hand and in the
shadow of which the Count, like the previous owners of the castle,
used to sit and marvel at “the small amount of wisdom that the
world is ruled with” and grow horrified at the tendency of the time
to level us all “like pigs’ feet.” Stellan was surprised at himself that
he need not sit silent at the feast but was also able to say something
about Oxenstierna. The moment before he had not suspected his
knowledge. It had been the same at school long ago when lazy
Stellan always knew an answer after all. Perhaps it was some kind of
thought reading....
The Count by and by worked himself up into stammering
enthusiasm. Oxenstierna! Oxenstierna! It sounded as if he were
speaking of his own ancestor. Well, who knows if he had not some
such thoughts. Then he took Stellan’s arm and drew him to the small
Chapel, of which he had the patronage, whose white-washed gable
shone under the yellowing birches on the other side of the garden
wall. He took the rather large key of the crypt out of a case he
always carried in his pocket, and staggered in front of Stellan down
into the dusky vault. And over the richly carved oak and copper
coffins he mumbled reverently a string of names of which most were
well known in history, and stopped at last in front of a gigantic open
coffin of porphyry, the lid of which was leaning against the wall.
“This,” he said, caressing the carvings on the lid, which depicted a
bear with a little child on its back, “is the Lähnfeldt coat of arms.
And here I shall one day rest my weary bones.”
You could hear from his tone that death had lost its bitterness for
him since he would enter such distinguished company.
After all this the Count was a little tired, and, excusing himself on
the plea of important correspondence, he went up to take his little
snooze before dinner, just like any ordinary human being.
Stellan wandered about alone with his hands behind his back in
the stately park of Trefvinge. Around him this September day he
heard from the high tree tops a sharp sound, as from an over-tense
string. In the clear transparent air a dry leaf floated slowly down to
his feet with a fine even motion. It was a motion as symmetrical and
regular as the shape of the leaf itself. He pondered for a moment on
the static problem. Then it struck him that even in his youth he had
felt irritated that wealth and secure luxury should chase shadows
and idle fancies in order to obtain a little excitement. He suddenly
shivered with a light but penetrating dread. He realised here in the
silence of the park in a way that he had never done before, that he,
Stellan Selamb, was on the verge of ruin. “If I don’t succeed in this,”
he thought, “there is no other way out than the revolver....”
Stellan stood there with twitching face and a queer helpless
movement of his right hand. What was the matter, were his nerves
already giving way? “Well, of course, one does not lead a life like
mine without being punished for it,” he muttered. “Strange that it
comes like this in the stillness and not in the balloon out there over
the sea, for instance....”
He took a few steps but halted again suddenly amongst the sunny
patches on the hard dry road. The thought that she, Elvira Lähnfeldt,
was now riding by Manne’s side irritated him like a noxious poison.
He saw her suddenly in the light of anxious and trembling hope. He
saw her as she had sat in the sunshine, light, straight, elegant on
her nervous jet black horse. Her assurance and her recklessness
were thorns in his side. For a moment he found her really beautiful
and desirable in her cool refinement. The brittle, overstrung
elements in her character seemed to him to be in wonderful
harmony with the beautiful autumn day. Fancy if he might lead a
calm and exquisite life together with this child of luxury and taste
with her the joys of a satisfied ambition! Even the thought of her
secret infirmity seemed to him at this moment an additional
refinement, a promise of a painless, concentrated life of pleasure.
Stellan pulled himself up as if at a word of command. “Damn it, I
am not falling in love, I hope,” he thought. But the next moment his
thought was: “No, dash it all, the fact is I have not slept for several
nights!” He struck his leg with his stick: “Keep cool! If you get
sentimental, all is lost. She is nothing but a whimsical and obstinate
child and you must conquer her through her whims and her
obstinacy.”
For a moment Stellan felt his head swim and the ground give way
under his feet. This made him doubly reckless. Partly from a kind of
cruel sensuousness and partly to give himself courage, he began in
imagination to undress her and lay bare her infirmity. “It is not the
softest women who are the weakest,” he thought. “With all her
arrogance and all her sport she is really a poor, delicate, and
enfeebled creature. She is suffering from the disease of wealth, the
sapping of strength of those who do not need to do anything for
their living. And she can’t have children. The future is cut out of her
body. Whence can she derive any strong instincts difficult to
conquer? No, she is really a very easy victim to one who is wise and
reckless....”
Stellan already smiled to himself. “No, my dear Manne, you are
too good natured,” he thought. “Even from behind one can see when
you are lying....”
Then he hurried in to dress for dinner.
The evening of that same day, Stellan and Manne were standing
out in the moonlight on the narrow balcony that ran outside their
two rooms on the first floor. The host and hostess had already
withdrawn and everything was quiet in the big house behind them.
Stellan scrutinized his old friend. Manne’s face was pale over his
big white shirt front. There was really not much left of the old
irrepressible Manne von Strelert.
“The old man isn’t exactly exciting,” Stellan mumbled, pointing
with his thumb towards the house. Manne answered with unusual
vehemence:
“Why can’t he realize that he is behind the times with his
aristocracy! That sort of thing originated in the middle ages, damn it
all! And how he chews my poor ‘Baron.’ Heavens above, it makes me
wish I were a grocer.”
Stellan was amazed that Manne should get excited so easily. He
felt a strange cold satisfaction and continued pitilessly:
“My dear Manne, you have not much respect for your prospective
father-in-law.”
Manne started as if he had been struck. He was unguarded and
had no repartee ready. He put his hand on Stellan’s arm and
mumbled almost tenderly:
“Stellan ... don’t let us talk about that any more....”
For a moment they stood silent, looking out into the blue
shimmering night which was full of small fluttering creatures. Below
them the apple trees in the orchard were bowed down with fruit.
Further away a thin veil of mist lay over a meadow in which were
some grazing cows whose white spots shone like newly washed
clothes in the moonlight. And beyond the bright edging of yellow
reeds the bay of Lake Mälar lay dreaming with a narrow silver streak
upon it that leapt into life when a breeze passed. Still further there
were reflections of the moon constantly appearing and disappearing
where the water seemed to repose as calm as a mirror but was all
the same stirred by a faint ground swell.
The whole atmosphere seemed full of the delicious coolness of
rich ripe fruits, and full of the peace and calm of possession and
ownership.
“Fancy that there are people who lead quiet and happy lives,”
mumbled Manne.
Stellan imitated his tone:
“Yes, why are we not innocent vegetarians, feeding on carrots and
staring at the moon.... Nonsense! Manne! Nonsense! There are
people who lead dull lives, and people who don’t. Let us as long as
possible belong to the latter! Now is the hour of lovers and
gamblers.”
He suddenly made a gesture embracing the castles and the acres
of Trefvinge.
“Look here, Manne, all this that seems so safe and still—shall we
cut through the pack for it tonight?”
When these words escaped Stellan he had still no second thought.
It looked as if Manne did not at first understand what he meant. He
remained silent for a long time, but then he mumbled too:
“Yes. Let’s cut for it.”
There was a strange dull note of relief in his voice. It was as if his
friend had relieved him of the burden of willing and choosing for
himself.
Thoughts flashed quick as lightning through Stellan’s brain. It was
now that he began to feel a strange assurance that he would
somehow win. His words came quick, like rapier thrusts:
“I have an unopened pack of cards with me. We will simply back
our luck. He who draws the highest heart stays. The other leaves
early tomorrow morning on the clear understanding that he does not
intend to come back.”
Manne was paler than ever and had a vacant look in his eyes:
“Right you are!”
Stellan ran inside to his room and searched for the cards. The
lamp was not lit. He had to search for a long time in his suit case.
Meanwhile he was thinking swift as lightning. “Manne must not draw
the highest heart,” he thought, “No, not this time. For then all is over
with me....” The shiver and the dizziness he had felt in the park
returned. “No, Manne must not draw the highest card....” At last he
found the pack of cards, picked it up with trembling hands and
pressed his thumb nail hard into the edge of the ace of hearts as it
peeped out through the round hole in the wrapper. There must be
quite a noticeable mark on the other side ... Stellan had not
premeditated this, had never before done anything of the kind. He
felt something approaching surprise.
“Well, that is what we Selambs do,” he muttered to himself.
Quickly he went back to Manne’s room and flung the pack on the
table:
“You open the pack and shuffle!”
Manne took up the pack and shuffled slowly, almost indifferently.
Stellan sat down opposite him.
“We must avoid misunderstandings,” he said. “The two is lowest
and the ace highest, isn’t that so?”
“Good!”
With a gesture indicative of long practice Manne spread the cards
out fan-like on the polished surface of the mahogany table:
“You draw first, as I shuffled.”
Stellan’s eyes looked searchingly at the fan for the marked card.
No, he could not see it. He must gain time. He opened his cigarette
case:
“Let us smoke a cigarette together, before we draw. It will be the
most exquisite cigarette we ever smoked together. A cigarette with
Fate....”
“All right!”
The cigarettes were finished. Stellan had to draw. Now he saw the
ace on the extreme right. The little mark on the back of the card
was noticeable in a tiny reflection from the lamp. Stellan had a
feeling of being lifted off the floor, of soaring. But he did not dare to
draw the ace at once. That would have looked too strange. He had
to minimize the risk.
“Look here, Manne,” he said, smilingly. “Supposing I draw a low
heart straight off and you draw a club. Then it would be sudden
death. That would be idiotic extravagance with our precious
excitement. We will continue to draw till each of us has at least one
heart and after that the highest wins.”
“All right,” said Manne. His tone had become more and more
obviously indifferent.
Stellan drew the nine of clubs. He saw Manne’s hand hovering
over the cards with cold excitement. But it stopped at the harmless
end and drew the ace of spades.
Next draw. Not even now could Stellan make up his mind to take
the ace of hearts. He drew a card beside it, thinking that Manne, in
obedience to some psychological law, would try his luck at the other
end. He drew the two of clubs.
Manne drew the knave of hearts. A cry escaped him. It sounded
as if he had hurt himself.
Stellan had not drawn a heart yet. Now he had to take it. He felt
strangely frightened. It seemed as if he were about to put his hand
into somebody else’s purse. He felt as if all his fellow officers were
sitting round him staring at his fingers. “No, damn it, what am I
really doing,” he thought. Then he pulled himself together. “Bah—
you must throw out ballast—keep afloat. And nobody knows!”
He turned up the ace.
Manne leaned back in his chair with a little tired smile, a smile of
sad, weary, pathetic relief.
“Congratulations,” he muttered, “congratulations. Fate was right
that time, perfectly right.”
They smoked for a moment in silence. Stellan wanted to say
something encouraging but could not get the words over his lips. It
was Manne who took up the thread again:
“I say, Stellan, don’t you sometimes shudder at life ... and
yourself?”
“When some excitement is over, I sometimes feel discomfort....”
Manne’s voice sounded childishly pleading:
“Yes, but Stellan, have you never experienced moments when you
really shudder at yourself ... at all the miserable and damnable
things one has done?”
“No, I have never permitted myself that luxury.”
Marine looked at him with a mien in which for the first time there
was something of a stranger.
“You are a bit of a barbarian after all, my dear Stellan,” he
mumbled, “You have a queer insensibility on which to fall back. I am
damned if I know how it is but I have never been able to will
anything when I have been with you. But I will tell you this much, I
should never have entered into this folly if I had not made up my
mind beforehand to escape from it all. It’s disquieting to play for a
living human being.... No, away with it all....”
“My dear Manne, I can’t help it if you only drew a knave of
hearts,” mumbled Stellan coldly.
“No, old boy, of course you can’t, but that’s not the point. I have
felt the whole time that this was impossible. You don’t understand
what a human being can feel like, Stellan. I played only because you
proposed it. For twenty years I have not done anything else but
what you proposed. I am a wretch. And you, Stellan, what are you?
Imagine! I have known you for so long and yet I don’t even know
that. It’s strange, but tonight ... I almost seem to catch a glimpse of
you, after all. Yes, you are one of those who succeed in everything.
You remain a Selamb. And all the same I am somehow sorry for you,
Stellan. Yes, I feel damned sorry for you, because, you see, there is
something in life that you would never understand if you lived to be
a hundred....”
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like