Skip to content

Sensor Data Use

mdii edited this page Sep 17, 2014 · 11 revisions

System requirements

LSM-LIGHT.client requires Java JDK 1.6 or later version. However, we recommend using Java JDK 1.7.

Download

LSM-LIGHT.client can be downloaded as Java JAR from the LSM Home page or OpenIoT binary distribution repository: https://github.com/OpenIotOrg/openiot/tree/develop/utils/lib

Deployment

LSM-LIGHT server deployment on JBoss AS 7.0

Deploy: To deploy the LSM-LIGHT.SERVER on JBoss AS 7.0, copy the lsm-light.server to the server's standalone/deployments directory.

Undeploy: To undeploy the application, you need to remove the .deployed marker file that is generated upon successful deployment of the scheduler module.

You can find more detailed directions on the ins and outs of deployment on JBoss AS7 here.

LSM-LIGHT client side deployment

Export lsm-light.client source code to jar file by Maven

  1. Open a command line interface and navigate to the root directory of the scheduler Project. For example: (/Git3/modules/lsm-light/lsm-light.client)
  2. Install using maven (in Command Prompt or from Eclipse or other IDE) to build the lsm-light.client.jar file of LSM-LIGHT.client source code.
  • For command prompt:

               ** mvn clean package install**
    

(for example: XXX@ubuntu:~/Git3/modules/lsm-light/lsm-light.client$ mvn clean package install )

The lsm-light.jar file is generated in the target folder inside our ‘modules’ folder. For example: (/Git3/modules/lsm-light/lsm-light.client/target/lsm-light.client-0.0.1.jar).

Alternative: Install using maven from Eclipse

  1. Import Existing maven project File>Import>Maven>Existing Maven Projects
  2. Click the “Browse” button and navigate to the commons’s source code directory that has been previously downloaded.
  3. Choose the lsm-light.client and click the Finish button.
  4. Right click on the lsm-light.client project and choose Run As>Maven Install Now you are ready to use this library from the Other OpenIoT modules.

The LSM API is used by the Scheduler, SDUM and X-GSN. In order to communicate with your LSM server side, please attach the LSM API into your project’s library and follow the examples mentioned in Developer-Manual section (3.3.2.1) to insert and retrieve OpenIoT data from LSM server.

Security Configuration

Service

In order to use the LSM server, a REST service must be created for it. When the OpenIoT graph is initialized, a REST service is created for the LSM with the following key and secret as defined in the security-cinfig.ini in the section delimited by @BEGIN-lsm-server and @END-lsm-server:

  • casOauthClient.key=lsm-server
  • casOauthClient.secret=lsm-server.secret

Permissions

The following permissions are created upon initialization of the OpenIoT graph for the LSM Server.

Permission Description
"lsm-light.server.main:addSensor" add new sensors
"lsm-light.server.main:addTriples" insert triples
"lsm-light.server.main:updateSensorData" add new sensor reading
"lsm-light.server.main:getSensor" retrieve sensor
"lsm-light.server.main:delSensor" delete sensor
"lsm-light.server.main:delReading" delete sensor reading
"lsm-light.server.main:delTriples" delete triples

Roles

The role "xgsn-role" is created upon initialization of the OpenIoT graph for the XGSN service on the LSM service. The permission "lsm-light.server:all" is assigned to this role.

User

Upon initialization of the OpenIoT graph, a default user is created for the LSM Server as defined in the openiot.properties:

  • security.initialize.lsmserver.username=lsmuser
  • security.initialize.lsmserver.password=lsmuserpass
Clone this wiki locally