Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OM2M/Starting"

(Configuration)
(Gateway (GSCL) configuration)
 
(21 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
 +
 +
= Prerequisites =
 +
* JAVA 1.7 or later is required to run OM2M.
  
 
= Configuration  =
 
= Configuration  =
Line 14: Line 17:
 
| org.eclipse.om2m.sclBaseAddress || NSCL ip address || 127.0.0.1
 
| org.eclipse.om2m.sclBaseAddress || NSCL ip address || 127.0.0.1
 
|-
 
|-
| org.eclipse.equinox.http.jetty.http.port || NSCL listening port || 8080
+
| org.eclipse.equinox.http.jetty.http.port || NSCL HTTP listening port || 8080
 +
|-
 +
| org.eclipse.om2m.coap.port || NSCL CoAP listening port || 5683
 
|-
 
|-
 
| org.eclipse.om2m.sclBaseContext|| NSCL listening context|| /om2m
 
| org.eclipse.om2m.sclBaseContext|| NSCL listening context|| /om2m
Line 20: Line 25:
 
| org.eclipse.om2m.dbDriver|| NSCL Database driver || org.h2.Driver
 
| org.eclipse.om2m.dbDriver|| NSCL Database driver || org.h2.Driver
 
|-
 
|-
| org.eclipse.om2m.dbUrl|| NSCL Database file location || jdbc:h2:./database/db
+
| org.eclipse.om2m.dbUrl|| NSCL Database file location || jdbc:h2:./database/nscdb
 
|-
 
|-
 
| org.eclipse.om2m.dbUser|| NSCL Database user name || om2m
 
| org.eclipse.om2m.dbUser|| NSCL Database user name || om2m
Line 32: Line 37:
 
| org.eclipse.om2m.sclBaseProtocol.default|| NSCL Default communication protocol|| http
 
| org.eclipse.om2m.sclBaseProtocol.default|| NSCL Default communication protocol|| http
 
|-
 
|-
| org.eclipse.om2m.maxNrOfInstances|| NSCL Maximum number of instances stored in a ContentInstances resource|| 1000
+
| org.eclipse.om2m.maxNrOfInstances|| Maximum number of content instances in a Container || 1000
 
|-
 
|-
 
| org.eclipse.om2m.adminRequestingEntity|| NSCL Default admin requesting entity. (username / password)|| admin:admin
 
| org.eclipse.om2m.adminRequestingEntity|| NSCL Default admin requesting entity. (username / password)|| admin:admin
Line 52: Line 57:
 
|-
 
|-
 
| org.eclipse.equinox.http.jetty.http.port|| GSCL listening port|| 8181
 
| org.eclipse.equinox.http.jetty.http.port|| GSCL listening port|| 8181
 +
|-
 +
| org.eclipse.om2m.coap.port || GSCL CoAP listening port || 5684
 
|-
 
|-
 
| org.eclipse.om2m.sclBaseContext|| GSCL listening context|| /om2m
 
| org.eclipse.om2m.sclBaseContext|| GSCL listening context|| /om2m
Line 57: Line 64:
 
| org.eclipse.om2m.dbDriver|| GSCL Database driver || org.h2.Driver
 
| org.eclipse.om2m.dbDriver|| GSCL Database driver || org.h2.Driver
 
|-
 
|-
| org.eclipse.om2m.dbUrl|| GSCL Database file location || jdbc:h2:./database/db
+
| org.eclipse.om2m.dbUrl|| GSCL Database file location || jdbc:h2:./database/gscldb
 
|-
 
|-
 
| org.eclipse.om2m.dbUser|| GSCL Database user name || om2m
 
| org.eclipse.om2m.dbUser|| GSCL Database user name || om2m
Line 65: Line 72:
 
| org.eclipse.om2m.dbReset || GSCL Database reset when starting || true
 
| org.eclipse.om2m.dbReset || GSCL Database reset when starting || true
 
|-
 
|-
| org.eclipse.om2m.sclBaseId|| Gateway SclBase resource id|| gscl
+
| org.eclipse.om2m.sclBaseId|| GSCL SclBase resource id|| gscl
 
|-
 
|-
 
| org.eclipse.om2m.sclBaseProtocol.default|| GSCL default communication protocol|| http
 
| org.eclipse.om2m.sclBaseProtocol.default|| GSCL default communication protocol|| http
 
|-
 
|-
| org.eclipse.om2m.maxNrOfInstances|| Maximum number of instances stored in a ContentInstances resource|| 1000
+
| org.eclipse.om2m.maxNrOfInstances|| Maximum number of content instances in a Container|| 1000
 
|-
 
|-
 
| org.eclipse.om2m.adminRequestingEntity|| Default GSCL admin requesting entity. (username / password)|| admin:admin
 
| org.eclipse.om2m.adminRequestingEntity|| Default GSCL admin requesting entity. (username / password)|| admin:admin
Line 76: Line 83:
 
|}
 
