Monday, November 9, 2015
HOW TO SETUP AMAZON WEB SERVICES
Setting up Amazon Web Services (Amazon Cloud) - Rest Service on EC2
We have set up a Rest Service on AWS EC2, to communicate between the Galileo Board and Cloud.
Steps to setup Rest Service on EC2 --
1. Setting up EC2 - http://docs.aws.amazon.com/AWSEC2/latest/WindowsGu...
2. Start a Windows Instance -http://docs.aws.amazon.com/AWSEC2/latest/WindowsGu...
3. Create a Rest Web Service - We created a J2EE REST Webservice (Spring MVC Framework) using Eclipse, and ran it on Tomcat. Follow the tutorial here to setup the service - http://codetutr.com/2013/04/09/spring-mvc-easy-res...
HOW TO PUSH NOTIFICATIONS TO THE ANDROID PHONE
Push Notification Service to Android Phone - Amazon AWS SNS and GCM
We have used Amazon SNS to take values from the rest service in EC2, and push it to Android Phone using GCM (Google Cloud Messaging Service)
1. Setting up SNS: http://aws.amazon.com/sns/getting-started/
2. Setting up GCM: http://docs.aws.amazon.com/sns/latest/dg/mobile-p...
WRITING CODE IN INTEL XDK
Writing Code in Intel XDK IoT to read sensor value and write to peripherals
HOW TO CONNECT GROVE SENSORS TO THE GALILEO BOARD
Connecting Grove Sensors to Galileo Board
1. We have used Grove Starter Kit Plus - Intel® IoT Edition:http://www.seeedstudio.com/depot/Grove-starter-kit...
2. Understand the Grove shield and sensor in more detail:http://www.seeedstudio.com/wiki/Grove_-_Starter_Ki...
3. One important thing to understand when connecting a sensor to the Grove Base Shield and the sensors: There are two types of sensors: Analog and Digital. Depending on this, the sensor needs to be connected to the Analog or the Digital pin. If you connect the sensor to the wring ping, the program won't complain, and you will get results back from the sensor as well. But the result won't be accurate. Hence, you need to very careful about connecting the right sensor to the right pin.
4. Reading from the sensors and Writing to the sensors: Arduino Wiring and the Intel XDK SDKs have made writing code for these very simplified. You need just one line of code to do reading and writing. But doing this in the proper way can be tricky.
Reading and writing the sensor values - With sensors we are monitoring the motion. That means, we are reading/writing the sensor values at regular intervals. Setting this interval of reading/writing is tricky.
Reading - If you set the interval too short, for reading some values will be captured by your program, but not all. This is because, the speed the reading loop in the program is much higher than the physical capacity of the sensor to read environment parameter (temperature, motion, sound, etc.). But, skipping one or two values won't affect your program logic much. Hence, you won't even understand this is happening.
Writing - But when you are trying to write to an output device (buzzer, LED, etc.), if the interval is too short and you are running a code toggling the value (ON in one round, OFF in the second) to be written, the device may not behave properly. This is because of the hardware speed limitation. By the time the device, say buzzer, get the command of on turning ON, before even it triggers the physical sounds, the OFF command reaches it. Hence, you may need to do some trial and error to set the interval here.
WHAT ARE GROVE SENSORS?
Grove is a modulated, ready-to-use tool set. Much like Lego, it takes a building block approach to assembling electronics. Compared with the traditional, complicated learning method of using a breadboard and various electronic components to assemble a project, Grove simplifies and condenses the learning process significantly. The Grove system consists of a base shield and various modules with standardized connectors. The base shield allows for easy connection of any microprocessor input or output from the Grove modules, and every Grove module addresses a single function, such as a simple button or a more complex heart rate sensor. Each one comes with clear documentation and demo code to help you get started quickly. The Grove system also offers stand-alone mixer packs (Grove - Mixer Pack and Grove - Mixer Pack V2) that include a set of Grove modules that can be connected with each other to circuits without having to use a base shield of any sort. This way, various projects and circuits that do not need micro-controllers or microprocessors can be built.The grove sensors used for the project are:
GROVE SENSORS FOR MOTION SENSING:
Sensors in this category enable your microcontroller to detect motion, location and direction. You can make the movement of your microcontroller understandable in three dimensional spaces or determine which direction is up with the help of a 3-axis accelerometer and compass.
HOW TO BUILD AN ANDROID APP
1)SETUP THE ENVIRONMENT:
Before you start this class, be sure you have your development environment set up. You need to:
- Download Android Studio.
- Download the latest SDK tools and platforms using the SDK Manager.
2)HOW TO GET STARTED
http://developer.android.com/training/basics/firstapp/creating-project.html.
3)HOW TO RUN THE APP
http://developer.android.com/training/basics/firstapp/running-app.html.
4)HOW TO BUILD A SIMPLE USER INTERFACE
http://developer.android.com/training/basics/firstapp/building-ui.html.
5)STARTING ANOTHER ACTIVITY
http://developer.android.com/training/basics/firstapp/starting-activity.html.
HOW TO SETUP A GALILEO BOARD
Setup Intel Galileo Gen 2 Board (Arduino Sketch 6.1) on Windows 8.1 64 bit
1. Get the Latest guide from https://software.intel.com/en-us/iot/hardware/gal...
2. Software Download - http://www.intel.com/support/galileo/sb/CS-035101...
3. Do the following before connecting SD card to the board --
a. Install Arduino Driver - ....\IntelArduino-1.6.0-Windows\arduino-1.6.0+Intel\drivers
b. Follow the latest guide above till the Blink LED example.
4. Do the following after connecting SD card to the board --
a. After you connect the SD card, the Galileo COM port will disappear in Device Manager, and a CDC Serial Driver will appear in Unknown Devices
b. Install CDC Driver -
b1. In 'My Computer' you will see SD Card has appeared as a Removable Disk -> GoTo folder win-driver, copy iotdk-serial-external.zip into your local, unzip it.
b2. In Device Manager, right click on CDC Serial Driver --> Click Update driver --> Choose 'Browse Computer ..' --> Browse to the folder, where you have unzipped the above file.
b3. Refresh Device Manager - Action Menu - Scan for Hardware changes
5. Connect to Internet:
a. Using Terminal (Putty) - https://software.intel.com/en-us/articles/getting...
b. Connect to Internet - https://software.intel.com/en-us/articles/getting...
c. Connecting to WiFi - https://software.intel.com/en-us/articles/getting... (If it is not working, you will need to disable any Internet proxy you have turned on)
WORKING OF THE PROJECT
Connect the Galileo board directly to the phone using Bluetooth. In remote areas, where Internet connectivity is absent, the data from the sensors will be stored inside the phone's SD card over Bluetooth. Also, the data can be stored inside the IoT board itself. Later when the person is in Internet zone, the data will be pushed to the cloud.
An Android app for the person who is tracking the child or another person: An android application is used to connect to the person using the band.After registering the location of the person using the app,the information is pushed to the cloud.
DIFFERENT COMPONENTS OF THE POJECT
1)CLOUD CONCEPTS
All the data that is being recorded by the sensors is pushed to the cloud.The data is analyzed by the cloud and is stored using an application.
2)SENSORS:
GPS sensors are added to track the movement of the person, generating more insights. The amount of information gathered from the sensors in an absolutely non-intrusive way is very effective in such ground level scenarios.A buzzer is used to raise alert.
3)SOFTWARE COMPONENTS:
Components used: 1. Intel XDK for IoT to write JavaScript programs to run on Galileo 2. Putty to run setup commands and install npm modules on Galileo 3. Android SDK to write Android App to receive Push Notifications from the Cloud 3. Java to write Restful web services to receive data from Galileo 4. Linux programming on Amazon EC2 to setup Amazon cloud for data analysis 5. Apache Tomcat to run Restful web services to receive data from Galileo 6. Elastic search algorithm in Java setup to do data analysis for huge amount of data 7. NoSQL database setup to store the received data 8. HTML5 CSS programming to setup Kibana dashboard displaying real-time processed data with intuitive details 9. Java program to enable real time Push Notification to Android Phones using Amazon SNS and Google Cloud Messaging Service (GCM) 10. OS used: Windows 8, Linux. 11. We have done a full setup of Intel Analytics Cloud as well, but since the connectivity was intermittent, we moved to AWS.
4)HARDWARE COMPONENTS:
GPS sensors are added to track the movement of the person, generating more insights. The amount of information gathered from the sensors in an absolutely non-intrusive way is very effective in such ground level scenarios.A buzzer is used to raise alert.
3)SOFTWARE COMPONENTS:
Components used: 1. Intel XDK for IoT to write JavaScript programs to run on Galileo 2. Putty to run setup commands and install npm modules on Galileo 3. Android SDK to write Android App to receive Push Notifications from the Cloud 3. Java to write Restful web services to receive data from Galileo 4. Linux programming on Amazon EC2 to setup Amazon cloud for data analysis 5. Apache Tomcat to run Restful web services to receive data from Galileo 6. Elastic search algorithm in Java setup to do data analysis for huge amount of data 7. NoSQL database setup to store the received data 8. HTML5 CSS programming to setup Kibana dashboard displaying real-time processed data with intuitive details 9. Java program to enable real time Push Notification to Android Phones using Amazon SNS and Google Cloud Messaging Service (GCM) 10. OS used: Windows 8, Linux. 11. We have done a full setup of Intel Analytics Cloud as well, but since the connectivity was intermittent, we moved to AWS.
4)HARDWARE COMPONENTS:
1. Intel Galileo board
2.Grove kit and sensors
3. WiFi card
c. The Dev Kit.
All the hardware components listed above came in the Dev Kit.
Subscribe to:
Posts (Atom)