Professional Documents
Culture Documents
Programming
# constants
and gained his MSc at UMIST.
”
T%H:%M:%S.00Z
skill and terminology such as utterances, intents, slots, and conversations After two years working for ICL as
m - % d
are explained. Debugging your code, saving user data between sessions, a design engineer, he returned to
UTC_FORMAT = “ % Y - %
a z o n . c o m / a u t h/o2/token”
m
https://api.a
S3 data storage and Dynamo DB database are discussed. UMIST where he graduated with a
PhD in ‘Design and Development of
Microprocessor Systems’.
TOKEN_URI = “
In-skill purchasing, enabling users to buy items for your skill as well as
s constants
certification and publication is outlined. Creating skills using AWS Lambda
# Token acces
He worked for several years in
and ASK CLI is covered, along with the Visual Studio code editor and technical support and as manager
n t i a l s . k e y [ ‘ CLIENT_ID’]
rede T’]
CLIENT_ID = c ‘CLIENT_SECRE
local debugging. Also covered is the process of designing skills for visual in electronics distribution, working
closely with Intel engineers and
e n t i a l s . k e y [
= cred
displays and interactive touch designs using Alexa Presentation Language.
CLIENT_SECRET
later designing Inmos Transputer
systems.
The second half of the book starts by creating a Raspberry Pi IoT “thing”
to control a robot from your Alexa device. This covers security issues and Having taught electronics at
s_to ken():
methods of sending and receiving MQTT messages between an Alexa Manchester Metropolitan University,
he retired in 2011 but retained
def get_acces
device and the Raspberry Pi.
his interest in electronics and
= {
token_params t_credentials
”,
programming. His other occupations
Creating a smart home device is described including forming a security consist of traveling, walking,
p e ” : “ c l i e n
profile, linking with Amazon, and writing a Lambda function that gets geocaching and spending time on “grant_ty a c t i ve_events”,
e x a : : p r o
“scope”: “al
triggered by an Alexa skill. Device discovery and on/off control is his allotment.
LIENT_ID,
demonstrated.
l i e n t _ i d ” : C
“c
Next, readers discover how to control a smart home Raspberry Pi display
n t _ s e c r e t ” : CLIENT_SECRET
from an Alexa skill using Simple Queue Service (SQS) messaging to “clie
switch the display on and off or change the color.
A node-RED design is discussed from the basic user interface right up to
}
configuring MQTT nodes. MQTT messages sent from a user are displayed Elektor International Media
on a Raspberry Pi. www.elektor.com
token_headers
= {
o n / j s o n ; c h a r set=UTF-8”
”: “applicati
A chapter discusses sending a proactive notification such as a weather “Content-Type
alert from a Raspberry Pi to an Alexa device. The book concludes by
}
explaining how to create Raspberry Pi as a stand-alone Alexa device.
I , h e a d e r s = t oken_headers
s
Dr John Allwork
ts.post(TOKEN
_UR
n s e = r e q u e
respo
● All rights reserved. No part of this book may be reproduced in any material form, including photocopying, or
storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this
publication, without the written permission of the copyright holder except in accordance with the provisions of the
Copyright Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licencing Agency
Ltd., 90 Tottenham Court Road, London, England W1P 9HE. Applications for the copyright holder's permission to
reproduce any part of the publication should be addressed to the publishers.
● Declaration
The Author and Publisher have used their best efforts in ensuring the correctness of the information contained in
this book. They do not assume, and hereby disclaim, any liability to any party for any loss or damage caused by
errors or omissions in this book, whether such errors or omissions result from negligence, accident, or any other
cause.
All the programs given in the book are Copyright of the Author and Elektor International Media. These programs
may only be used for educational purposes. Written permission from the Author or Elektor must be obtained before
any of these programs can be used for commercial purposes.
● F irst edition
© Copyright 2023: Elektor International Media B.V.
Editor: Alina Neacsu
Prepress Production: Jack Jamar | Graphic Design, Maastricht
Elektor is part of EIM, the world's leading source of essential technical information and electronics products for pro
engineers, electronics designers, and the companies seeking to engage them. Each day, our international team develops
and delivers high-quality content - via a variety of media channels (including magazines, video, digital media, and social
media) in several languages - relating to electronics design and DIY electronics. www.elektormagazine.com
●4
Contents
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
●5
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
●6
Contents
4.14 AMAZON.SearchQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.15 ASK SDK Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.16 Intent error logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.17 Language understanding NLU and Automatic speech recognition ASR . . . . . . . . 82
4.18 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
●7
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
●8
Contents
●9
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
● 10
Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
● 11
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
Dr. John Allwork was born in 1950 in Kent, England and became interested in electronics
and engineering at school. He went to Sheffield University on their BEng Electrical and
Electronic Engineering course. There he developed an interest in computers and continu-
ed his education on an MSc course in Digital Electronics and Communication at UMIST.
After two years working for ICL as a design, commissioning and test Engineer he returned
to UMIST where he graduated with a Ph.D. in ‘Design and Development of Microprocessor
Systems’.
He worked for several years in technical support and as a manager in electronics distribu-
tion, working closely with Intel Application Engineers and followed this with design work
using the Inmos Transputer systems.
Having taught at Manchester Metropolitan University he retired in 2011 but has kept up
his interest in electronics and programming as well as his other occupation of travelling,
walking, geocaching and spending time on his allotment.
● 12
Introduction
This book is aimed at anyone who wants to learn about programming for Alexa devices
and extending that to Smart Home devices and controlling hardware, in particular the
Raspberry Pi.
It covers Alexa programming concepts from the basic concepts of Alexa Voice service, the
interaction model and the skill code which runs on AWS (Amazon Web Services) Lambda.
It takes the reader through all stages of creating skills to certification and publishing,
including writing skills that involve in-skill purchasing. It discusses different ways of crea-
ting skills, then moves on to creating visual skills using APL (Alexa Presentation Langua-
ge) for screen-based Alexa devices.
The book then moves on to cover different ways of controlling hardware including the
Internet of Things and Smart Home devices. There are interfaces with the Raspberry Pi
using MQTT and SQS communication, displaying on the Pi using Node-RED and Python
code.
Although mostly based on Python, Node.js examples or links are also provided. The full
code is provided in a separate document.
Please note that Alexa skill development, the developer console and APL versions have
changed since writing this book, so please bear with the author if there are slight diffe-
rences.
I do not pretend to know all there is about Alexa and Raspberry Pi programming – they
seem to advance faster than I can follow! I have a background in hardware and software
design. I am sure that there are areas where some programmers may be offended by my
code and that there may be better ways to write it, but I have written and tried all the
examples and know they work. I hope the examples will spur you on to find solutions to
your own problems. Should you need more information then please try the online help
and the Raspberry Pi or Alexa forums: alexa.design/slack is particularly good. There are
plenty of programmers out there willing to help solve your problems, often extremely
quickly; certainly faster than I would get back to you!
I wish to thank my friends for encouraging me, especially Dr. Hugh Frost, Andy Marsh
and Dr. John Nichols; the Alexa staff: in particular Jeff Nunn, Jeff Blankenburg and Ryan J
Lowe; helpers on the alexa.design/slack group, including Andy Whitworth; subscribers of
my YouTube and GitHub channels who have made encouraging comments; and the many
anonymous people on the internet, forums, blogs and websites who have answered many
questions, not just my own – keep up the good work. Not least of all I would like to thank
my wife Penny, for supporting me throughout.
● 13
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
In 2017, Amazon released a combination of the Dot and Show, called the Echo Spot. In
the same year, the Echo Show was released and featured a slanted, 7-inch touchscreen,
camera and speaker. This later changed to a 10-inch screen (Echo Show 10), and more
recently, added a 360-rotating display.
The Echo Show 5 came in 2019, (2nd gen in 2021), as well as Echo Show 8 and an Echo
Show 15 in 2021 designed for wall mounting.
There are other devices too, including the Button, Flex, Input, Look and recently the Astro
robot.
Here are some of my devices (not including smart devices). From the top: Echo Show 8,
Fire TV stick, Echo Auto, my original Echo dot, and the Echo Spot.
● 14
Chapter 1 ● Alexa History and Devices
Even though many devices have a screen, you should always design for ‘voice first’.
The interaction model is what your users say and how they communicate with your skill.
AWS Lambda is a serverless, event-driven computing service that lets you run your code.
Lambda can be triggered by many AWS services and you only pay for what you use.
When a user interacts with an Echo device, AVS sends a request to the skill which is run-
ning on AWS Lambda. The skill replies with a response that is turned into a speech and/
or visual response back to the user.
1.2 Pricing
Although there are charges for AWS Lambda, the AWS Lambda free tier includes one
million free requests per month and 400,000 GB-seconds of compute time per month, as
well as 500 Mb storage. As you can see, this is more than enough for a beginner. For more
information, see https://aws.amazon.com/lambda/pricing/
For developers whose skills use more than this, Amazon provides Promotional Credits
which reward those who build cloud-hosted applications, software, or tools for sustaina-
bility-related work.
For FAQ see reference 1.
● 15
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
We’ll be concentrating on Custom skills. Blueprint pre-built skills are also available and
easy to develop but have reduced options for user experience. We’ll also study smart
home skills, of course.
1.5.2 Invocation
The ‘invocation’ is the phrase used to trigger your skill, e.g.: ‘Alexa, open Johns’ weather
skill’ or ‘Alexa, launch my cooking skill’.
1.5.3 Utterances
Utterances are the phrases that your user says to make a request. There can be many
ways to achieve the same result, e.g.: What’s the time? What’s the time now? What time
is it? – you will have to think of as many possible ways that your user can interact with
your skill. Nevertheless, Alexa will build your model and try to find similar utterances.
All the possible ways to do this can be difficult to describe (considering, for instance, how
many different ways and types of pizza someone might order), so Amazon has recently
announced Alexa Conversations to help with this. For more information, see reference 3.
● 16
Chapter 1 ● Alexa History and Devices
• Built-in Intents
- Standard built-in intents: These are provided by default by Amazon that every skill
must have, e.g.: AMAZON.StopIntent, AMAZON.CancelIntent, AMAZON.Fallback-
Intent, etc. and include: AMAZON.YesIntent, and AMAZON.NoIntent, intents for
screen control (e.g., scroll up/ down/ left / right) and media intents (pause, repeat,
resume), and also an AMAZON.SendToPhoneIntent. You can see these when you
add an intent, and select “Use an existing intent from Alexa’s built-in library”
- The Alexa Skills Kit also provides a library of specific built-in intents and includes
intents such as Actor intents, Books, Calendar, LocalBusiness, Music, TV, Series,
WeatherForecast, etc.
These intend to add functionality to your skill without you having to provide any sample
utterances. For example, the WeatherForecast includes a search action (What is), an ob-
ject (WeatherForecast), location (London) and date (tomorrow) .
We won’t cover them in this book, see:
https://developer.amazon.com/en-US/docs/alexa/custom-skills/built-in-intent-library.html
• Custom Intents
• A Launch request that runs when our skill is invoked (as a result of the user saying,
‘Alexa open …’ or ‘Alexa, launch ...’).
• An Intent request which contains the intent name and variables passed as slot values.
• A SessionEnded request, which occurs when the user exits the skill, or there is an
unmatched user’s response (although you may be able to trap this out with AMAZON.
FallbackIntent).
This information is all packaged and sent as a request (and returned as a response) as a
JSON file. We’ll look at the JSON code later.
1.5.5 Slots
A slot is a variable that contains information that is passed to an intent. The user might
say ‘What’s the time in London’. Here ‘London’ (or Paris or Rome) is passed as a slot
variable to the intent code.
● 17
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
Amazon provides built-in slot types, such as numbers, dates and times, as well as built-
in list types such as actors, colors, first names, etc. In the previous example, we could use
AMAZON.GB_CITY which provides recognition of over 15,000 UK and world-wide cities
used by UK speakers.
However, some of these slots are being deprecated (including AMAZON.GB_CITY in favour
of AMAZON.CITY), so check. The full list is covered at ‘List Slot Types:
https://developer.amazon.com/en-US/docs/alexa/custom-skills/slot-type-reference.html#list-slot-types
Developers can create custom slots for variables that are specific to their skill.
When we define our utterances, slots are shown in curly braces: {city}, e.g.:
Example:
Intent GetTimeIntent
Utterance What is the time in
Slot {city}
The GetTimeIntent will trigger a function in your skill (which you might sensibly call Get-
TimeIntentFunction).
Slots are used to pass data from your VUI (voice user interface) to your program. As an
example, we might have an Alexa skill that asks for your name.
● 18
Chapter 1 ● Alexa History and Devices
At this point, the slot data is lost unless you save it. You can save data in a temporary
folder but more often data is stored in session attributes, you will find out later.
1.5.7 Endpoints
The endpoint is where your code is hosted. You can choose an Amazon-hosted, AWS
Lambda ARN (Amazon Resource Name) site or host it yourself on an HTTPS site that you
manage.
If you choose an AWS site, it will give you an ID beginning arn:aws:lambda and look
like: arn:aws:lambda:<region>:function:<functionID>. You skill also has an ID looking
something like this: amzn1.ask.skill.a0093469-4a50-4428-82e6-abcde990fgh3.
1.5.8 Regions
If using an AWS-hosted site, you should host your code in a region near to your user.
We’ll see that there are lots of regions, but for some skills currently only North Virginia
is available.
If the shouldEndSession parameter is ‘true’ the skill terminates, otherwise, the session
remains open and expects the user to respond. If no user input occurs, a reprompt is
sent if included in the code. If the user still doesn’t respond (after about 8 seconds), the
session ends 4.
Skill connections and progressive responses may override these rules. For example, if
a skill has to get further information from another source, e.g., when your taxi will be
available, or pizza delivered.
● 19
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
The basic JSON request contains information on the active session, the context, the sys-
tem information on the application (ID), user, deviceID, and the request itself:
{
“version”: “1.0”,
“session”: {
( ..session parameters)
}
“context”: {
( ..information on the Alexa device)
}
“System”: {
…
“request”: {
“type”: “IntentRequest”,
“requestId”: “amzn1.echo-api.request.745d…9a”,
“locale”: “en-GB”,
“timestamp”: “2022-04-14T09:27:01Z”,
“intent”: {
“name”: “HelloWorldIntent”,
“confirmationStatus”: “NONE”
}
}
The reply JSON contains is the response speech and reprompt, as well as the state
of the EndSession and session attributes.
{
“body”: {
“version”: “1.0”,
“response”: {
“outputSpeech”: {
“type”: “SSML”,
“ssml”: “<speak>Welcome, you can say Hello or Help.</speak>”
},
“reprompt”: {
“outputSpeech”: {
“type”: “SSML”,
“ssml”: “<speak>Welcome, you can say Hello or Help.</speak>”
}
},
● 20
Chapter 1 ● Alexa History and Devices
“shouldEndSession”: false,
“type”: “_DEFAULT_RESPONSE”
},
“sessionAttributes”: {},
“userAgent”: “ask-python/1.11.0 Python/3.7.12”
}
}
The response can get more complicated if there is a dialog session occurring (i.e., if the
program hasn’t enough information to complete the intent request and has to ask for
more).
We’ll look at the information passed in the JSON request and response and how to extract
it in a later chapter.
The current categories are: At home, Kids recommended, Learning and knowledge, Fun
and Games, Storyteller, Greetings and Occasions, Communities and Organizations, and
Business 6. We won’t cover them here.
● 21
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
1.10 Summary
We’ve seen how the Alexa devices have developed from the original voice-only device to
screen-based and robot devices, how the Alexa Voice service works and looked at termin-
ology – Invocation, Utterances, Intents and Slots. Finally, we looked at a skill session and
how data is passed and saved during a session and between sessions.
In the next chapter, we’ll see how to set up an Alexa account before moving on to our
first Alexa skill.
1.11 References:
1. https://aws.amazon.com/lambda/faqs/
2. https://developer.amazon.com/en-US/docs/alexa/ask-overviews/list-of-skills.html
3. https://www.youtube.com/watch?v=1nYfRvg976E
4. https://developer.amazon.com/en-US/docs/alexa/custom-skills/
manage-skill-session-and-session-attributes.html
5. https://www.json.org/json-en.html
6. https://blueprints.amazon.com
● 22
Chapter 2 ● Creating your Amazon Account
2.1 Introduction
There are three ways to create an Alexa Skill.
1. Using Alexa-Hosted Skill – this is most probably the easiest way. You don’t need
an AWS account – you can just get started.
2. Using AWS Lambda and the Developer Console.
3. Using an IDE (such as Visual Studio code) and ASK CLI (Alexa Skills Kit and Com-
mand Line Interpreter).
We’ll use an Alexa-Hosted skill where we can. It provides most of the requirements we
need including extra storage (S3) and a database (DynamoDB). We’ll study these in a
later chapter.
● 23
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
Complete the form and create your account. You may have to authenticate it with an OTP.
You can now provide payment information, user roles, etc., or leave until later. If you
want to earn money from In Skill Purchases, you will have to complete this.
● 24
Chapter 2 ● Creating your Amazon Account
We will be using the Alexa Skills Kit but note the other items here.
• Alexa Voice Service (AVS) is used to integrate Alexa features and functions into a
product (see chapter 17).
• Amazon Appstore is an app store for Android and provides apps for Fire Tablets.
• Amazon Dash console enables you to manage Amazon dash buttons.
• Amazon GameOn is for mobile gamers to share their experiences (high scores, tips,
tricks, etc.) and to participate in challenges.
• Login with Amazon (LWA) is used to authenticate users using their Amazon accounts.
You need this if you create any smart home devices.
● 25
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
2.4 Hosting
Click on the Hosting tab to see what you’re allowed to access.
You’ll find the storage and data transfer more than enough for now.
● 26
Chapter 2 ● Creating your Amazon Account
2.5 Summary
In this chapter, we saw the different ways of creating and Alexa skill, created our develo-
per account, and saw how to start an Alexa-Hosted skill.
● 27
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
3.1 Introduction
In the last chapter, we saw how to start an Alexa-Hosted Skill. This provides access to
three AWS Lambda endpoints, an S3 bucket for storage and access to a DynamoDB data-
base. We’ll discuss these in later chapters.
In the next screen, you’re asked for a skill name, the locale (language and location) for
your skill, and if you want more than one locale, to sync them. This will link all the utte-
rances. The user interface has changed slightly since originally writing this chapter, but
the process is the same.
● 28
Chapter 3 ● Creating an Alexa Skill
There are rules as to what names you can give your skill. It must be at least two charac-
ters and less than fifty, and brand names are only allowed if you show proof of rights.
When you publish your skill, these will be checked.
It’s sensible to give your skill a two- or three-word name. Try ‘<your name> first skill’.
I’ve used John’s first demo skill.
● 29
Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
In the top right-hand corner, you can select the hosting region. It’s sensible to select one
nearest to you.
Click ‘Create skill’. The next screen provides some templates. There are more Node.js
templates than Python. Some provide examples of intents, data persistence and perso-
nalization. Choose ‘Start from scratch’ and ‘Continue with Template’.
● 30
Chapter 3 ● Creating an Alexa Skill
Your Alexa skill will be created. It takes about a minute and then you’re taken to the de-
veloper console build tab.
The first thing you notice is the video showing you how to build an Alexa Skill. You can
view this now if you want to.
At the top left is your skill name. To the left of this, you can return to your skill list. To the
right, you can move between the build tab (currently displayed), the Code and Test tabs
which we’ll look at soon and the Distribution, Certification and Analytics tabs which are
used when publishing the skill.
● 31
Another random document with
no related content on Scribd:
“Tittered the way he does and congratulated me on the good job I
had done. He’s a venomous old snake, but I don’t see that he can do
us any harm. There’s nothing left to do now but the detail work of
putting in the ditches.”
They talked for a few minutes about the irrigation project. The
engineer did not betray the least self-consciousness, but his mind,
too, was running on the last time he had seen Betty and the break
between them.
Reed was called away by one of the men to look at a sick horse.
Merrick’s steady gaze at once challenged Betty. “I got your letter.”
She was a good deal less composed than he. It disconcerted her to
know that she was blushing. That was a silly way to do, she told
herself. It annoyed her to give an exhibition of gaucherie.
“Yes,” she murmured.
“I’ve come to the conclusion that we made a mistake,” he said. “We
rushed into a decision too hastily.”
“Yes,” Betty agreed.
“You’re young. I hadn’t given enough consideration to that. Shall we
forget our differences and be as we were, Betty?”
“You don’t mean—be engaged?”
“That’s exactly what I mean.”
“Oh, Justin, I can’t. I thought you meant we’d made a mistake in ever
being engaged. We did. We’re not suited to each other.”
“I don’t agree with you. Your letter convinced me that we are.”
“I didn’t mean it that way at all,” she said unhappily. “We’re not,
Justin. Not a bit. I’m too—too kinda wild for you. You don’t want a
wife like me. If you knew, you wouldn’t want me a bit.”
“I’m the best judge of that,” he answered, smiling a little.
“But you don’t. I’d always be troubling you with my crazy ways.”
“No. It’s just that you’re young,” he insisted.
“It isn’t. I’m born that way. I’ll always be like that. Besides—” She
stopped, searching for a way to put it gently. “Besides, I’d want a
husband—if I ever marry at all—who needs me, who has to have
me, who can’t get along without me.”
“I need you,” he said.
“Oh no, you don’t. Not really. You think you do, maybe, but not in the
way I mean. You’re strong—self-sufficient. Please, I don’t mean it in
an uncomplimentary way. But you are big, you know. A wife would
have to fit into you—be just a—an important detail of your life. I
couldn’t do that. I’ve got to be everything to a man—help him—talk
over his difficulties with him—be just the biggest thing in the world to
him. I couldn’t really do anything for you. You’re complete. You don’t
need anything done for you. With or without me, you’re going to be
awf’ly successful. Oh, I know it sounds silly, but it isn’t.”
“Do you mean you like me less because I’m reliable and efficient and
—well, I take your own word—on the road to success? Would you
want to marry an irresponsible failure?”
The allusion was plain, and she did not like him better for it. None
the less, she recognized that this man, standing there in the quiet
arrogance of strength, had qualities admirable and worthy of great
respect. He was master of himself and, so far as one can be, of his
destinies. The cleft chin, the square jaw, the cold gray eyes so keen
and steady, expressed character, and of a kind that would take him
far. But it was a road she would not travel with him.
“No. But I’d like to know that I was a help to my husband in making
his success. You can’t understand, Justin. I’m not what you want—
not at all. If you saw me as I am, you’d know it. I’d always be
affronting your sense of the fitting thing. The right wife for you is one
who would sit at the head of your table well-dressed, handsome, and
charming, an evidence of your standing in the community. You know
—a gracious hostess, good at teas and bridge and that sort of thing.
You’re really a city man. I’m not a city woman and never shall be.”
To Merrick, clear-eyed in spite of his fondness for her, came a flash
of insight that told him she had been wiser than he. He could never
mould this wildling to his heart’s desire. Some day he would look
back on this episode and smile at it. But he had not reached that
state of philosophy yet. His vanity was still engaged, and more than
that—the last passionate flame of the boy in him that was being
sacrificed to ambition. He craved inordinately the willful charm of this
devastatingly sweet girl with the quick, disturbing eyes. She
represented to him certain values he was deliberately trampling
down, not because they did not seem to him good, but because they
warred with something that he wanted more. He had impossibly
dreamed that she might stay what she was and yet become
something different.
“Are you going to marry Hollister?” he asked.
She might reasonably have told him this was a private matter of her
own. She might have evaded the question. Instead, she told him the
truth.
“I don’t know.”
“Has he asked you?”
“No.”
“But you will if he does.”
“Yes.”
“Knowing what he has been, what he may be again?”
“Knowing what he is,” she corrected.
“Will girls never get over the folly of marrying men to reform them?”
he flung out impatiently.
“I’m not marrying him to reform him—that is, if I’m marrying him at
all, which isn’t likely. He does not need reforming.”
“How do you know he won’t slide back into his vice?” He answered
his own query. “You can’t know. There’s no way of knowing.”
“He won’t.” She said it quietly, with absolute conviction.
Her attitude tremendously irritated him. It was a reflection on all the
copybook virtues that had made him what he was. “Are you waiting
for this tramp, this drug fiend, to make up his mind whether he wants
to marry you or not?”
There was a spark of anger in her eye. She would not modify even
his phrasing. It could stand as he put it.
“Yes.”
“Sheer perversity.”
“Isn’t it?” she agreed, with dangerous sweetness.
He knew he was being punished for having indulged himself, as he
rarely did, in a display of temper. At once he took himself in hand.
“I’m serious about this, Betty. A girl has no right to take chances of
this sort. I grant you Hollister has qualities—splendid ones. But the
damning fact remains.”
Betty relented. He was human. He had cried out because he was
hurt. “I don’t think it remains, Justin. I’m absolutely convinced that it’s
conquered—what you call his vice.”
“What I call his vice! Wouldn’t every sane person call it that?”
“Not if they knew the circumstances. He was left with terrible pains in
the head after he was wounded. They gave him morphine—a lot of
it. He got to depending on it. The habit grew on him. Then he woke
up and shook it off. It’s to his credit rather than the reverse.”
“Even so. There’s a danger that he’ll go back to it.”
And again she denied it, with the certainty of one who does not need
evidence to bulwark an absolute assurance. “No danger at all.”
They were standing in front of the porch. Reed came toward them
from the stable. Both knew that the last word had been said.
Justin Merrick struggled with himself a moment, then held out his
hand. He did not want to be a poor loser.
“The best of luck, Betty,” he said.
Gladness gleamed in the soft eyes through which the eager spirit
seemed to yearn to comfort him.
“You, too, Justin,” she whispered.
CHAPTER XXXV
BIRDS OF A FEATHER
They sat on opposite sides of a table, the food and dishes not yet
cleared away after their supper. A cheap kerosene lamp lit the room
insufficiently. The smoke from a ragged wick had entirely blackened
one side of the glass chimney. One of the men had cunningly utilized
this to throw the face of his companion into the light while his own
remained in shadow. His bleached eyes watched the emotions come
and go as they registered on the twisted, wolfish countenance of this
criminal on the dodge. He was playing on his evil instincts as a
musician does upon the strings of a violin.
“Me, I said right away, soon as I seen you, ‘This Cig’s no quitter; he’ll
go through.’ So I tied up with you. Game, an’ no mollycoddle. Tha’s
how I sized you up.”
“You got me right, Prowers. I’ll say so.”
The little man with the leathery face watched his victim. In the back
of his mind a dreadful thought had lodged and become fixed. He
would use for his purpose this vain and shallow crook, then blot him
out of life before he turned upon him.
“Don’t I know it? Cig ain’t roostin’ up here for his health, I says to
myself. Not none, by jiminy by jinks. He’s got business.”
“Business is right,” agreed the New Yorker. “An’ soon as it’s done, I
ain’t stickin’ around dis dump no more. I’m duckin’ for ’Frisco. But get
it straight, Prowers. I taken all de chances I’m gonna take alone.
See? An’ it’ll cost you two hundred iron men for my share of de job.”
“Not that much, Cig. We’ve both got our reasons for wantin’ to pull
this off. Clint Reed an’ his foreman ain’t exactly friends of yours. You
got yore own account to settle. But I’ll dig up a hundred. That’ll take
you to ’Frisco.”
Cig looked at his mild vis-à-vis sullenly. This harmless-looking old
fellow was his master in villainy, more thorough, more ruthless.
There were times when his bleached eyes became ice-coated, when
the New Yorker had sensed back of them the crouched threat of the
coiled rattlesnake. If he had known what Prowers was thinking now,
he would have shuddered.
“Some generous guy, youse are,” he sneered. “An’ how do I know
youse won’t rap on me—t’row me down when de rubes make de big
holler after de job?”
The old cattleman was at his suave mildest. No malignity showed in
his smile. “I don’t reckon I can give no written guarantee, Cig, but I
never sawed off trouble yet on a fellow takin’ the trail with me. Those
who have rode with me could tell you that.”
The crook from the East was uneasy. He did not know why. His
restlessness drove him to the door of the cabin from which he looked
out upon a cynical moon riding high above the tops of the pines. He
shivered. This bleak world of white appalled his city-cramped spirit. It
had been bad enough in summer. Now it was infinitely worse.
“Looks like there’s a hoodoo on me,” he growled. “It’s de Gawd-
forsaken country that puts a jinx on me. I’m losin’ me noive. Every
job I tackle is a flivver. After dis one, it’s me for de bright lights.”
“That’s right. A getaway for you, pronto.”
“When do we get busy?”
“To-night,” Prowers answered. “Merrick has left two watchmen at the
dam. One of ’em lives at Wild Horse. His wife’s sick. He got a call
half an hour ago sayin’ she was worse. He’s hittin’ the trail for town.”
“Leavin’ one guy on de job. Do we bump him off?”
“Not necessary. A quart of bootleg whiskey reached him this
afternoon. Time we get there, he’ll be dead to the world.”
“You sent de booze?”
“Merrick didn’t,” Prowers answered, with his impish grin.
“Sure he ain’t on de wagon?”
“Dead sure. He can’t leave it alone.”
“Looks like a lead pipe,” Cig admitted. “But de jinx on me—When I
gunned dat Tug Hollister I’d ’a’ swore I got him good. Nothin’ works.”
Jake could not quite forbear sarcasm. “You’d ought to take one o’
these here correspondence courses in efficiency. It’ll be different to-
night, though. I ain’t used to fallin’ down on anything I go after.”
“Meanin’ that I do?” Cig demanded sourly out of the corner of a
drooping mouth.
“Meanin’ you ain’t been lucky lately. Let it go at that.”
Prowers moved about making his preparations. The dynamite and
the fuses already made ready were put in a gunny-sack. The tools
were packed. Beneath his coat Jake put on a gaberdine vest, for it
was possible that the weather might turn cold.
Presently both men were ready. The cattleman blew out the light and
they passed from the cabin into the starry night.
They did not go direct to the dam. Prowers had in him too much of
the fox for that. He would not leave tracks in the snow that might
later take him to the penitentiary. Their footsteps followed the beaten
trail that ran from the cabin to a road meandering down into Paradise
Valley by the line of least resistance.
Half a mile from the point where they struck it, another road
deflected from this one, leading to Merrick’s camp at the Sweetwater
Dam. Into this they turned. The snow had been beaten down by
scores of passing feet. The top crust did not break beneath their
weights, so that no evidence would be left written there as to who
had made this midnight trip of destruction.
Cig’s eye took in the ghostly white hills and he shivered. “Gawd,
what a dump!” he groaned. His vocabulary was as limited as his
emotions. He could never get used to the barren grandeur of the
Rockies. They awed and oppressed him. They were too stark and
clean for him. He struggled with a sense of doom. In cities he never
thought of death, but premonitions of it had several times shaken his
ratlike courage since he had been here. Twice he had dreamed that
he was being buried in these hills and had wakened in a cold sweat
of horror. He made up his mind to “beat it” for the Pacific coast at
once.
They came down into the bowl where the dam was, skirting the edge
of the timber to attract as little attention as possible in case a
watchman should be on his beat. No sign of life disturbed the
stillness. They crept to the tents and made a hurried survey. In one
of them a man lay on a cot asleep. He was fully dressed. His arms
were outflung and he was breathing stertorously. A bottle, one third
full, stood on a small table close to the cot.
“Like I said, dead to the world,” Prowers commented.
He turned away. Cig swiftly snatched the bottle and slipped it inside
his coat. He wanted a drink or two pretty badly, and, like enough,
Prowers wouldn’t let him have them if he knew.
The two men crossed the dam-head to the gates.
“It’ll be here,” the cowman said as he put down the gunny-sack.
Before they set to work, Cig concealed his bottle, but in the course of
the hours that followed he made frequent visits to the spot where he
had hidden it. Since Prowers was neither blind nor a fool he became
aware of what the other was trying to keep from him. He said
nothing. The bulk of the work fell on him. No complaint came from
his lips. There was a curious smile on them, ironic, cruel, and
unhuman.
Cig was in turn gay, talkative, maudlin, and drowsy. His boastings
died away. He propped himself against the cement wall close to the
gates and swayed sleepily. Once or twice he cat-napped for a few
moments.
The old man continued to prepare the charges. Once, watching his
accomplice, he broke into a cackle of mocking mirth, so sinister that
Cig would have shuddered if he had been alive to impressions.
The tramp slid down to a sitting posture.
“Done up. Shleep a li’l’ ’f you don’ min’,” he murmured.
Presently he was in a drunken slumber.
Prowers finished his work and lit the fuses. He looked at the weak
and vicious instrument he had been using, a horrible grin on his
leathery, wrinkled face.
“You comin’ or stayin’?” he asked squeakily.
The doomed man snored.
“Suit yoreself,” the little devil-man said. “Well, if I don’t see you
again, good-bye. I got to be hittin’ the trail right lively.”
He moved briskly along the great wall of the dam, climbed the steps
at the far end, and followed the road leading out of the basin. Once
he turned to look at the deep lake lying placidly behind the rampart
Merrick had built to hold it.
A great flash and roar filled the night. Even where Prowers stood, he
felt the shake of the earth. Masses of torn concrete, of rock and
sand, were flung into the air. The echoes of the explosion died, but
another sound reached the anarchist on the hillside. He listened,
with the diabolical grin on his lips, to a murmur of rushing waters.
The Sweetwater Dam was going out.
“The Flat Tops are liable to be irrigated good an’ plenty, looks like,”
he murmured. “Well, this is no place for sight-seers.”
He shuffled along the trail, the Satanic smile still on his leathery face.
It would have vanished promptly if he had known that a pair of eyes
were looking down on him from the shadow of a pine above the
road.
CHAPTER XXXVI
A STORMY SEA