Friday, February 26, 2016

Importance of the application and Issues faced


As we know many of the software and hardware applications  are of event based type,Which means when breakdown event  occurs then  application react.But our application is  predictive.

Uniqueness and use of this application are:

1.This is a predictive and also this will help user before break down occurs and also the same data will be stored in the cloud. to further analyse about the condition of the vehicle.
2.This application wont require any user input from user .

Issues faced :

1.While using Java programming to interact with the Hardware
  for reading the values from the sensors especially when using distance measurement sensor(these sensors use transceivers) because of sleep time. So we prefer to use Python script/C programme to interact with sensors.

2.While Reading GPS coordinates
  GPS receiver module must be of high accurate and if there is a mistakes in GPS device driver installation and also in installing pynmea drivers we faced the too many problems.
So be careful while choosing GPS module and in installing the drivers.

3.In client side : when clients are listening to particular topic and when server sends the values then all the clients registered to the topic  were getting the information.


Thursday, February 25, 2016

Hardware Setup - Raspery PI , GPS device and Fuel Measurement Device

Hardware Information

GPS Device: Navilock NL-302U USB GPS Receiver
For More Info see the below URL:
http://www.navilock.de/produkte/F_781_USB_61422/merkmale.html?setLanguage=en

Fuel Measurement Device : Ultrasonic sensor HC SR04
For More Info see the below URL: 
https://docs.google.com/document/d/1Y-yZnNhMYy7rwhAgyL_pfa39RsB-x2qR4vP8saG73rE/edit#bookmark=id.jpmytl26g9el

Demo on complete set-up




Location Finder using Navilock GPS module



   GPS Driver installation Steps

 

 

 

OSGI Service to read the GPS coordinates (Latitude and Longitude)


<?xml version="1.0" encoding="UTF-8"?>
                <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate"         deactivate="deactivate" immediate="true" name="com.iot.sample">
                                <implementation class="com.iot.internal.sample.Component"/>
                                                <reference bind="setPositionService" cardinality="1..1" interface="org.eclipse.kura.position.PositionService" name="PositionService" policy="static" unbind="unsetPositionService"/>
   </scr:component>
  
    public class Component {

                                private PositionService m_positionService;

                                private final Logger logger = LoggerFactory.getLogger(Component.class);
                               
                                public void activate(ComponentContext componentContext, Map<String, Object> properties) {
                                                //no-op
                                }

                                public void deactivate(ComponentContext componentContext) {
                                                //no-op
                                }
                                public void setPositionService(PositionService positionService) {
                                                m_positionService = positionService;
                                                GPSDevice gpsDevice=new GPSDevice(m_positionService.getNmeaPosition());
                                                logger.info("latitude -------------------->" + gpsDevice.getLatitude());
                                                logger.info("longitude-------------------->" + gpsDevice.getLongitude());
                                }

                                public void unsetPositionService(PositionService positionService) {
                                                m_positionService = null;
                                }
   }

                public class GPSDevice {
                                private final NmeaPosition nmeaPosition;

                                public GPSDevice(final NmeaPosition nmeaPosition) {
                                                this.nmeaPosition=nmeaPosition;
                                }


                                public double getLatitude() {
                                                return nmeaPosition.getLatitude();
                                }
                                public double getLongitude() {
                                                return nmeaPosition.getLongitude();
                                }              }

 

GPS coordinates reading using Kura PositionService