Create meta-alexa-led layer and tutorials
PATCH 1/1 Create meta-alexa-led layer and tutorials
From: Matthew Hansen <[email protected]>
Added meta-alexa-led for demo files
Update the README with instructions for building an image with alexa-led.
Add the tutorials for alexa-led demo.
---
COPYING.MIT => meta-alexa-led/COPYING.MIT | 0
LICENSE => meta-alexa-led/LICENSE | 0
meta-alexa-led/README | 92 +++++++++++++
meta-alexa-led/conf/layer.conf | 10 ++
meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb | 16 +++
.../recipes-demo/alexa-led/files/COPYING.MIT | 17 +++
.../recipes-demo/alexa-led/files/LICENSE | 2 +
.../recipes-demo/alexa-led/files/index.js | 142 +++++++++++++++++++++
.../recipes-demo/alexa-led/files/main.js | 89 +++++++++++++
.../1HowToRegisterMinnowboardAsIoTDevice.pdf | Bin 0 -> 2245977 bytes
.../tutorials/2HowToCreateLambdaFunction.pdf | Bin 0 -> 2260907 bytes
.../tutorials/3HowToCreateAlexaSkill.pdf | Bin 0 -> 1383314 bytes
meta-alexapi/COPYING.MIT | 17 +++
meta-alexapi/LICENSE | 2 +
README => meta-alexapi/README | 0
{conf => meta-alexapi/conf}/layer.conf | 0
.../libmtp/libmtp_1.1.5.bbappend | 0
...0001-common.sh-Get-rid-of-grep-perl-regex.patch | 0
...ange-some-things-that-don-t-make-sense-fo.patch | 0
...template.yaml-Set-default-input-to-defaul.patch | 0
.../recipes-core}/alexapi/alexapi_git.bb | 0
.../python/python-cheroot_5.1.0.bb | 0
.../python/python-cherrypy_10.1.1.bb | 0
.../python/python-memcached_1.58.bb | 0
.../python/python-pocketsphinx_0.1.3.bb | 0
.../recipes-devtools}/python/python-portend_1.8.bb | 0
.../python/python-py-getch_1.0.1.bb | 0
.../python/python-tempora_1.6.1.bb | 0
.../recipes-devtools}/python/python-vlc_1.1.2.bb | 0
.../recipes-devtools}/python/python-wave_0.0.2.bb | 0
.../python/python-webrtcvad_2.0.10.bb | 0
.../recipes-multimedia}/vlc/vlc_2.2.2.bbappend | 0
32 files changed, 387 insertions(+)
rename COPYING.MIT => meta-alexa-led/COPYING.MIT (100%)
rename LICENSE => meta-alexa-led/LICENSE (100%)
create mode 100644 meta-alexa-led/README
create mode 100644 meta-alexa-led/conf/layer.conf
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/COPYING.MIT
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/LICENSE
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/index.js
create mode 100755 meta-alexa-led/recipes-demo/alexa-led/files/main.js
create mode 100644 meta-alexa-led/tutorials/1HowToRegisterMinnowboardAsIoTDevice.pdf
create mode 100644 meta-alexa-led/tutorials/2HowToCreateLambdaFunction.pdf
create mode 100644 meta-alexa-led/tutorials/3HowToCreateAlexaSkill.pdf
create mode 100644 meta-alexapi/COPYING.MIT
create mode 100644 meta-alexapi/LICENSE
rename README => meta-alexapi/README (100%)
rename {conf => meta-alexapi/conf}/layer.conf (100%)
rename {recipes-connectivity => meta-alexapi/recipes-connectivity}/libmtp/libmtp_1.1.5.bbappend (100%)
rename {recipes-core => meta-alexapi/recipes-core}/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch (100%)
rename {recipes-core => meta-alexapi/recipes-core}/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch (100%)
rename {recipes-core => meta-alexapi/recipes-core}/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch (100%)
rename {recipes-core => meta-alexapi/recipes-core}/alexapi/alexapi_git.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-cheroot_5.1.0.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-cherrypy_10.1.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-memcached_1.58.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-pocketsphinx_0.1.3.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-portend_1.8.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-py-getch_1.0.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-tempora_1.6.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-vlc_1.1.2.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-wave_0.0.2.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-webrtcvad_2.0.10.bb (100%)
rename {recipes-multimedia => meta-alexapi/recipes-multimedia}/vlc/vlc_2.2.2.bbappend (100%)meta-alexa-led/COPYING.MIT renamed from COPYING.MIT +0 -0
meta-alexa-led/LICENSE renamed from LICENSE +0 -0
meta-alexa-led/README new file +92 -0
92 lines not on this page · raw message
meta-alexa-led/conf/layer.conf new file +10 -0
@@ -0,0 +1,10 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "alexa-led" +BBFILE_PATTERN_alexa-led = "^${LAYERDIR}/" +BBFILE_PRIORITY_alexa-led = "6"
meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb new file +16 -0
@@ -0,0 +1,16 @@ +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=afaffb6a59e1896be335c5dd05c69e4b" + +SRC_URI = "file://main.js" + +RDEPENDS_${PN} = "nodejs \ + alexapi" + +do_install () { + install -d ${D}${libdir}/node_modules/alexa_led + install ${WORKDIR}/main.js ${D}${libdir}/node_modules/alexa_led +} + +FILES_${PN} = " \ + ${libdir}/node_modules \ + "
meta-alexa-led/recipes-demo/alexa-led/files/COPYING.MIT new file +17 -0
@@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
meta-alexa-led/recipes-demo/alexa-led/files/LICENSE new file +2 -0
@@ -0,0 +1,2 @@ +All files in this layer are under the MIT license unless a file specifically notes otherwise. +See COPYING.MIT for license details.
meta-alexa-led/recipes-demo/alexa-led/files/index.js new file +142 -0
142 lines not on this page · raw message
meta-alexa-led/recipes-demo/alexa-led/files/main.js new file +89 -0
89 lines not on this page · raw message
meta-alexa-led/tutorials/1HowToRegisterMinnowboardAsIoTDevice.pdf new file binary +0 -0
meta-alexa-led/tutorials/2HowToCreateLambdaFunction.pdf new file binary +0 -0
meta-alexa-led/tutorials/3HowToCreateAlexaSkill.pdf new file binary +0 -0
meta-alexapi/COPYING.MIT new file +17 -0
@@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
meta-alexapi/LICENSE new file +2 -0
@@ -0,0 +1,2 @@ +All files in this layer are under the MIT license unless a file specifically notes otherwise. +See COPYING.MIT for license details.
meta-alexapi/README renamed from README +0 -0
meta-alexapi/conf/layer.conf renamed from conf/layer.conf +0 -0
meta-alexapi/recipes-connectivity/libmtp/libmtp_1.1.5.bbappend renamed from recipes-connectivity/libmtp/libmtp_1.1.5.bbappend +0 -0
meta-alexapi/recipes-core/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch renamed from recipes-core/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch +0 -0
meta-alexapi/recipes-core/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch renamed from recipes-core/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch +0 -0
meta-alexapi/recipes-core/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch renamed from recipes-core/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch +0 -0
meta-alexapi/recipes-core/alexapi/alexapi_git.bb renamed from recipes-core/alexapi/alexapi_git.bb +0 -0
meta-alexapi/recipes-devtools/python/python-cheroot_5.1.0.bb renamed from recipes-devtools/python/python-cheroot_5.1.0.bb +0 -0
meta-alexapi/recipes-devtools/python/python-cherrypy_10.1.1.bb renamed from recipes-devtools/python/python-cherrypy_10.1.1.bb +0 -0
meta-alexapi/recipes-devtools/python/python-memcached_1.58.bb renamed from recipes-devtools/python/python-memcached_1.58.bb +0 -0
meta-alexapi/recipes-devtools/python/python-pocketsphinx_0.1.3.bb renamed from recipes-devtools/python/python-pocketsphinx_0.1.3.bb +0 -0
meta-alexapi/recipes-devtools/python/python-portend_1.8.bb renamed from recipes-devtools/python/python-portend_1.8.bb +0 -0
meta-alexapi/recipes-devtools/python/python-py-getch_1.0.1.bb renamed from recipes-devtools/python/python-py-getch_1.0.1.bb +0 -0
meta-alexapi/recipes-devtools/python/python-tempora_1.6.1.bb renamed from recipes-devtools/python/python-tempora_1.6.1.bb +0 -0
meta-alexapi/recipes-devtools/python/python-vlc_1.1.2.bb renamed from recipes-devtools/python/python-vlc_1.1.2.bb +0 -0
meta-alexapi/recipes-devtools/python/python-wave_0.0.2.bb renamed from recipes-devtools/python/python-wave_0.0.2.bb +0 -0
meta-alexapi/recipes-devtools/python/python-webrtcvad_2.0.10.bb renamed from recipes-devtools/python/python-webrtcvad_2.0.10.bb +0 -0
meta-alexapi/recipes-multimedia/vlc/vlc_2.2.2.bbappend renamed from recipes-multimedia/vlc/vlc_2.2.2.bbappend +0 -0
Signature · 1 line
2.7.4
The content looks good (really like the step-by-step PDF guides), but this should really be split into a few commits.
Probably one for the layer move (meta-alexapi), one for the new recipes, and another for the docs at a minimum.
If its too much work I can merge as-is though.
Thanks,
Cal
Quoted 105,242 lines · Amanda Brindle
From: Matthew Hansen <[email protected]>
Added meta-alexa-led for demo files
Update the README with instructions for building an image with alexa-led.
Add the tutorials for alexa-led demo.
Signed-off-by Amanda Brindle <[email protected]>Signed-off-by Matthew Hansen <[email protected]>--- COPYING.MIT => meta-alexa-led/COPYING.MIT | 0 LICENSE => meta-alexa-led/LICENSE | 0 meta-alexa-led/README | 92 +++++++++++++ meta-alexa-led/conf/layer.conf | 10 ++ meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb | 16 +++ .../recipes-demo/alexa-led/files/COPYING.MIT | 17 +++ .../recipes-demo/alexa-led/files/LICENSE | 2 + .../recipes-demo/alexa-led/files/index.js | 142 +++++++++++++++++++++ .../recipes-demo/alexa-led/files/main.js | 89 +++++++++++++ .../1HowToRegisterMinnowboardAsIoTDevice.pdf | Bin 0 -> 2245977 bytes .../tutorials/2HowToCreateLambdaFunction.pdf | Bin 0 -> 2260907 bytes .../tutorials/3HowToCreateAlexaSkill.pdf | Bin 0 -> 1383314 bytes meta-alexapi/COPYING.MIT | 17 +++ meta-alexapi/LICENSE | 2 + README => meta-alexapi/README | 0 {conf => meta-alexapi/conf}/layer.conf | 0 .../libmtp/libmtp_1.1.5.bbappend | 0 ...0001-common.sh-Get-rid-of-grep-perl-regex.patch | 0 ...ange-some-things-that-don-t-make-sense-fo.patch | 0 ...template.yaml-Set-default-input-to-defaul.patch | 0 .../recipes-core}/alexapi/alexapi_git.bb | 0 .../python/python-cheroot_5.1.0.bb | 0 .../python/python-cherrypy_10.1.1.bb | 0 .../python/python-memcached_1.58.bb | 0 .../python/python-pocketsphinx_0.1.3.bb | 0 .../recipes-devtools}/python/python-portend_1.8.bb | 0 .../python/python-py-getch_1.0.1.bb | 0 .../python/python-tempora_1.6.1.bb | 0 .../recipes-devtools}/python/python-vlc_1.1.2.bb | 0 .../recipes-devtools}/python/python-wave_0.0.2.bb | 0 .../python/python-webrtcvad_2.0.10.bb | 0 .../recipes-multimedia}/vlc/vlc_2.2.2.bbappend | 0 32 files changed, 387 insertions(+)rename COPYING.MIT => meta-alexa-led/COPYING.MIT (100%)
rename LICENSE => meta-alexa-led/LICENSE (100%)
create mode 100644 meta-alexa-led/README
create mode 100644meta-alexa-led/conf/layer.conf
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/COPYING.MIT
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/LICENSE
create mode 100644 meta-alexa-led/recipes-demo/alexa-led/files/index.js
create mode 100755 meta-alexa-led/recipes-demo/alexa-led/files/main.js
create mode 100644 meta-alexa-led/tutorials/1HowToRegisterMinnowboardAsIoTDevice.pdf
create mode 100644 meta-alexa-led/tutorials/2HowToCreateLambdaFunction.pdf
create mode 100644 meta-alexa-led/tutorials/3HowToCreateAlexaSkill.pdf
create mode 100644 meta-alexapi/COPYING.MIT
create mode 100644 meta-alexapi/LICENSE
rename README => meta-alexapi/README (100%)
rename {conf =>meta-alexapi/conf}/layer.conf(100%)
rename {recipes-connectivity => meta-alexapi/recipes-connectivity}/libmtp/libmtp_1.1.5.bbappend (100%)
rename {recipes-core =>meta-alexapi/recipes-core}/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch(100%) rename {recipes-core =>meta-alexapi/recipes-core}/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch(100%) rename {recipes-core =>meta-alexapi/recipes-core}/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch(100%) rename {recipes-core => meta-alexapi/recipes-core}/alexapi/alexapi_git.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-cheroot_5.1.0.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-cherrypy_10.1.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-memcached_1.58.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-pocketsphinx_0.1.3.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-portend_1.8.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-py-getch_1.0.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-tempora_1.6.1.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-vlc_1.1.2.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-wave_0.0.2.bb (100%)
rename {recipes-devtools => meta-alexapi/recipes-devtools}/python/python-webrtcvad_2.0.10.bb (100%)
rename {recipes-multimedia => meta-alexapi/recipes-multimedia}/vlc/vlc_2.2.2.bbappend (100%)meta-alexa-led/COPYING.MIT renamed from COPYING.MIT +0
-0meta-alexa-led/LICENSE renamed from LICENSE +0
-0meta-alexa-led/README new file +92
-0@@ -0,0 +1,92 @@ +This README file contains information on the contents of the +alexa-led layer. + +Please see the corresponding sections below for details. + + +Dependencies +============ + +This layer depends on: + + URI: git://git.openembedded.org/bitbake + branch: master + + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master + + URI: git://git.yoctoproject.org/meta-alexa-demo + layers: meta-alexapi + branch: dev + +Patches +======= + +Please submit any patches against the alexa-led layer to the +yocto mailing list ([email protected]) and cc: the maintainer: + +Maintainer: Amanda Brindle <[email protected]> + + +Table of Contents +================= + + I. Prerequisite + II. Adding the alexa-led layer to your build +III. Adding installations to your build + IV. Demo Tutorials + +I. Prerequisite +================================================= + +Add alexapi to your image by following the README in the meta-alexapi layer, +and test that you can speak to Alexa. (ex: Alexa, what time is it?) + +II. Adding the alexa-led layer to your build +================================================= + +In order to use this layer, you need to make the build system aware of +it. + +Assuming the alexa-led layer exists at the top-level of your +yocto build tree, you can add it to the build system by adding the +location of the alexa-led layer to bblayers.conf, along with any +other layers needed. e.g.: + + BBLAYERS ?= " \ + /path/to/yocto/meta \ + /path/to/yocto/meta-poky \ + /path/to/yocto/meta-intel \ + /path/to/yocto/meta-alexapi \ + /path/to/yocto/meta-alexa-led \ + " + + +III. Adding installations to your build +======== + +In local.conf add: + +IMAGE_INSTALL_append = " alexa-led alexapi alsa-utils nodejs nodejs-npm portaudio-v19 curl " + +If you get the ERROR: Nothing PROVIDES 'libmad' and/or ERROR: libmad was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST + +In local.conf add: + +LICENSE_FLAGS_WHITELIST = "commercial" + +Optionally, you can add more to IMAGE_INSTALL_append, such as git in case you want to clone the dev branch of alexapi, or connman-client to help connect to wifi: + +IMAGE_INSTALL_append = " git connman-client " + +You can also add gcc, make, cmake, and other development tools if you want to build code: + +IMAGE_INSTALL_append = " gcc make cmake " + +Then, look for EXTRA_IMAGE_FEATURES ?= "debug-tweaks", and add tools-sdk. + +IV. Demo Tutorials +===================================== + +To complete the demo to make an led blink, follow the demo tutorials found in the tutorials folder.meta-alexa-led/conf/layer.conf new file +10
-0@@ -0,0 +1,10 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "alexa-led" +BBFILE_PATTERN_alexa-led = "^${LAYERDIR}/" +BBFILE_PRIORITY_alexa-led = "6"meta-alexa-led/recipes-demo/alexa-led/alexa-led.bb new file +16
-0@@ -0,0 +1,16 @@ +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=afaffb6a59e1896be335c5dd05c69e4b" + +SRC_URI = "file://main.js" + +RDEPENDS_${PN} = "nodejs \ + alexapi" + +do_install () { + install -d ${D}${libdir}/node_modules/alexa_led + install ${WORKDIR}/main.js ${D}${libdir}/node_modules/alexa_led +} + +FILES_${PN} = " \ + ${libdir}/node_modules \ + "meta-alexa-led/recipes-demo/alexa-led/files/COPYING.MIT new file +17
-0@@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.meta-alexa-led/recipes-demo/alexa-led/files/LICENSE new file +2
-0@@ -0,0 +1,2 @@ +All files in this layer are under the MIT license unless a file specifically notes otherwise. +See COPYING.MIT for license details.meta-alexa-led/recipes-demo/alexa-led/files/index.js new file +142
-0@@ -0,0 +1,142 @@ +'use strict'; +var config = {}; + +var AWS = require('aws-sdk'); +var Alexa = require('alexa-sdk'); + +//replace with endpoint from AWS IoT Device +var iotData = new AWS.IotData({endpoint: 'a22iwj71w43omu.iot.us-east-2.amazonaws.com', region: 'us-east-2'}); +var APP_ID = undefined; //OPTIONAL: replace with 'amzn1.echo-sdk-ams.app.[your-unique-value-here]'; +var SKILL_NAME = 'gateway-demo'; + +exports.handler = function(event, context, callback) { + var alexa = Alexa.handler(event, context); + alexa.APP_ID = APP_ID; + alexa.registerHandlers(handlers); + alexa.execute(); +}; + +var led_state = 0; + +var handlers = { + 'LaunchRequest': function () { + + var LEDState = [ + {"state":{ "desired":{"device":"minnowboard_1","led":0}}} + ]; + var speechOutput="Gateway Operational"; + AWSIoT.sendMessage(this, LEDState,speechOutput); + + }, + 'DeviceStateIntent': function () { + + var speechOutput; + var itemSlot = this.event.request.intent.slots.LEDState; + console.log("itemSlot: "+itemSlot); + var LED_State="none"; + if (itemSlot && itemSlot.value) { + LED_State = itemSlot.value.toLowerCase(); + } + console.log("LED_State: "+ LED_State); + var deviceState=null; + + switch (LED_State) { + case "on": + led_state = 1; + deviceState = [ + {'state':{ 'desired':{'device':'minnowboard_1','led_state':led_state}}} + ]; + speechOutput="L E D on"; + console.log('on recieved') + break; + case "off": + led_state = 0; + deviceState = [ + {'state':{ 'desired':{'device':'minnowboard_1','led_state':led_state}}} + ]; + speechOutput="L E D off"; + break; + default: + speechOutput="no L E D state"; + break; + } + if (deviceState===null) { + this.emit(':tell',speechOutput); + } else { + AWSIoT.sendMessage(this, deviceState, speechOutput); + console.log("message sent: ", deviceState ) + } + + + }, + 'AMAZON.HelpIntent': function () { + this.attributes['speechOutput'] = 'You can ask questions such as, what\'s the L E D state, or, you can say exit... ' + + 'Now, what can I help you with?'; + this.attributes['repromptSpeech'] = 'You can say things like, what\'s the L E D state, or you can say exit...' + + ' Now, what can I help you with?'; + this.emit(':ask', this.attributes['speechOutput'], this.attributes['repromptSpeech']) + }, + 'AMAZON.RepeatIntent': function () { + this.emit(':ask', this.attributes['speechOutput'], this.attributes['repromptSpeech']) + }, + 'AMAZON.StopIntent': function () { + this.emit('SessionEndedRequest'); + }, + 'AMAZON.CancelIntent': function () { + this.emit('SessionEndedRequest'); + }, + 'SessionEndedRequest':function () { + this.emit(':tell', 'Goodbye!'); + } + }; + +var AWSIoT = { + postSendMessage: function (thisOfParent,speechOutput) { + console.log('doot doot, all doot'); + thisOfParent.emit(':tell', speechOutput); + }, + sendMessage: function (thisOfParent, deviceState, speechOutput) { + + var itemsProcessed = 0; + + deviceState.forEach((item, index, array) => { + console.log("item "+index+": "+JSON.stringify(item)); + console.log("device "+index+": "+item.state.desired.device) + + var thingNameAndPayload= { + thingName: 'minnowboard_1', + payload: JSON.stringify(item) + }; + + iotData.updateThingShadow(thingNameAndPayload, function(err, data) { + console.log('sent shadow update') + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + + + if (err){ + console.log("update error: "); + console.log(err); + //Handle the error here + speechOutput += " - Error updating device state: " + err + " "; + speechOutput += thingNameAndPayload.thingName + " "; + speechOutput += thingNameAndPayload.payload; + } + + else { + console.log("update success: "); + console.log(data); + } + itemsProcessed++; + if(itemsProcessed === array.length) { + AWSIoT.postSendMessage(thisOfParent, speechOutput); + } + + + }); + + }); + + } + + };meta-alexa-led/recipes-demo/alexa-led/files/main.js new file +89
-0@@ -0,0 +1,89 @@ +"use strict" ; + +var APP_NAME = "Alexa Demo" ; +console.log("Initializing " + APP_NAME) ; + + +var fs = require ('fs'); +if (!fs.existsSync('/sys/class/gpio/gpio360/value')) { + fs.writeFile('/sys/class/gpio/export', 360, (err) => { + if (err) console.log('Error - couldnt export gpio 360'); + }); +} +fs.writeFile('/sys/class/gpio/gpio360/direction', 'out', (err) => { + if (err) console.log('Error - couldnt set gpio direction'); +}); + +fs.writeFile('/sys/class/gpio/gpio360/value', '0', (err) => { + if (err) console.log('Error - couldnt set gpio value'); +}); + +console.log("GPIO initialized..."); + +const deviceModule = require('aws-iot-device-sdk').device; + +console.log("Device module found..."); + +function connectAWS() { + + const device = deviceModule({ + keyPath: "/connect_device_package/Minnowboard.private.key", //Make sure these paths match your certifacte locations + certPath: "/connect_device_package/Minnowboard.cert.pem", + caPath: "/connect_device_package/root-CA.crt", + host: "a22iwj71w43omu.iot.us-east-2.amazonaws.com", //Replace with your endpoint from AWS IoT Device Dashboard + }); + console.log("deviceModule initialized..."); + + device.subscribe('$aws/things/minnowboard_1/shadow/update/accepted'); + device.publish('topic_1', 'hello from Minnowboard') + console.log("Publish and subscribe started..."); + +device + .on('connect', function() { + console.log('connect'); + }); + device + .on('close', function() { + console.log('close'); + }); + device + .on('reconnect', function() { + console.log('reconnect'); + }); + device + .on('offline', function() { + console.log('offline'); + }); + device + .on('error', function(error) { + console.log('error', error); + }); + device + .on('message', function(topic, payload) { + console.log('message', topic, payload.toString()); + updateState(payload) + }); + + console.log("Device callbacks set..."); +} + + +//globals: +var led_state = 0; +var shadow = null; + +function updateState(payload){ + var pay_json=JSON.parse(payload.toString()) + led_state = 1 - pay_json.state.desired.led_state; // Invert state since on/off are 0/1 + + console.log("Setting gpio 360 (LED) to " + led_state); + + fs.writeFile('/sys/class/gpio/gpio360/value', led_state, (err) => { + if (err) console.log('Error - couldnt set gpio value'); +}); + +}; + + +connectAWS(); +meta-alexa-led/tutorials/1HowToRegisterMinnowboardAsIoTDevice.pdf new file binary +0
-0meta-alexa-led/tutorials/2HowToCreateLambdaFunction.pdf new file binary +0
-0meta-alexa-led/tutorials/3HowToCreateAlexaSkill.pdf new file binary +0
-0meta-alexapi/COPYING.MIT new file +17
-0@@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.meta-alexapi/LICENSE new file +2
-0@@ -0,0 +1,2 @@ +All files in this layer are under the MIT license unless a file specifically notes otherwise. +See COPYING.MIT for license details.meta-alexapi/README renamed from README +0
-0meta-alexapi/conf/layer.conf renamed from conf/layer.conf +0
-0meta-alexapi/recipes-connectivity/libmtp/libmtp_1.1.5.bbappend renamed from recipes-connectivity/libmtp/libmtp_1.1.5.bbappend +0
-0meta-alexapi/recipes-core/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch renamed from recipes-core/alexapi/alexapi/0001-common.sh-Get-rid-of-grep-perl-regex.patch +0
-0meta-alexapi/recipes-core/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch renamed from recipes-core/alexapi/alexapi/0002-setup.sh-Change-some-things-that-don-t-make-sense-fo.patch +0
-0meta-alexapi/recipes-core/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch renamed from recipes-core/alexapi/alexapi/0003-src.config.template.yaml-Set-default-input-to-defaul.patch +0
-0meta-alexapi/recipes-core/alexapi/alexapi_git.bb renamed from recipes-core/alexapi/alexapi_git.bb +0
-0meta-alexapi/recipes-devtools/python/python-cheroot_5.1.0.bb renamed from recipes-devtools/python/python-cheroot_5.1.0.bb +0
-0meta-alexapi/recipes-devtools/python/python-cherrypy_10.1.1.bb renamed from recipes-devtools/python/python-cherrypy_10.1.1.bb +0
-0meta-alexapi/recipes-devtools/python/python-memcached_1.58.bb renamed from recipes-devtools/python/python-memcached_1.58.bb +0
-0meta-alexapi/recipes-devtools/python/python-pocketsphinx_0.1.3.bb renamed from recipes-devtools/python/python-pocketsphinx_0.1.3.bb +0
-0meta-alexapi/recipes-devtools/python/python-portend_1.8.bb renamed from recipes-devtools/python/python-portend_1.8.bb +0
-0meta-alexapi/recipes-devtools/python/python-py-getch_1.0.1.bb renamed from recipes-devtools/python/python-py-getch_1.0.1.bb +0
-0meta-alexapi/recipes-devtools/python/python-tempora_1.6.1.bb renamed from recipes-devtools/python/python-tempora_1.6.1.bb +0
-0meta-alexapi/recipes-devtools/python/python-vlc_1.1.2.bb renamed from recipes-devtools/python/python-vlc_1.1.2.bb +0
-0meta-alexapi/recipes-devtools/python/python-wave_0.0.2.bb renamed from recipes-devtools/python/python-wave_0.0.2.bb +0
-0meta-alexapi/recipes-devtools/python/python-webrtcvad_2.0.10.bb renamed from recipes-devtools/python/python-webrtcvad_2.0.10.bb +0
-0meta-alexapi/recipes-multimedia/vlc/vlc_2.2.2.bbappend renamed from recipes-multimedia/vlc/vlc_2.2.2.bbappend +0
-0