Saturday, February 18, 2017

Alexa skills from scratch with AWS Lambda, SSML and Amazon S3

Hello, everyone in this post I am going to teach about creating custom Alexa skills from scratch with AWS Lambda based code-functions and walk you through how to use SSML (Speech Synthesis Markup Language) and Amazon S3 inside the skills. As we have many geek code-snippets and webinar material available on cloud or web, but here I tried to cover all noted and important takeaway bullet points – help on creating sample skills in single flow without facing any obstacles or challenges in your development plus implementation phase.  For mobile, cloud & IoT devs and professional, it’s a piece of sample case study, which offers them to accelerate their existing skills from basic to expert level.

Here I recommend to use below links for setup-environment and source management of Alexa skills development and testing of them:

A. First, install Node/NPM into your development machine. Make sure it’s updated with the latest version.

B. Amazon Alexa Skills Kit:
  • The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well as testing instructions are located at

* Create an account first for accessing AWS cloud services.

C. Amazon Developer Console - Services: 

D. (Free Community Edition Beta) – Alexa Skill Testing Tool: In case you don’t have access of Amazon  Echo device, cloud tool help you on developing/testing your custom skills:  

E. Audacity – to create mp3 files in specified format:

Step1: Create an AWS account via Developer Console

Step2: Get Start With the Alexa Skills Kit (ASK)

Step3: Fill the skill-information, such as name, invocation name, ... press Next Get Start With the Alexa Skills Kit (ASK)

Step4: Create interaction model. Essentially all intent schema, slot types and possible utterances details and press Next

Step5: In Configuration page, select option as depicted below except text-field info (required ARN here to fill or linking). Make yourself pause in proceeding to Next button. 

Step6: Open AWS Lambda service via 'Developer Console' and 'Select blueprint'. You can create your own, but for this sample I chosen via filter 'alexa' keyword - 'alexa-skills-kit-color-expert' sample blueprint.  

Step7: Configure triggers in this phase. At this moment only pick the region 'US East (N. Virginia)' to create and test the skills freely. Currently APAC region doesn't allow to add a 'Alexa Skills Kit' ASK trigger that will invoke your function.

Step8: Follow as depicted below and mentioned in above step.

Step9: Follow here as mentioned in above step to invoke your function. Filter/Pick 'Alexa Skills Kit.

Step10: In this step, fill information of 'Configuration Information' page, such as function name, description and desired programming language from. Here I picked Node.js 4.3 

Step11: After you provide the code of your function, fill Lambda function handler and role as depicted below in screenshot. 

Step12: After you provide the code of your function, fill Lambda function handler and role as depicted below in screenshot. Press 'Actions' tab and choose 'Configure test event' option, then select 'Alexa Start Session'. Press 'Save and test' button to check the code function log and desired result outcome.

Step13: After you provide the code of your function, fill Lambda function handler and role as depicted below in screenshot. Here you'll get ARN - copy this one and paste in 'Step5' image and proceed for the Next (i.e., under Developer Console portal - created earlier). 

Step14: Once the above steps been completed and achieved execution result:succeeded. Then time to test the real skills app. Copy the 'strings' as highlighted below and test the app via in-built simulator. 

Step15: Developer can test the SSML based tag command under in-built 'Voice Simulator' option. use/modify SSML tags instead of 'Plaintext' inside the Lambda code function and hear the voice in response. SSML piece still on developing phase, currently support MPEG (.mp3) format in specified way. *Regarding how to create/record audio locally by using 'Audacity app' (i.e., link available above) and upload same content to Amazon S3 - will write separate post, stay tuned.

Step16: We can visualize the request and response in JSON format inside the window - depicted run-time sample in below screenshot.

Step17: Time to test the succeeded app response through Echo cloud device i.e., Press mike button on below screen and use 'utterances' to chat with Alexa Echo device.  Please be noted the use same credential of AWS developer console to react/response of  programmed skills queries. Amazing one!


Wednesday, December 28, 2016

MEAN Setup and Start with @ Mac OSX..!

Dear Viewer,

This post will help and take you with the following possible steps in regard of installing stack tools associated with the MEAN development platform into your Mac OSX machine. I have seen there are plenty of posts available online for setting up work environment on various cross-platforms. My focus is also quite similar over here; but this write-up is only targeted for Mac OSX  users. Due to large volume API up-gradation and changes in technology cycles frequently many things might not go right in one short of your MEAN development set-up at Mac machine. With having said that, thought to write a post should be meaningful and helpful for target audience. I have been done setup implementation successfully in my Mac OS (i.e., macOS Sierra version 10.12.2). Lets start with the step of set-up implementation after getting bit idea/purpose of MEAN: 

