Gaurav Mishra
Published © CC BY-SA

Cloud connected vaccine monitoring

Over the cloud using data analytics we can predict if a vaccine vial is about to get spoiled (predictive analysis), so that it can be moved

ExpertFull instructions provided2,430
Cloud connected vaccine monitoring

Things used in this project

Story

Read more

Schematics

Intel Galileo

Connect to groove base shield and insert sensors

Code

Vaccine-SNS Code

Java
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...

We added the SNS project in the same workspace as that of the Rest Services. The SNS Java code is attached as the zip file Vaccine-SNS.zip.

To use the sample given by Amazon with minimal changes, we passed the message from Rest Service as a parameter 'msg_EC2'.

In the java file SNSMobilePush.java, we read the message from the Rest Service into the variable 'msg_EC2'. To account for this extra parameter, we edited the method signatures in couple of the files imported (AmazonSNSClientWrapper.java, SampleMessageGenerator.java) by SNSMobilePush.java. The rest of the sample code given by Amazon is kept as is.

The method setData() inside SampleMessageGenerator.java, is used inside the rest service java code to set the message to be sent to the phone:

public static void setData() {

this.msg_EC2 = msg_EC2;

}

Note: In the Rest Service code I uploaded here, VaccineService.zip, the setData() call is not added. You can add this method directly in the controller, or create files in /service and /repo folders as per MVC convention to read the sensor data from the Controller and then let SNS copy it from the setData() method inside the /service file.
No preview (download only).

Code in Intel XDK IoT to read sensor value and write to peripherals

JavaScript
To install libraries you need to run commands on the board:

(a) Do a putty to the board. Keep the baud as 115200, 8 and 115200

(b) Do an ls in / to confirm the yokto is installed

> cd /

> ls

(c) You may need to update the packages to ensure the sensor reading and device writings are working fine:

> opkg update

> opkg upgrade

(b) To install ndoejs modules:

> npm -g install

> npm link
No preview (download only).

REST service for this project.

Java
File VaccineService.zip contains the java and jsp code for the REST service for this project.

Steps to setup Rest Service on EC2 --

1. Setting up EC2 - http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/get-set-up-for-amazon-ec2.html
2. Start a Windows Instance - http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.html

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-rest-based-json-services-with-responsebody/
No preview (download only).

Credits

Gaurav Mishra

Gaurav Mishra

4 projects • 17 followers
Student of electronics engineering

Comments

Add projectSign up / Login