|}
  
* The GSCL configuration file contains 4 additional parameters to specify the remote NSCL to which the GSCL should be authenticated.
+
* The GSCL configuration file contains 5 additional parameters to specify the remote NSCL to which the GSCL should be authenticated.
 
{| width="90%" class="wikitable"
 
{| width="90%" class="wikitable"
 
! Parameter
 
! Parameter
 
! Description
 
! Description
 
! Example
 
! Example
 +
|-
 +
| org.eclipse.om2m.nsclAuthentication|| Authenticate GSCL to NSCL || true
 
|-
 
|-
 
| org.eclipse.om2m.remoteNsclId|| Remote NSCL Id|| nscl
 
| org.eclipse.om2m.remoteNsclId|| Remote NSCL Id|| nscl
Line 94: Line 103:
 
* You can configure multiple GSCLs by setting different identifiers.
 
* You can configure multiple GSCLs by setting different identifiers.
  
== Multiple gateways configuration==
+
= Startup  =
 +
== NSCL startup ==
 +
 
 +
* Go to the NSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>".
 +
* Start the NSCL by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
 +
 
 +
* Once the NSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles. Type "exit" to shutdown.
 +
[[File:OM2M-start-NSCL.jpg|center|600px|thumb|NSCL OSGi console]]
 +
 
 +
* Open your browser and connect to the address "127.0.0.1:8080" to access the NSCL web interface.
 +
* Enter username "admin" and password "admin" then click on login button to display the NSCL resource tree.
 +
 
 +
[[File:OM2M-web-authentication.jpg|center|300px|thumb|NSCL web interface: authentication]]
 +
 
 +
* After a successful authentication, the NSCL resource will be displayed. You can see the "nscl" SclBase sub-resources and attributes.
 +
* You can disconnect by clicking on the "Logout" button.
 +
 
 +
[[File:OM2M-web-nscl.jpg|center|500px|thumb|NSCL web interface: nscl sclBase resource]]
 +
 
 +
== GSCL startup==
 +
* Go to the GSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/arch>".
 +
* Start the GSCL by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
 +
 
 +
* Once the GSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles.
 +
* The GSCL automatically authenticate to the remote NSCL specified in the gateway configuration file. If the NSCL is not already running, the GSCL keep sending authentication requests (A request each 10 seconds).
 +
* After a successful authentication, the “gscl” resource is added to the “nscl/scls” collection, and respectively the “nscl” resource is added to the “gscl/scls” collection. You can now access the registered GSCL resource from the NSCL web interface under the “nscl/scls/gscl” uri.
 +
* Using the NSCL web interface you can seamlessly access to all authenticated gateways. Open the "nscl/scls" resource to display available GSCLs . You notice the existence of one authenticated GSCL with id "gscl".
 +
 
 +
[[File:OM2M-web-scls.jpg|center|600px|thumb|NSCL web interface: Scls resource]]
 +
 
 +
* Click on the "gscl" resource to display remote GSCL sub-resources and attributes. You can click on the “gscl” button of the “link” attribute to connect to the GSCL resources tree.
 +
 
 +
[[File:OM2M-web-scls-gscl.jpg|center|600px|thumb|NSCL web interface: remote gscl resource]]
 +
 
 +
* The GSCL resource tree will be displayed. At this moment, the NSCL will act as a proxy to retarget your requests to the GSCL.
 +
 
 +
[[File:OM2M-web-gscl.jpg|center|500px|thumb|NSCL web interface: gscl sclBase resource]]
 +
 
 +
* Initially, also the GSCL contains the SclBase resource (id=gscl), the AccessRight resource (id=AR_ADMIN), and other empty collections.
 +
 
 +
= Multiple gateways scenario=
  
 
* Let's consider a simple M2M system composed of a server and two gateways as follows:
 
* Let's consider a simple M2M system composed of a server and two gateways as follows:
Line 139: Line 188:
 
</pre>
 
</pre>
  
= Startup  =
+
* You can start the system as follows:
== NSCL startup ==
+
** Start the NSCL product.
 +
** Start the GSCL1 product.
 +
** Start the GSCL2 product.
  
* '''JAVA 1.7 is required to run OM2M.'''
+
*Open the NSCL web interface on 192.168.0.2:8080.
* Go to the NSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>".
+
*Go to the "nscl/scls" resource to see the authenticated gateways. You will find gscl1 and gscl2 authenticated.
* You can start the NSCL using the native launcher or by invoking the JVM as follows:
+
<pre>
+
java -jar -ea -Declipse.ignoreApp=true -Dosgi.clean=true -Ddebug=true plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -console -noExit
+
</pre>
+
* Once the NSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles. Type "exit" to shutdown.
+
[[File:OM2M-start-NSCL.jpg|center|600px|thumb|NSCL OSGi console]]
+
  
* Open your browser and connect to the address "127.0.0.1:8080" to access the NSCL web interface.
+
*You can access now each authenticated GSCL by clicking on the GSCL (eg. nscl/scls/gscl1).  
* Enter username "admin" and password "admin" then click on login button to display the NSCL resource tree.
+
 
+
[[File:OM2M-web-authentication.jpg|center|300px|thumb|NSCL web interface: authentication]]
+
 
+
* After a successful authentication, the NSCL resource will be displayed. You can see the "nscl" SclBase sub-resources and attributes.
+
* You can disconnect by clicking on the "Logout" button.  
+
  
[[File:OM2M-web-nscl.jpg|center|500px|thumb|NSCL web interface: nscl sclBase resource]]
+
*Click on the "link" button to access remotely the gateway resource tree.
 
+
== GSCL startup==
+
* '''JAVA 1.7 is required to run OM2M.'''
+
* Go to the GSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/arch>".
+
* Start the GSCL with the same command used for the NSCL.
+
 
+
* Once the GSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles.
+
* The GSCL automatically authenticate to the remote NSCL specified in the gateway configuration file. If the NSCL is not already running, the GSCL keep sending authentication requests (A request each 10 seconds).
+
* After a successful authentication, the “gscl” resource is added to the “nscl/scls” collection, and respectively the “nscl” resource is added to the “gscl/scls” collection. You can now access the registered GSCL resource from the NSCL web interface under the “nscl/scls/gscl” uri.
+
* Using the NSCL web interface you can seamlessly access to all authenticated gateways. Open the "nscl/scls" resource to display available GSCLs . You notice the existence of one authenticated GSCL with id "gscl".
+
 
+
[[File:OM2M-web-scls.jpg|center|600px|thumb|NSCL web interface: Scls resource]]
+
 
+
* Click on the "gscl" resource to display remote GSCL sub-resources and attributes. You can click on the “gscl” button of the “link” attribute to connect to the GSCL resources tree.
+
 
+
[[File:OM2M-web-scls-gscl.jpg|center|600px|thumb|NSCL web interface: remote gscl resource]]
+
 
+
* The GSCL resource tree will be displayed. At this moment, the NSCL will act as a proxy to retarget your requests to the GSCL.
+
 
+
[[File:OM2M-web-gscl.jpg|center|500px|thumb|NSCL web interface: gscl sclBase resource]]
+
 
+
* Initially, also the GSCL contains the SclBase resource (id=gscl), the AccessRight resource (id=AR_ADMIN), and other empty collections.
+

Latest revision as of 05:38, 4 April 2015

Prerequisites

  • JAVA 1.7 or later is required to run OM2M.

Configuration

Server (NSCL) configuration

  • Go to the NSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>".
  • Edit the file “configuration/config.ini” to configure the NSCL. (You can keep the current configuration for a local demo)
Parameter Description Example
org.eclipse.om2m.sclType SCL type NSCL
org.eclipse.om2m.sclBaseAddress NSCL ip address 127.0.0.1
org.eclipse.equinox.http.jetty.http.port NSCL HTTP listening port 8080
org.eclipse.om2m.coap.port NSCL CoAP listening port 5683
org.eclipse.om2m.sclBaseContext NSCL listening context /om2m
org.eclipse.om2m.dbDriver NSCL Database driver org.h2.Driver
org.eclipse.om2m.dbUrl NSCL Database file location jdbc:h2:./database/nscdb
org.eclipse.om2m.dbUser NSCL Database user name om2m
org.eclipse.om2m.dbPassword NSCL Database password om2m
org.eclipse.om2m.dbReset NSCL Database reset when starting true
org.eclipse.om2m.sclBaseId NSCL SclBase resource id nscl
org.eclipse.om2m.sclBaseProtocol.default NSCL Default communication protocol http
org.eclipse.om2m.maxNrOfInstances Maximum number of content instances in a Container 1000
org.eclipse.om2m.adminRequestingEntity NSCL Default admin requesting entity. (username / password) admin:admin
org.eclipse.om2m.guestRequestingEntity NSCL Default guest requesting entity. (username / password) guest:guest

Gateway (GSCL) configuration

  • Go to the GSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/<arch>".
  • Edit the file “configuration/config.ini” to configure the GSCL. (You can keep the current configuration for a local demo)
Parameter Description Example
org.eclipse.om2m.sclType SCL type GSCL
org.eclipse.om2m.sclBaseAddress GSCL ip address 127.0.0.1
org.eclipse.equinox.http.jetty.http.port GSCL listening port 8181
org.eclipse.om2m.coap.port GSCL CoAP listening port 5684
org.eclipse.om2m.sclBaseContext GSCL listening context /om2m
org.eclipse.om2m.dbDriver GSCL Database driver org.h2.Driver
org.eclipse.om2m.dbUrl GSCL Database file location jdbc:h2:./database/gscldb
org.eclipse.om2m.dbUser GSCL Database user name om2m
org.eclipse.om2m.dbPassword GSCL Database password om2m
org.eclipse.om2m.dbReset GSCL Database reset when starting true
org.eclipse.om2m.sclBaseId GSCL SclBase resource id gscl
org.eclipse.om2m.sclBaseProtocol.default GSCL default communication protocol http
org.eclipse.om2m.maxNrOfInstances Maximum number of content instances in a Container 1000
org.eclipse.om2m.adminRequestingEntity Default GSCL admin requesting entity. (username / password) admin:admin
org.eclipse.om2m.guestRequestingEntity Default GSCL guest requesting entity. (username / password) guest:guest
  • The GSCL configuration file contains 5 additional parameters to specify the remote NSCL to which the GSCL should be authenticated.
Parameter Description Example
org.eclipse.om2m.nsclAuthentication Authenticate GSCL to NSCL true
org.eclipse.om2m.remoteNsclId Remote NSCL Id nscl
org.eclipse.om2m.remoteNsclAddress Remote NSCL ip address 127.0.0.1
org.eclipse.om2m.remoteNsclPort Remote NSCL listening port 8080
org.eclipse.om2m.remoteNsclContext Remote NSCL listening context /om2m
  • You can configure GSCL and NSCL to work on distributed machines.
  • You can configure multiple GSCLs by setting different identifiers.

Startup

NSCL startup

  • Go to the NSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>".
  • Start the NSCL by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
  • Once the NSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles. Type "exit" to shutdown.
NSCL OSGi console
  • Open your browser and connect to the address "127.0.0.1:8080" to access the NSCL web interface.
  • Enter username "admin" and password "admin" then click on login button to display the NSCL resource tree.
NSCL web interface: authentication
  • After a successful authentication, the NSCL resource will be displayed. You can see the "nscl" SclBase sub-resources and attributes.
  • You can disconnect by clicking on the "Logout" button.
NSCL web interface: nscl sclBase resource

GSCL startup

  • Go to the GSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/arch>".
  • Start the GSCL by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
  • Once the GSCL is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles.
  • The GSCL automatically authenticate to the remote NSCL specified in the gateway configuration file. If the NSCL is not already running, the GSCL keep sending authentication requests (A request each 10 seconds).
  • After a successful authentication, the “gscl” resource is added to the “nscl/scls” collection, and respectively the “nscl” resource is added to the “gscl/scls” collection. You can now access the registered GSCL resource from the NSCL web interface under the “nscl/scls/gscl” uri.
  • Using the NSCL web interface you can seamlessly access to all authenticated gateways. Open the "nscl/scls" resource to display available GSCLs . You notice the existence of one authenticated GSCL with id "gscl".
NSCL web interface: Scls resource
  • Click on the "gscl" resource to display remote GSCL sub-resources and attributes. You can click on the “gscl” button of the “link” attribute to connect to the GSCL resources tree.
NSCL web interface: remote gscl resource
  • The GSCL resource tree will be displayed. At this moment, the NSCL will act as a proxy to retarget your requests to the GSCL.
NSCL web interface: gscl sclBase resource
  • Initially, also the GSCL contains the SclBase resource (id=gscl), the AccessRight resource (id=AR_ADMIN), and other empty collections.

Multiple gateways scenario

  • Let's consider a simple M2M system composed of a server and two gateways as follows:
    • Server IP: 192.168.0.2
    • Gateway1 IP: 192.168.0.3
    • Gateway2 IP: 192.168.0.4
  • Of course, you can test the system locally in one machine by using the IP 127.0.0.1 for all products.
  • After building the OM2M project normally, you will obtain 1 NSCL product and 1 GSCL product.
  • You can configure the NSCL with the default configuration like this:

NSCL config.ini file:

org.eclipse.om2m.sclBaseId=nscl
org.eclipse.om2m.sclBaseAddress=192.168.0.2
org.eclipse.equinox.http.jetty.http.port=8080
  • Now, copy the GSCL product in another folder. You have now two separate GSCLs.
  • Configure the first GSCL with the following configuration:

GSCL1 config.ini file:

org.eclipse.om2m.sclBaseId=gscl1
org.eclipse.om2m.sclBaseAddress=192.168.0.3
org.eclipse.equinox.http.jetty.http.port=8181
org.eclipse.om2m.remoteNsclId=nscl
org.eclipse.om2m.remoteNsclAddress=192.168.0.2
org.eclipse.om2m.remoteNsclPort=8080
  • Then, configure the second GSCL with the following configuration:

GSCL2 config.ini file:

org.eclipse.om2m.sclBaseId=gscl2
org.eclipse.om2m.sclBaseAddress=192.168.0.4
org.eclipse.equinox.http.jetty.http.port=8282
org.eclipse.om2m.remoteNsclId=nscl
org.eclipse.om2m.remoteNsclAddress=192.168.0.2
org.eclipse.om2m.remoteNsclPort=8080
  • You can start the system as follows:
    • Start the NSCL product.
    • Start the GSCL1 product.
    • Start the GSCL2 product.
  • Open the NSCL web interface on 192.168.0.2:8080.
  • Go to the "nscl/scls" resource to see the authenticated gateways. You will find gscl1 and gscl2 authenticated.
  • You can access now each authenticated GSCL by clicking on the GSCL (eg. nscl/scls/gscl1).
  • Click on the "link" button to access remotely the gateway resource tree.

Back to the top