MEAN (Mongo, Express, Angular, Node) - A simple, scalable and easy starting point for full stack JavaScript web development. The MEAN stack represents a thoroughly modern approach to web development: one in which a single language (JavaScript) runs on every tier of your application, from client to server to persistence.

Here understand the short purpose and definition of all stacks:

MongoDB is the leading NoSQL database, empowering businesses to be more agile and scalable. 

Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.

AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.

Before you begin, you should make sure you have installed all these prerequisites on your development machine.

The first is to change the owner of “/usr/local” to the with the following command:
$ sudo chown -R $USER /usr/local

It is not recommended to use the npm command with sudo.

The second would be to install the Apple command line developer tools. I think, the best way to do it is by installing XCode. Yes you then have another big IDE, but it installs much more. But this way, you don’t need to have a developer account. I did it by Installing XCode; you can just install the command line tools. XCode can be installed from the Apple AppStore.

Step 1:
Install either Macports or HomeBrew in your Mac machine for easy installation of tools and their dependencies.

The third is to install homebrew. Homebrew is the package manager for MAC. The installation is pretty easy, type the following in you command line:
$ ruby -e "$(curl -fsSL"

Then run the homebrew doctor like this:

$ brew doctor

After this, you can install tools like this:

$ brew install wget

Step 2: Installing Node.js / Nodes.js Package Manager (NPM)

Download & Install Node.js and the npm package manager, if you encounter any problems, you can also use this Github Gist to install Node.js. Again, we'll let HomeBrew do the heavy lifting:

$ brew install node

The npm executable is already included in the Node.js package.
Before continuing, let's make sure Node.js modules can be found by others (Caution: it's best to copy and paste these commands, as you'd lose the original contents of your .bashrc file if you typed > in place of >>):

$ echo 'export NODE_PATH="./node_modules:/usr/local/lib/node_modules"' >> ~/.bashrc && source ~/.bashrc

To check if the configuration is in effect, execute:

$ echo $NODE_PATH

You should see ./node_modules:/usr/local/lib/node_modules printed out below your command. If you use a different shell than Bash, simply replace ~/.bashrc with your shell configuration file.

Step 3: Installing MongoDB

If you haven't used HomeBrew before, simply execute the following command in a Terminal window:

We will install MongoDB through howebrew. Make sure homebrew is up-to-date by executing this command:

$ brew update

Then lets install MongoDB with the following command:

$ brew install mongodb

To run MongoDB, we have to create de default data directory for our MongoDB by:

$ mkdir -p /data/db

The user monogd must have write access.

Run MongoDB on the default port (27017) with:

$ mongod

Also you can use below command:

$ brew update && brew install mongodb

Homebrew will automatically install all the dependencies for you.

Also install some other package managers:

Install Bower

You’re going to use the Bower Package Manager to manage your front-end packages, in order to install it make sure you’ve installed Node.js and npm, then install bower globally using npm:

$ npm install -g bower

Install Grunt

You’re going to use the Grunt Task Runner to automate your development process, in order to install it make sure you’ve installed Node.js and npm, then install grunt globally using npm:

$ npm install -g grunt-cli

Install Yeoman

MeanJS uses Yeoman, the web’s scaffolding tool for modern web apps.

Install Yeoman globally with:

$ npm install -g yo

Install MeanJS generator for Yeoman

$ npm install -g generator-meanjs

You are now ready to get started with the MEAN.JS generator. The generator will help you create a MEAN.JS application, a CRUD module, Angular Module, and other AngularJS/Express entities. We’ll begin with the application generator.

Step 4: Generating a Fullstack app

Make a directory for your Back End Project projects. Assuming your desktop is your de facto workspace:

$ mkdir ~/Desktop/Back End Projects && cd ~/Desktop/Back End Projects

Now that all the preparations are in place, it's time for the main event:

$ yo angular-fullstack

Step 5: Initializing local Git repository

Tell Git not to track your database:

$ echo "data" >> .gitignore

Turn the directory in which your application is located into a Git repository by running the following commands:

$ git init && git add . && git commit -am 'initial commit'

Step 6: Starting MongoDB

To start MongoDB for the first time in your app's directory, run the following commands in your terminal:

$ mkdir data && echo 'mongod --config /usr/local/etc/mongod.conf --dbpath=data --rest "$@" --httpinterface' > && chmod a+x && ./

From this point on you can simply start MongoDB by executing ./ A few things to note:
        The .conf file directs mongod to write messages to a log file instead of stdout. To view the log, run the following in a separate Terminal tab: less /usr/local/var/log/mongodb/mongo.log.
        Since we're not on Cloud9, we don't need the --nojournal option. Journaling lets you recover the database in case of a mongod crash.
        You have to make a clean database for each project. If you copied the data directory over from an earlier project, mongod will fail to start. If that's the case, just rm -rf data && mkdir data && ./

