Programming Voice-controlled IoT Applications with Alexa and Raspberry Pi
- Length: 372 pages
- Edition: 1
- Language: English
- Publication Date: 2023
- ISBN-10: 3895765317
- ISBN-13: 9783895765315
- Sales Rank: #0 (See Top 100 Books)
The book is split into two parts: the first part covers creating Alexa skills and the second part, designing Internet of Things and Smart Home devices using a Raspberry Pi. The first chapters describe the process of Alexa communication, opening an Amazon account and creating a skill for free.
The operation of an Alexa skill and terminology such as utterances, intents, slots, and conversations are explained. Debugging your code, saving user data between sessions, S3 data storage and Dynamo DB database are discussed. In-skill purchasing, enabling users to buy items for your skill as well as certification and publication is outlined. Creating skills using AWS Lambda and ASK CLI is covered, along with the Visual Studio code editor and local debugging.
Also covered is the process of designing skills for visual displays and interactive touch designs using Alexa Presentation Language. 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 methods of sending and receiving MQTT messages between an Alexa device and the Raspberry Pi. Creating a smart home device is described including forming a security profile, linking with Amazon, and writing a Lambda function that gets triggered by an Alexa skill. Device discovery and on/off control is demonstrated. Next, readers discover how to control a smart home Raspberry Pi display from an Alexa skill using Simple Queue Service (SQS) messaging to 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 on a Raspberry Pi. A chapter discusses sending a proactive notification such as a weather 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.
Search… Programming Voice-controlled IoT Applications All rights reserved. Contents About the Author Introduction 1 • Chapter 1 Alexa History and Devices 1.1 Alexa voice service and AWS Lambda 1.2 Pricing 1.3 Alexa skills 1.4 Supported programming languages 1.5 Terminology – Invocation, Utterances, Intents and Slots 1.5.1 Alexa Wake word 1.5.2 Invocation 1.5.3 Utterances 1.5.4 Intents and requests 1.5.5 Slots 1.5.6 Interaction model 1.5.7 Endpoints 1.5.8 Regions 1.6 Skill Sessions 1.7 Session attributes 1.8 Request and response JSON 1.9 Blueprint skills 1.10 Summary 1.11 References 2 • Creating your Amazon Account 2.1 Introduction 2.2 Create your Amazon account 2.3 Your sk 2.4 Hosting 2.5 Summary 3 • Creating an Alexa Skill 3.1 Introduction 3.2 Your first skill 3.2.1 The interaction model 3.2.2 Choose a method 3.2.3 The Invocation Name 3.2.4 The Intents 3.2.5 The code 3.3 Testing your skill 3.4 Skill I/O 3.4.1 Skill request 3.4.2 Skill response 3.4.3 Speech Synthesis Markup Language (SSML) 3.5 Code editing 3.5.1 Edit the HelloWorldIntentHandler code 3.5.2 Add some debug code 3.6 Test your code 3.7 Utility code 3.8 Debugging 3.9 Node.js differences 3.10 Node.js debugging 3.11 Summary 4 • Slots and Dialogs, Saving Session Data 4.1 Introduction 4.2 Slots in action 4.3 Slot skill 4.3.1 Invocation Name 4.4 Skill flow 4.5 Add the intent to our skill 4.6 Evaluate your model 4.6.1 The JSON editor 4.7 Accessing the slot 4.8 The code 4.8.1 Test your skill 4.9 Session attributes - saving slot values 4.9.1 Remember their name 4.10 Dialog delegation 4.11 The Birthday code 4.12 Handling Yes and No intents 4.13 Multiple Yes / No sources 4.14 AMAZON.SearchQuery 4.15 ASK SDK Utilities 4.16 Intent error logging 4.17 Language understanding NLU and Automatic speech recognition ASR 4.18 Summary 5 • S3 Storage and DynamoDB Database 5.1 Introduction 5.2 Local storage 5.3 Persistent attributes, DynamoDB and S3 5.3.1 Code example 5.3.2 DynamoDB database storage 5.4 Request and response interceptors 5.5 DynamoDB 5.6 S3 storage 5.7 Summary 6 • Certification and Publishing 6.1 Introduction 6.2 Adding further languages 6.3 Distribution 6.4 Availability and Beta Testing 6.5 Beta Tester 6.6 Validation 6.7 Submission 6.8 Post Publication 6.9 Analytics 6.10 Summary 6.11 References 7 • Creating Skills with Lambda and ASK CLI 7.1 Introduction 7.1.1 AWS Lambda skill 7.2 ASK CLI 7.3 Visual Studio code 7.4 Local debugging 7.4.1 Add Alexa debugger configuration 7.4.2 Test your Alexa skill in VS code 7.5 Summary 7.6 References 8 • Alexa Presentation Language – APL 8.1 Introduction 8.2 APLA 8.2.1 APLA components 8.3 Datasources 8.4 APLA datasource example 8.5 Adding an APLA reprompt 8.6 Summary 8.7 References 9 • APL Visual Multimodal Responses 9.1 Introduction 9.2 Creating an APL Visual Response 9.3 Visual Components 9.4. APL component example 9.5 Using the Authoring Tool 9.6 Integrating APL and code 9.6.1 Check for screen support 9.7 APL Commands 9.7.1 Standard Commands 9.7.2 Media Commands 9.7.3 User-defined commands 9.7.4 Execute Commands directive 9.8 Responsive components and Alexa Layouts 9.9 Converting Text to speech – using Transformers 9.9.1 Transformer APL design 9.9.2 Operation 9.10 Summary 9.11 References 10 • Alexa In-skill Purchasing (ISP) 10.1 Introduction 10.2 Create your ISP skill 10.3 Accessing your ISP code 10.4 Retrieve in-skill products, get their information and purchase. 10.5 Produce detail and purchase 10.6 Purchase 10.6.1 Failed Purchase 10.6.2 Refunds 10.7 References 11 • Progressive Response - Accessing the Internet 11.1 Introduction 11.2 Steps to Send a Progressive Response 11.3 Progressive response example 11.3.1 Code response 11.4 asyncio, async and await - awaiting a web response 11.5 References 12 • Creating a Raspberry Pi IoT Thing 12.1 Introduction 12.2 Create a Raspberry Pi IoT 12.2.1 a) Create our ‘Thing’ and its certificates 12.2.1 b) Thing’s endpoint 12.2.1 c) Transfer the certificates to your Pi 12.2.2 Create and run the Python code 12.2.3 Send messages to your Pi 12.2.4 Create an Alexa-Hosted Skill 12.2.5 Test the skill 12.3 Add intents to the Alexa skill 12.4 Control the robot 12.5 Add intent handlers to the skill code 12.6 Modify your code 12.6.1 Modify your Pi code - LED 12.6.2 Modify your Pi code - explorerhat 12.7 Test your robot or LED 12.8 Summary 13 • Smart Home Devices 13.1 Introduction 13.2 Alexa Interfaces 13.3 Login with Amazon (LWA) 13.3.1 Create a security profile 13.4 Create your Smart Home Skill 13.5 Create a Lambda function 13.6 Lambda skill code 13.7 Test your Lambda function 13.8 Link the function to the skill 13.9 Configure account linking 13.10 Enable and Link the skill 13.11 Clean up 13.12 Troubleshooting 13.13 Summary 13.14 References 14 • Controlling a smart home raspberry Pi with SQS 14.1 Introduction 14.2 Create an SQS Queue 14.3 Raspberry Pi SQS code 14.4 Create a Smart Home skill 14.5 Create the function 14.6 Create a security profile 14.7 Configure the smart home skill 14.8 Add the function code 14.9 Test the function 14.10 Discover your device 14.11 Test from an Alexa device 14.12 Clean up 14.13 Summary 14.14 References 15 • IoT, Pi and Node-RED 15.1 Introduction 15.2 Prerequisites 15.3 Installation 15.4 Running node-RED 15.5 Node-RED user interface 15.6 First flow design - Hello world 15.7 Hardware I/O 15.7.1 Add an input 15.8 Using the Sense Hat 15.9 Node-RED dashboard 15.10 Sense Hat output 15.11 IoT - Receiving MQTT messages 15.12 Create a new IoT thing for MQTT communication 15.12.1 Subscribe to a topic 15.13 Node-RED IoT Application 15.14 Receiving MQTT messages 15.15 Summary 16 • Proactive Events – Sending Raspberry Pi Alexa Notifications 16.1 Introduction 16.2 The Lambda function 16.3 Send a notification 16.4 Code to get the access token 16.5 Send the notification 16.6 Summary 16.7 References 17 • Raspberry Pi as a Stand-alone Alexa Device 17.1 Introduction 17.2 Raspberry Pi setup 17.3 Procedure 17.3.1 Register your AVS device with Amazon 17.3.2 Download and install the AVS SDK 17.3.3 Run and authorize the sample app 17.4 Use the sample app 17.5 Summary 17.6 References 18 • Conclusion Index
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.