Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Latest commit

 

History

History
122 lines (78 loc) · 5.83 KB

File metadata and controls

122 lines (78 loc) · 5.83 KB

Close call reporter in Java*

What it is

Using a compatible Intel-based platform, this project lets you create a close-call fleet driving reporter that:

  • monitors the Grove* IR Distance Interrupter;
  • monitors the Grove* GPS;
  • keeps track of close calls and logs them using cloud-based data storage.

First time setup

For all the samples in this repository, see the General Setup Instructions for required boards and libraries.

Hardware requirements

Grove*

Sensor Pin
Grove* IR Distance Interrupter D2
Grove* GPS UART port

DFRobot*

Sensor Pin
IR Distance Sensor D4
GPS cable TX (white) RX pin
GPS cable RX (black) TX pin
GPS cable power (red) 5V pins
GPS cable ground (thicker black) GND

More details on the hardware requirements can be found in the project README

Software requirements

  1. Intel® System Studio
  2. MRAA and UPM
  3. Microsoft Azure*, IBM Bluemix*, AT&T M2X*, AWS*, Predix*, or SAP* account (optional)

Configuring the example

Clone the repo

Clone the How-To Code Samples repository with Git* on your computer as follows:

$ git clone https://github.com/intel-iot-devkit/how-to-code-samples.git To download a .zip file, in your web browser go to https://github.com/intel-iot-devkit/how-to-code-samples and click the Download ZIP button at the lower right. Once the .zip file is downloaded, uncompress it, and then use the files in the directory for this example.

Set up the source files

You now need to copy the source files and the config file to the project. Drag all of the files from your git repository's "src" folder into the new project's src folder in Intel® System Studio. Make sure previously auto-generated main class is overridden.

The project uses the following external jars: gson-2.6.1. These can be found in the Maven Central Repository. Create a "jars" folder in the project's root directory, and copy all needed jars in this folder. In Intel® System Studio, select all jar files in "jars" folder and right click -> Build path -> Add to build path

Now you need to add the UPM jar files relevant to this specific sample. right click on the project's root -> Build path -> Configure build path. Java Build Path -> 'Libraries' tab -> click on "add external JARs..."

for this sample you will need the following jars:

  1. upm_ublox6.jar
  2. upm_rfr359f.jar

The jars can be found at the IOT Devkit installation root path\iss-iot-win\devkit-x86\sysroots\i586-poky-linux\usr\lib\java

Preparing your target platform before running the project

In order for the sample to run you will need to copy some files to your board. This can be done using SCP through SSH.
Two sorts of files need to be copied from the sample repository:

  1. Jar files- external libraries in the project need to be copied to "/usr/lib/java"

Set the kit

To configure the example for the specific hardware kit that you are using, either Grove* or DFRobot* you will need to change the INTEL_IOT_KIT key in the config.properties file to either GROVEKIT (this is the default) or DFROBOTKIT, depending on which hardware kit you wish to use. For example:


  INTEL_IOT_KIT=GROVEKIT

Expected output

You will see output similar to below when the program is running.

close call at $GPGGA,022655.000,3405.0861,N,11816.6856,W,2,8,1.07,154.4,M,-33.6,M,0000,0000*65
Connecting to MQTT server...
MQTT message published: { d: { value: '2016-04-22T02:26:56.373Z $GPGGA,022655.000,3405.0861,N,11816.6856,W,2,8,1.07,154.4,M,-33.6,M,0000,0000*65\r'
} }

IoT cloud setup (optional)

You can optionally store the data generated by this sample program using cloud-based IoT platforms from Microsoft Azure*, IBM Bluemix*, AT&T M2X*, AWS*, Predix*, or SAP*.

For information on how to connect to your own cloud server, go to:

https://github.com/intel-iot-devkit/iot-samples-cloud-setup

Data store server setup (optional)

Optionally, you can store the data generated by this sample program in a back-end database deployed using Microsoft Azure*, IBM Bluemix*, or AWS* along with Node.js*, and a Redis* data store.

For information on how to set up your own cloud data server, go to:

https://github.com/intel-iot-devkit/intel-iot-examples-datastore

Running the example with the cloud server

To run the example with the optional back-end data store, you need to change the SERVER and AUTH_TOKEN keys in the config.properties file to the server URL and authentication token that correspond to your own data store server setup. For example:


  SERVER=http://intel-examples.azurewebsites.net/logger/close-call
  AUTH_TOKEN="YOURTOKEN"

Now, when you run your program using the Run button, it should be able to call your server to save the data right from the target.

IMPORTANT NOTICE: This software is sample software. It is not designed or intended for use in any medical, life-saving or life-sustaining systems, transportation systems, nuclear systems, or for any other mission-critical application in which the failure of the system could lead to critical injury or death. The software may not be fully tested and may contain bugs or errors; it may not be intended or suitable for commercial release. No regulatory approvals for the software have been obtained, and therefore software may not be certified for use in certain countries or environments.