Step 7: Application Generator

Installing full stack tools

$ npm install -g express yo grunt grunt-cli generator-angular-fullstack bower

The application generator will help you create a fresh copy of a MEAN.JS application in your working folder. To create your MEAN application, navigate to a new project folder, and then use yo to generate your application:

$ yo meanjs

The generator will ask you a few questions about your new application and will generate it for you. When the installation process is over, you will be able to use grunt to run your new MEAN application:

Open a new Terminal tab by pressing T, and run the following command:

$ grunt serve

Grunt should automatically open your new Angular site's index page as soon as it finishes starting up.
Now you should be able to follow the rest of the Challenge instructions to push to GitHub and Heroku. Just ignore the part about SSH key (#33-36) and replace ~/workspace with your app directory's path.

Tuesday, November 1, 2016

HTS - High Throughput Satellite [Adoption in Mobility Startegy]

Today world is lying on mobile and Internet ecosystems together. The proliferation of web-based mobile applications necessitated mobile broadband access to the Internet, which rapidly became widely and sufficiently available to users of mobile devices, as long as they stayed within the service range of their appropriate terrestrial networks. 

Lets think on the situation from consumer stand point when mobile users got on planes, ships and land-mobiles, the bandwidth frequency, communication and Internet experience was quite different. How consumer and enterprise industry approach and dealt with the situation? HTS (High Throughput Satellite) is one of the approaching solution, which could be considered to become a game changer for Internet users in the aeronautical, maritime, and land-mobile market segments. HTS are primarily deployed to provide broadband Internet access service (point-to-point) to regions un-served or under served by terrestrial technologies where they can deliver services comparable to terrestrial services in terms of pricing and bandwidth. Let's understand what's HTS first? As per Wikipedia, HTS is a classification for communications satellites that provide at least twice, though usually by a factor of 20 or more, the total throughput of a classic FSS satellite for the same amount of allocated orbital spectrum thus significantly reducing cost-per-bit. 
The advent of high-throughput satellites (HTS) enables network service providers to offer a new generation of communications solutions. HTS systems combine the exceptional spectrum efficiency and performance of spot-beam antennas with ultra-wideband transponders to enable unprecedented levels of bandwidth and throughput. Each spot beam reuses frequencies in multiple carriers so that a single HTS spacecraft can provide five to ten times the capacity of traditional satellites. For the customer, this provides the potential to dramatically increase data rates, upwards of 100Mbps to a single site and improve application performance compared to traditional satellite based communications.

While many current HTS platforms were designed to serve the consumer broadband market, some are also offering services to government and enterprise markets, as well as to terrestrial cellular network operators who face growing demand for broadband backhaul to rural cell sites. For cellular backhaul, the reduced cost per bit of many HTS platforms creates a significantly more favorable economic model for wireless operators to use satellite for cellular voice and data backhaul. Some HTS platforms are designed primarily for the enterprise, telecom or maritime sectors. HTS can furthermore support point-to-multipoint applications and even broadcast services such as DTH distribution to relatively small geographic areas served by a single spot beam. However, in simple terms, HTS is making broadband access better, cheaper and faster.

Here we look at five main important components of HTS design strategy are:
  1. Throughput - total transmitted per seconds
  2. Efficiency - actually interdependent of throughput requirements
  3. Coverage - the region being served in spacecraft and geographically
  4. Architecture - network architecture {Star, Mesh, Loopback…}
  5. Spectrum/Efficiency - frequency in consideration into the available bandwidth network and characteristics of the spectrum 

In business terms, HTS will significantly reduce the Total Cost of Ownership (TCO) compared to yesteryear’s satellite broadband solutions in the mobile platforms space. More importantly, HTS broadband access is finally becoming competitive with its terrestrial counterparts in terms of cost and performance. But the good news is that HTS does not have to compete with terrestrial solutions in the air, sea and land mobile segments, it just needs to become as widely available as its terrestrial cousins and support comparable broadband connectivity in terms of throughput and cost. 

Takeaway from experts based on experimental outcome result and existing case-study report:
·     Next generation High Throughput Satellites include both Ku and Ka [Refer - below comparison image table].
·         There are many different variations of technologies using the Ka-band frequencies.
·         Ka is an appropriate technology for mass markets and non-industrial markets.
·      Side-by-side technical and cost comparison of Ka and Ku HTS solutions shows significant technical and cost challenges with most Ka solutions for customers with high reliability and availability needs.
·      HTS Ku platforms offer the best overall performance and value for operations for mission critical, maximum uptime networks. 

Important links to explore the purpose and needs of HTS are in detail, such as:

Thanks you for your time on staying at this page. Please be free to advise/contribute/suggest below in comment section. Will add all valuable relevant input quickly. Thanks again and look forward!