Wednesday, 12 October 2016

The raspberry pi project is complete, now a new project based on alexa voice service was started today. there are certain interfacs on avs website such as speech interface, audio or speaker or system etc.. Inn all of them JSON format data is stored or retrieved.

So to start the project i started with JSON

SON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
JSON is built on two structures:
  • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.

Tuesday, 11 October 2016

  1. Click the Start Listening button and wait for the audio cue before you begin to speak. It may take a second or two for the connection to be made before you hear the audio cue.
  2. Once you hear the audio cue, say What's the weather in Seattle? and wait. Alexa will send a StopCapture directive to the client when your intent is recognized. Then you will hear Alexa's response, which should be the current weather report for Seattle.
  3. Click the Start Listening button and wait for the audio cue. Once you hear the cue, say "Set a timer for 5 seconds" and wait. You should receive a response from Alexa, which should be "5 seconds starting now." When 5 seconds have elapsed, the timer will go off. To stop the timer, press the play/pause button directly below Start Listening.
  4. The previousplay/pause, and next buttons demonstrate music button events. Music button events allow you to initiate changes in the playback stream without having to speak to Alexa. For example, you can press the play/pause button to pause and restart a track of music. To demonstrate the play/pause button, you can speak the following command: Play DC101 on iHeartRadio, then press the play/pause button. The music will pause in response to the button press. Press the play/pause button again to restart the music.

Friday, 7 October 2016

The following instructions will walk you through building and running the Node.js server for authentication. Looking to authenticate using a mobile app instead? See instructions for Android, and iOS.
NOTE: The server implementation does not use persistent storage; everything is stored in memory. Therefore, if you shut down the server, you will lose your tokens.
To run the server, follow these instructions:
  1. Open a command prompt.
  2. Change directories to {REFERENCE_IMPLEMENTATION}/samples/companionService
  3. To install dependencies, type: npm install.
  4. In a web browser, visit the Login with Amazon developer portal.
  5. Near the top of the page, select your security profile from the drop down menu and click Confirm.
  6. Enter a privacy policy URL beginning with http:// or https://. For this example, you can enter a fake URL such as http://example.com. Optionally, you can choose to upload an image, which will be shown on the Login with Amazon consent page. Click Save.
  7. Next to Security Profile, click Show Client ID and Client Secret. This will display your client ID and client secret. Save these values.
  8. In your favorite text editor, open {REFERENCE_IMPLEMENTATION}/samples/companionService/config.js and edit the following values:
    • clientId: Paste in your client ID as a string.
    • clientSecret: Paste in your client secret as a string.
    • products: The products object consists of a key that should be the same as the product ID (also referred to as Device Type ID) that you set up in the developer portal and an array of unique product identifiers. For this project, the array should be a single value, and match the serial number you entered while generating certificates.
  9. Save the config.js.
  10. From your command prompt, run the following: npm start.
The server is running. You are now ready to run the sample app.

Wednesday, 5 October 2016

After all the stuff at amazon website, now the main work is of terminal.

  1. Download and install OpenSSL.
  2. Add the OpenSSL bin folder to the Windows PATH (see environment variables).
  3. Edit the ssl.cnf configuration file with your favorite text editor. Replace any placeholder values that start with YOUR_.
    Note: countryName must be two characters (e.g. US). If it is not two characters, certificate creation will fail. Additionally, if you will be accessing your device from any IP or DNS entry besides localhost (127.0.0.1 or 10.0.2.2), you must add the additional IP or or DNS entries to [alt_names]. One situation where you will need to add entries to [alt_names] is if you are going to authenticate using an Android or iOS companion app from a device instead of from the Android or iOS emulators on the same machine as the Node.js server and sample app.
  4. Open a command prompt.
  5. Change directories to {REFERENCE_IMPLEMENTATION}\samples\javaclient.
  6. Type: set OPENSSL_CONF={OpenSSL installation location}\bin\openssl.cfg.
  7. Run the certificate generation script: generate.bat.
  8. During generation you will be prompted for some information (save this information -- you'll need it later):
    • When prompted for a productID, enter the productID (or Device Type ID) listed under "Device Type Info" in the Amazon developer portal.
    • When prompted for a serial number, enter your product's serial number. For prototyping purposes we recommend using: 123456.
    • When prompted for a password, create a password (just don't forget it -- you'll need this soon). For prototyping purposes we recommend leaving password blank.
  9. Edit the configuration file for the Node.js server. The configuration file is located in {REFERENCE_IMPLEMENTATION}\samples\companionService\config.js.
    • Set sslKey to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.key.
    • Set sslCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.crt.
    • Set sslCaCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.
  10. Edit the configuration file for the sample app. The configuration file is located at {REFERENCE_IMPLEMENTATION}\samples\javaclient\config.json.
    • Set companionApp.sslKeyStore to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\jetty.pkcs12.
    • Set companionApp.sslKeyStorePassphrase to the password entered in the certificate generation script.
    • Set companionService.sslClientKeyStore to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\client\\client.pkcs12.
    • Set companionService.sslClientKeyStorePassphrase to the password entered in the certificate generation script.
    • Set companionService.sslCaCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.

Tuesday, 4 October 2016

After generating private key and certificate a security profile and device is created on amazon with the product id, client id and client secret.
this takes a long time.

Monday, 3 October 2016

After installing the dependencies, a sample app is to be downloaded from the amazon developer site which has the java client.

Now openssl is installed for the certificates and the key which will be used to connect to ALEXA.

OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. For more information about the team and community around the project, or to start making your own contributions, start with the community page. To get the latest news, download the source, and so on, please see the sidebar or the buttons at the top of every page.
The OpenSSL toolkit is licensed under an Apache-style license, which basically means that you are free to get and use it for commercial and non-commercial purposes subject to some simple license conditions.