-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
480 lines (331 loc) · 30.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
<!DOCTYPE html>
<html class="gr__alexa_skill_Development_workshop_github_io"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alexa Skill Development Workshop</title>
<meta name="description" content="Documentation website">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="./Alexa Skill development workshop/css" rel="stylesheet" type="text/css">
<link href="./Alexa Skill development workshop/assets.css" rel="stylesheet" type="text/css">
<link href="./Alexa Skill development workshop/avs.css" rel="stylesheet" type="text/css">
</head>
<body data-gr-c-s-loaded="true">
<nav id="sidebar">
<h1>Alexa Skill Development workshop</h1>
<ul id="links">
<li><a href="#/initial">Setting up alexa on RPI</a>
<ul id="links">
<li><a href="#/1-setup-your-pi">1. Setup Your Pi</a></li>
<li><a href="#/2-get-dev-account">2. Get an Amazon Dev Account</a></li>
<li><a href="#/3-create-device-security-profile">3. Create a Device & Security Profile</a></li>
<li><a href="#/5-copy-credentials">4. Input Your Credentials</a></li>
<li><a href="#/6-run-install-script">5. Run the Install Script</a></li>
<li><a href="#/6-obtain-refresh-token">6. Authorize your Device</a></li>
<li><a href="#/7-talk-to-alexa">7. Talk to Alexa</a></li>
<li><a href="#/9-Modify-your-AFML">8. Customize your Renderer</a></li>
<li><a href="#/8-Add-visuals">9. Change your Home Screen</a></li>
<li><a href="#/10-troubleshoot">10. Troubleshooting Tips</a></li>
</ul>
</li>
<li><a href="#/Skill">Creating a Skill</a>
</li>
</ul>
</nav>
<section id="content"><a class="control hide">Hide all</a><a class="control show">Show all</a>
<article class="active">
<a name="/1-setup-your-pi" ><h2>1. Setup Your Pi</h2></a>
<section class="body" style="display: block;">
<p><strong>Note: you can skip this step if your Pi is already up and running.</strong></p>
<p>Let’s begin by setting up the Pi. The Raspberry Pi 3 board includes -</p>
<ul>
<li>4 USB ports</li>
<li>HDMI port for video output (you’ll be using this to connect to your HDMI monitor)</li>
<li>3.5mm audio jack for sound output (you’ll be using to connect your earphones)</li>
<li>Micro SD card slot</li>
<li>Ethernet port</li>
</ul>
<h3 class="steps" id="assembling-your-pi">Assembling Your Pi</h3>
<ol>
<li>Check that your micro SD card is inserted into the micro SD card slot on your Pi.</li>
<li>Plug in the USB microphone and 3.5mm earbuds.</li>
<li>Connect the keyboard and mouse to the USB ports.</li>
<li>Connect your monitor using the HDMI port.</li>
<li>Insert ethernet cable into the Pi. (not shown in this picture)</li>
</ol>
<p><img src="./Alexa Skill development workshop/AVST-ClosePiSetup.jpg" alt="Pi_setup"></p>
<h3 class="steps" id="booting-your-pi">Booting Your Pi</h3>
<ol>
<li>Plug in the power supply to the micro USB connector on the Pi. You should see a loading screen go through some startup steps before booting to desktop - if you run into any errors, request a new SD micro card to boot the OS from.</li>
<li>Verify ethernet is working by clicking on the connectivity icon in the top right of the tool bar (next to the speaker icon). You should see an up/down arrow pair (not X’d out).</li>
<li>Open a web browser by clicking on the globe icon in the top left toolbar.</li>
</ol>
<h3 class="verify" id="checkpoint-1">Checkpoint 1</h3>
<ol>
<li>Make sure you’re connected to the internet and are able to navigate to <a href="https://developer.amazon.com/">https://developer.amazon.com</a>.</li>
</ol>
</section>
</article>
<article class="">
<a name="/2-get-dev-account" ><h2>2. Get an Amazon Dev Account</h2></a>
<section class="body" style="display: none;">
<h3 class="steps" id="register-for-an-amazon-developer-account">Register for an Amazon Developer Account</h3>
<p>Unless you already have one, go ahead and create a free developer account at <a href="https://developer.amazon.com/login.html">developer.amazon.com</a>. Click “sign in” at the upper right corner and create your account (or log in with your existing credentials). You can review the <strong>AVS Terms and Agreements</strong> <a href="https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/support/terms-and-agreements">here</a>.</p>
<p>Note - you can open these links in a new tab - and if you lose track of the lab manual, please let the team know”</p>
<h3 class="verify" id="checkpoint-2">Checkpoint 2</h3>
<ol>
<li>Once logged in, navigate to <a href="https://developer.amazon.com/avs/home.html#/avs/home">https://developer.amazon.com/avs/home.html#/avs/home</a></li>
</ol>
</section>
</article>
<article class="">
<a name="/3-create-device-security-profile" ><h2>3. Create a Device & Security Profile</h2></a>
<section class="body" style="display: none;">
<h3 id="register-your-prototype-and-create-a-security-profile">Register your prototype and create a security profile</h3>
<p>After you’ve created an Amazon developer account, you’ll need to create a product and security profile. This will enable your software client to connect to AVS.</p>
<p>Log in to <a href="https://developer.amazon.com/login.html">developer.amazon.com</a>. You should be in the Dashboard by default - click the <strong>ALEXA VOICE SERVICE</strong> button in the global navigation to start building products with Alexa built-in. If you don’t see this screen, try this link: <a href="https://developer.amazon.com/avs/home.html#/avs/homes">https://developer.amazon.com/avs/home.html#/avs/homes</a></p>
<p><img src="./Alexa Skill development workshop/1-devportal-alexa-fixed.png" alt="code"></p>
<p>If this is your first time using AVS, you’ll see a welcome screen. Click the <strong>GET STARTED</strong> button, then click the <strong>CREATE PRODUCT</strong> button.</p>
<p>If you’re a returning developer that has already created products in your dashboard, click the blue <strong>CREATE PRODUCT</strong> button at the top right corner of the screen to start building a new device profile.</p>
<h3 id="fill-in-product-information">Fill in product information</h3>
<ol>
<li><em>Product Name</em>: Use <strong>AVS Tutorials Project</strong>.</li>
<li><em>Product ID</em>: Use <strong>PrototypePi.</strong> No spaces are allowed for the <em>Product ID</em> field.</li>
<li>Select <strong>Device with Alexa built-in</strong> for <em>Please Select Your Product Type</em>.
Select <strong>No</strong> for <em>Will your device use a companion app?</em></li>
<li>Choose <strong>Other</strong> for <em>Product Category</em> and write <strong>Prototype</strong> in the <em>(please specify)</em> and <em>Brief product description</em> field.</li>
<li>Select <strong>Hands-free</strong> for <em>How will users interact with your product?</em></li>
<li>Skip the <em>Upload an image</em> step. This is not required for prototyping.</li>
<li>Select <strong>No</strong> for <em>Do you intend to distribute this product commercially?</em></li>
<li>Select <strong>No</strong> for <em>Will your device be used for Alexa for Business?</em></li>
<li>Select <strong>No</strong> for <em>Is this a children’s product or is it otherwise directed to children younger than 13 years old?</em></li>
<li>Click <strong>NEXT</strong> to continue.</li>
</ol>
<h3 id="set-up-your-security-profile">Set up your security profile</h3>
<ol>
<li>
<p>Click <strong>CREATE NEW PROFILE</strong>.</p>
</li>
<li>Enter your own custom <strong>Security Profile Name</strong> and <strong>Security Profile Description</strong> for the following fields - or use the below example names:
<ul>
<li><em>Security Profile Name</em>: <strong>AVS Tutorials Project</strong></li>
<li><em>Security Profile Description</em>: <strong>AVS Tutorials</strong></li>
<li>Click <strong>NEXT</strong>.</li>
</ul>
<p><strong>Security Profile ID</strong> will be generated for you.</p>
</li>
<li>Select <strong>Other devices and platforms</strong> from the <em>Web - Android/Kindle - iOS - Other devices and platforms</em> options in the <strong>Platform Information</strong> section.</li>
</ol>
<p><img src="./Alexa Skill development workshop/1-otherdevicesplatforms-fixed.png" alt="platforms"></p>
<ul>
<li>Write a name for your Client ID here - you can just use <strong>Prototype</strong>.</li>
<li>Click “Generate ID”. You should get a Client ID and an option to download it.</li>
<li>If you’re creating this product profile on your Raspberry Pi, click <strong>Download</strong> to get your credentials onto your AVS prototype. Save the config.json file to your <code class="highlighter-rouge">/home/pi</code> directory. When you click download, it’ll automatically put it in your /home/pi/downloads folder.</li>
<li>Check the box beside <em>I agree to the AVS agreement and the AVS Program Requirements.</em>
<ul>
<li>Click <strong>FINISH</strong>.</li>
</ul>
</li>
</ul>
<li>Select <strong>Web</strong> from the <em>Web - Android/Kindle - iOS - Other devices and platforms</em> options in the <strong>Platform Information</strong> section.</li>
<ul>
<li>add <strong>https://localhost:3000</strong> to Allowed origin.</li>
<li>add <strong>https://localhost:3000/authresponse</strong> to Allowed return.</li>
<li>click <strong>update</strong></li>
</ol>
<p><img src="./Alexa Skill development workshop/WEBEDIT.png" alt="platforms"></p>
<p>Congratulations! You now have access to the Alexa Voice Service APIs. Click OK on the prompt to continue. Your device should now be listed on your <a href="https://developer.amazon.com/avs/home.html#/avs/homes">AVS dashboard</a>.</p>
</section>
</article>
<article class="">
<a name="/5-copy-credentials" ><h2>4. Input Your Credentials</h2></a>
<section class="body" style="display: none;">
<h3 id="download-your-credentials">Download your credentials</h3>
<p>If you didn’t already save it to your Pi when creating your product profile, it’s time to get your <strong>config.json</strong> file onto your client device. Start by opening a browser and logging into your <a href="https://developer.amazon.com/avs/home.html#/avs/home">AVS dashboard</a>. Click on your Product Name, it should be <strong>AVS Tutorials Project</strong> or whatever you named it when creating the product profile.</p>
<p>If you don’t see your dashboard, click on “My Alexa Consoles” in the upper right corner and select “Alexa Built-in Products”.</p>
<p>This will take you to a product menu - on the left side you should see Product Details. Select Security Profile below that and choose <strong>Other devices and platforms</strong> from the <em>Web - Android/Kindle - iOS - Other devices and platforms</em> menu.</p>
<p>When you click the <strong>Download</strong> button on your Security Profile in your web browser, you’ll see a <strong>config.json</strong> file appear in your home/pi/downloads folder. In the file manager, copy this file from the /downloads folder and place it in your home/pi folder as shown in the picture below.</p>
<p><img src="./Alexa Skill development workshop/downloadConfig_large.png" alt="config"></p>
<p>Now that your Raspberry Pi has your own <strong>unique credentials</strong> loaded on it, it’s time to build your SDK.</p>
</section>
</article>
<article class="">
<a name="/6-run-install-script" ><h2>5. Run the Install Script</h2></a>
<section class="body" style="display: none;">
<h3 id="run-the-install-script">Run the Install Script</h3>
<p>You are now ready to run the install script. This will install all dependencies, including the <strong>Wake Word Engine</strong> (WWE) from Sensory. The WWE compares incoming audio to an onboard model of a wake word (<strong>“Alexa”</strong>) and will initiate the transmission of audio to the cloud when triggered. Note that this WWE is provided for <strong>prototyping purposes only</strong> and would need to be licensed for a commercial device. The AVS Device SDK is modular and flexible. When you’re ready to build your product, you can choose any WWE you prefer. Remember that for AVS products, the wake word must be <strong>Alexa</strong> so that your customers aren’t confused about how to interact with your device.</p>
<p>To run the install script, open a <strong>terminal</strong> by clicking on the console window in the Pi’s toolbar in the upper-left corner of the screen (or just use your existing terminal window). Copy and paste the following command into your terminal window and hit return to upgrade apt-get.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt-get upgrade
</code></pre></div></div>
<p>Now, let's get the SDK installation and configuration scripts. Copy and paste the following into your terminal and hit return:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/setup.sh \
wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/genConfig.sh \
wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/pi.sh
</code></pre></div></div>
<p><img src="./Alexa Skill development workshop/updateGIT._TTH_.png" alt="run_script"></p>
<h3>Download your credentials</h3>
<p>If you didn't already save it to your Pi when creating your product profile, it's time to get your config.json file onto your client device. Start by opening a browser and logging into your <a href="https://developer.amazon.com/avs/home.html#/avs/homes">AVS dashboard</a> Click on your Product Name, it should be AVS Tutorials Project or whatever you named it when creating the product profile.</p>
<p>on the left side you should see Product Details. Select Security Profile below that and choose <strong>Other devices and platforms</strong> from the Web - Android/Kindle - iOS - Other devices and platforms menu.
When you click the <strong>Download</strong> button on your Security Profile in your web browser, you'll see a config.json file appear in your home/pi/downloads folder. In the file manager, copy this file from the /downloads folder and place it in your home/pi folder</p>
<h3>Build the AVS Device SDK</h3>
<p>To run the install script, open a <strong>terminal</strong> by clicking on the console window in the Pi’s toolbar in the upper-left corner of the screen (or just use your existing terminal window). You should see a <strong>setup.sh</strong> script in your <em>/home/pi/</em> directory. This pulls the credentials from your <strong>config.json</strong> file to run the install script. To launch the setup script, copy and paste the following command into your terminal window and hit return:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd /home/pi/
sudo bash setup.sh config.json [-s 1234]
</code></pre></div></div>
<p><img src="./Alexa Skill development workshop/run-script._TTH_.png" alt="run_script"></p>
<p>Note that the field in double brackets is the Device Serial Number which will be unique to each instance of the SDK. In this case it's pre-populated with 1234.</p>
<p>Type <strong>“AGREE”</strong> when it prompts you to accept the licensing terms from our third-party libraries. Unless, of course, you disagree!</p>
<p>This will kick off the installation process which could normally take over 20 minutes, but for reInvent we’ve precompiled the image to save you some time.</p>
<p>Once you’ve finished compiling, you should see a success screen. If your device freezes up - don’t worry, just restart by unplugging your Pi’s power cord. When you get back to your desktop, re-run the above setup.sh command to finish your install.</p>
<p><img src="./Alexa Skill development workshop/complete._TTH_.png" alt="Complete_"></p>
<p>Now you just need to launch the sample app and get a refresh token from AVS so your device can authenticate with the cloud via Login With Amazon (LWA).</p>
</section>
</article>
<article class="">
<a name="/6-obtain-refresh-token"><h2>6. Authorize your Device</h2></a>
<section class="body" style="display: none;">
<p>When you run the sample app for the first time, you’ll need to authorize your client for access to AVS.</p>
<p>Initialize the sample app by pasting or typing the following command into your terminal:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd /home/pi/
sudo bash startsample.sh
</code></pre></div></div>
<p>Wait for the sample app to display a message like the one in the picture below (but, a different code of course) - If you don’t see this, but you see “waiting for authorization” messages going by, then scroll up! It’s easy to miss the authorization code since the terminal window fills up pretty fast. Note - you need to leave this process running while you authorize, don’t close the window or otherwise stop the startsample script.</p>
<p><img src="./Alexa Skill development workshop/code_circle.png" alt="code"></p>
<ol>
<li>Use a browser to navigate to <a href="https://amazon.com/us/code">amazon.com/us/code</a></li>
<li>Authenticate using your Amazon user credentials. If you aren’t able to log in - try deleting all cookies or open a new tab in “guest mode” browser, then go to <a href="https://amazon.com/us/code">amazon.com/us/code</a>. You can also just go to the link from your phone, laptop, or any connected device, and it should work.</li>
<li>Enter the code specified in the message from sample app.</li>
<li>Select “Allow”.</li>
<li>Wait (it may take as long as 30 seconds) for CBLAuthDelegate to successfully get an access and refresh token from Login With Amazon (LWA).</li>
<li>At this point the sample app will print a message informing you that you are now authorized!</li>
</ol>
<p>Your raspberry pi is now ready to use the sample app. The next time you start the sample app, you will not need to go through the authorization process.</p>
<p>Now, you’ll need to open a browser to add a visual interface to your prototype. Open a new chromium tab to the following URL:
<code class="highlighter-rouge">file:///home/pi/avs-device-sdk/GUI/js/dist/index.html?insecure=1</code></p>
<p>Note, this should autocomplete in your browser when you start typing - it’s also in the bookmarks as “Alexa Home Screen”.</p>
<p>Congrats on your progress so far! Now it’s time to talk with Alexa.</p>
</section>
</article>
<article class="">
<a name="/7-talk-to-alexa" ><h2>7. Talk to Alexa</h2></a>
<section class="body" style="display: none;">
<h3 class="steps" id="interact-with-your-prototype">Interact with Your Prototype</h3>
<p>Say “Alexa” into the microphone on your Raspberry Pi to trigger the <strong>Wake Word Engine</strong>. Since you are using a single microphone in a noisy environment, you may want to speak closely into your microphone to ensure your voice is heard clearly. You should see a blue light on the bottom of your screen, indicating the wake word was recognized. Then say “tell me a joke.” If Alexa responds, congratulations! You have a working prototype.</p>
<p>If you cannot hear Alexa’s response, ensure your speaker/earbuds are turned on and plugged in to your Raspberry Pi’s 3.5mm audio jack. Check that your audio output on your Pi is set to <strong>Analog</strong> by right-clicking on the speaker icon in the top right corner of the screen.</p>
<p>Try the following interactions, and note how the screen allows for Alexa to provide information-rich interactions -</p>
<ul>
<li>
<p>Say “Alexa”, then ask “What’s the weather in Las Vegas?” Note how instead of just hearing today’s weather over the speaker, you also get a 5 day forecast visually as a bonus!</p>
</li>
<li>
<p>Say “Alexa”, then say “Play Katy Perry on TuneIn.” You get album art and transport controls (try clicking “next”!)</p>
</li>
<li>
<p>Say “Alexa”, then say “Add Milk, Eggs, Bread and Orange Juice to my shopping list.” You get a visual confirmation of how your list is shaping up, and if you fill up your list you can browse by using the scroll wheel (or if you had a touchscreen, a swipe)</p>
</li>
<li>
<p>Say “Alexa”, then say “Who is Angela Merkel?” Wikipedia provides a nice picture for your screen and some extra stats. A picture is worth a thousand words!</p>
</li>
</ul>
<h3 id="try-a-multi-turn-interaction">Try a Multi-Turn interaction</h3>
<ul>
<li>Say “Alexa”, then ask “Set an alarm for 12:30”. You should receive a response asking you to clarify AM or PM. Respond to the question with “Afternoon”. If you have DEBUG9 active, scroll up until you see <strong>Listening…</strong> - right above that you’ll see that the state of the <strong>Audio Input Processor</strong> (AIP) has changed from <code class="highlighter-rouge">IDLE</code> to <code class="highlighter-rouge">EXPECTING_SPEECH</code> and then <code class="highlighter-rouge">RECOGNIZING</code> - without you speaking the wake word! Typically, the AIP is triggered by the <strong>Wake Word Engine</strong> running on the client - but in this case, it’s been activated via a <strong>Directive</strong> delivered down to your client from the cloud.</li>
</ul>
<p><img src="./Alexa Skill development workshop/AIP_Multi.png" alt="AIP_multiturn"></p>
<p>Multi-turn interactions can feel like a more natural method of communication, since you can continue to speak with Alexa as part of a continuing conversation without starting every phrase with “Alexa”.</p>
<h3 id="other-interactions-to-try">Other interactions to Try</h3>
<ul>
<li>Say “Alexa, Wikipedia” - you’ll have the option of looking up any subject without having to speak the wake word before the subject.</li>
<li>Say “Alexa, let’s chat” to initiate a conversation with a chat bot!</li>
<li>Say “Alexa, play Yes Sire” to play a medieval-themed game using your voice.</li>
</ul>
</section>
</article>
<article class="">
<a name="/9-Modify-your-AFML" ><h2>8. Customize your Renderer</h2></a>
<section class="body" style="display: none;">
<p>Depending on the size of your screen or how your device is used, you might want to make changes in your screen’s display behavior. Navigate to the following folder in your File Manager: <code class="highlighter-rouge">/home/pi/avs-device-sdk/GUI/js/src/components</code></p>
<p>Right click on the file <strong>apmlRenderer.tsx</strong> and open it with a text editor.</p>
<p><img src="./Alexa Skill development workshop/renderChange.png" alt="code"></p>
<p>Scroll down to where you see <code class="highlighter-rouge">Theme:ColorScheme.LIGHT</code> and change it to <code class="highlighter-rouge">Theme:ColorScheme.DARK</code> - then save and close.</p>
<p>If you aren’t able to save, it may be an ownership issue, you can type the following into the terminal to fix it:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo chown -R pi:pi /home/pi
</code></pre></div></div>
<p>You will need to rebuild the GUI/js</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd /home/pi/avs-device-sdk/GUI/js/src/
npm run-script build
</code></pre></div></div>
<p>Now, refresh your browser and ask for the weather again! It should look different - better for low-light environments.</p>
<p>You can also try modifying the shape or screen size and see how the Smart Screen SDK makes it easy to optimize for your unique product capabilities.</p>
</section>
</article>
<article class="">
<a name="/8-Add-visuals" ><h2>9. Change your Home Screen</h2></a>
<section class="body" style="display: none;">
<h3 id="modify-your-home-screen">Modify your home screen</h3>
<p>When you ship your screen-based product with Alexa built-in, you’ll probably want your own home screen to display when the device isn’t in use. For example, if you were building Alexa into your smart thermostat, you could display a control screen that showed your own data when the customer wasn’t asking Alexa a question. The Alexa for Smart Screen and TV SDK makes it easy to customize your device behavior.</p>
<p>In your File Manager, navigate to <code class="highlighter-rouge">/home/pi/avs-device-sdk/GUI/js/src/lib/data</code> Right click on the <strong>Home.json</strong> file and select open with Text Editor to modify the file as shown in the below picture.</p>
<p><img src="./Alexa Skill development workshop/homejson.png" alt="config"></p>
<p>Here, you can input any URL to replace your home screen with. Make your own, or try the following as an example:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://i.imgur.com/orvck3S.png
</code></pre></div></div>
<p>Save and close the file. If you aren’t able to save, it may be an ownership issue, you can type the following into the terminal to fix it:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo chown -R pi:pi /home/pi
</code></pre></div></div>
<p>You will need to rebuild the GUI/js</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd /home/pi/avs-device-sdk/GUI/js/src/
npm run-script build
</code></pre></div></div>
<p>When you’re ready, you don’t need to re-compile the SDK or restart the sample app, just refresh your browser in Chromium after the build. You should see your own custom home screen image when you aren’t interacting with Alexa!</p>
<p>Feel free to poke around in the Home.json file and see what other changes you can make to improve the customer experience on your device.</p>
</section>
</article>
<article class="">
<a name="/10-troubleshoot" ><h2>10. Troubleshooting Tips</h2></a>
<section class="body" style="display: none;">
<h2 id="modify-your-home-screen">Troubleshooting Tips</h2>
<h3 style="color:red"> If no audio fails but alexa runs </h3>
<h4>Disable bluealsa using the below mentioned code</h4>
<p><strong>ps aux | grep bluealsa</strong></p>
<p><strong>sudo kill "pid"</strong></p>
<h4>Install pulse audio using the below mentioned code</h4>
<p><strong>apt-get install pulseaudio</strong></p>
<h3 style="color:red"> Testing the microphone </h3>
<h3>Testing the microphone</h3>
<p>1)Record a soundwave by typing the command</p>
<p><strong>arecord -D plughw:1,0 -d 3 test.wav </strong></p>
<p>2)Play the wave file by typing the command</p>
<p><strong>aplay test.wav</strong></p>
<h3 style="color:red"> failed to create sample app </h3>
<p>Most probable cause: Disconnected or faulty microphone</p>
<h3 style="color:red"> Directory exist but not empty </h3>
<p><strong>cd /third-party</strong></p>
<p><strong>sudo rm -r alexa-rpi</strong></p>
<p style="color:green">Kindly let us know of anymore errors you face creating an issue at:<a href="https://github.com/4NOTfour/AVS-TUTORIALS/issues/new">Github</a></p>
<p><strong>We will troubleshoot and post the method soon</strong></p>
</section>
</article>
</section>
<!--section for setting up ends-->
<!--Section for alexa skill tutorial-->
<section id="content"><a class="control hide">Hide all</a><a class="control show">Show all</a>
<article class="">
<a name="/1/2-Settingup-lambda" ><h2>2.Setting up lambda function</h2></a>
<section class="body" style="display: none;">
<h3 id="Setting-up-lambda">Setting up lambda</h3>
<p>n the first step of this guide, we built the Voice User Interface (VUI) for our Alexa skill. On this page, we will be creating an AWS Lambda function using <a href="http://aws.amazon.com/">Amazon Web Services.</a> You can read more about <a href="http://aws.amazon.com/lambda">what a Lambda function is,</a> but for the purposes of this guide, what you need to know is that AWS Lambda is where our code lives. When a user asks Alexa to use our skill, it is our AWS Lambda function that interprets the appropriate interaction, and provides the conversation back to the user.</p>
<p><strong>1.Go to http://aws.amazon.com</strong> and sign in to the console.</p>
<p><strong>2.Click "Services" at the top of the screen, and type "Lambda" in the search box.</strong> You can also find Lambda in the list of services. It is in the "Compute" section.</p>
<p><img src="./Alexa Skill development workshop/2-2-services-lambda.png" alt="config-lambda"></p>
<p><strong>3.Check your AWS region.</strong> AWS Lambda only works with the Alexa Skills Kit in these regions: US East (N. Virginia), US West (Oregon), Asia Pacific (Tokyo) and EU (Ireland). Make sure you choose the region closest to your customers.</p>
<p><strong>4.Click the orange "Create function" button.</strong> It should be near the top of your screen. (If you don't see this button, it is because you haven't created a Lambda function before. Click the blue "Get Started" button near the center of your screen.)</p>
<p><strong>5.</strong>There are three boxes labeled "Author from scratch", "Blueprints" and "Serverless Application Repository". Click the radio button in the box titled <strong>"Blue prints" </strong> and then <strong>Enter fact to search for the application repository named alexa-skill-kit-sdk-factskill.</strong></p>
<p><strong>6.</strong>Click on the Application package</p>
<p><strong>7.</strong>Click configure button on the bottom right corner of the screen.</p>
<p><strong>8.</strong>Enter a Function Name,for option <strong>role choose create a custom role from the dropdown menu.<strong> In the new screen that appears click Allow at the bottom right corner</strong></p>
<p><strong>9.</strong>Once you are done with entering the above details click the <strong>Orange Create function button on the bottom right corner of the screen.</strong></p>
<p><strong>10.</strong>You should see the Amazon Resource Name (ARN) for this function in the top right corner of the page. (You may need to scroll back up.) Copy the ARN value for this Lambda function for use in the next section of the guide.</p>
</section>
</article>
</section><!--Section for alexa skill tutorial ends-->
<!--[if lt IE 9]><script src='http://html5shim.googlecode.com/svn/trunk/html5.js'></script><![endif]-->
<script src="./Alexa Skill development workshop/assets.js" type="text/javascript"></script>
<script>require('boot');</script>
</body></html>