OM2M对接

[TOC]
IN-CSE实例和MN-CSE实例的对接。

  • 参考:https://wiki.eclipse.org/OM2M/one/Configuration

    配置

    分别修改两个实例中的configuration/config.ini文件
    两个实例中基本配置都已经写好了,只需要把两个文件中的org.eclipse.om2m.dbUrl这个数据库参数修改成同一个就行:jdbc\:h2\:./database/db
    下面贴出我的两个配置文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#IN-CSE
#Wed May 03 17:09:16 GMT+08:00 2017
log4j.configuration=file\:./log4j.configuration
org.eclipse.equinox.http.jetty.http.port=8080
org.eclipse.om2m.dbReset=false
org.eclipse.om2m.cseBaseContext=/
org.eclipse.om2m.globalContext=
osgi.bundles=reference\:file\:javax.servlet_3.1.0.v20140303-1611.jar@4,reference\:file\:javax.xml_1.3.4.v201005080400.jar@4,reference\:file\:org.apache.commons.codec_1.6.0.v201305230611.jar@4,reference\:file\:org.apache.commons.logging_1.1.1.v201101211721.jar@4,reference\:file\:org.apache.felix.gogo.command_0.10.0.v201209301215.jar@4\:start,reference\:file\:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@4\:start,reference\:file\:org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@4\:start,reference\:file\:org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar@4,reference\:file\:org.apache.httpcomponents.httpcore_4.3.3.v201411290715.jar@4,reference\:file\:org.eclipse.equinox.console_1.1.0.v20140131-1639.jar@4\:start,reference\:file\:org.eclipse.equinox.http.jetty_3.0.200.v20131021-1843.jar@1\:start,reference\:file\:org.eclipse.equinox.http.servlet_1.1.500.v20140318-1755.jar@4,reference\:file\:org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar@4,reference\:file\:org.eclipse.jetty.continuation_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.http_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.io_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.security_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.server_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.servlet_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.util_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.om2m.binding.coap_1.0.0.20170503-0856.jar@2\:start,reference\:file\:org.eclipse.om2m.binding.http_1.0.0.20170503-0856.jar@2\:start,reference\:file\:org.eclipse.om2m.binding.mqtt_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.binding.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.commons_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.commons.logging_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.core_1.0.0.20170503-0856.jar@4\:start,reference\:file\:org.eclipse.om2m.core.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.datamapping.jaxb_1.0.0.20170503-0856.jar@1\:start,reference\:file\:org.eclipse.om2m.datamapping.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.interworking.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.persistence.eclipselink_1.0.0.20170503-0856.jar@2\:start,reference\:file\:org.eclipse.om2m.persistence.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.webapp.resourcesbrowser.xml_1.0.0.20170503-0856.jar@4\:start,reference\:file\:org.eclipse.osgi.services_3.4.0.v20140312-2051.jar@4
org.eclipse.om2m.cseBaseProtocol.default=http
org.eclipse.om2m.cseBaseName=in-name
org.eclipse.om2m.cseBaseAddress=127.0.0.1
eclipse.p2.profile=DefaultProfile
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/db
osgi.framework.extensions=
org.eclipse.om2m.webInterfaceContext=/webpage
osgi.bundles.defaultStartLevel=4
org.eclipse.om2m.dbUser=om2m
osgi.framework=file\:plugins/org.eclipse.osgi_3.10.2.v20150203-1939.jar
org.eclipse.om2m.guestRequestingEntity=guest\:guest
org.eclipse.om2m.cseBaseId=in-cse
org.eclipse.om2m.dbDriver=org.h2.Driver
org.eclipse.om2m.adminRequestingEntity=admin\:admin
org.eclipse.om2m.cseType=IN-CSE
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
eclipse.p2.data.area=@config.dir/../p2
org.eclipse.om2m.resource.idseparator=-
org.eclipse.om2m.coap.port=5683
org.eclipse.om2m.dbPassword=om2m
org.eclipse.om2m.m2mSpId=om2m.org

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#MN-CSE
#Wed May 03 17:09:19 GMT+08:00 2017
org.eclipse.om2m.remoteCseId=in-cse
log4j.configuration=file\:./log4j.configuration
org.eclipse.equinox.http.jetty.http.port=8181
org.eclipse.om2m.dbReset=false
org.eclipse.om2m.remoteCsePort=8080
org.eclipse.om2m.cseBaseContext=/
org.eclipse.om2m.globalContext=
osgi.bundles=reference\:file\:javax.servlet_3.1.0.v20140303-1611.jar@4,reference\:file\:javax.xml_1.3.4.v201005080400.jar@4,reference\:file\:org.apache.commons.codec_1.6.0.v201305230611.jar@4,reference\:file\:org.apache.commons.logging_1.1.1.v201101211721.jar@4,reference\:file\:org.apache.felix.gogo.command_0.10.0.v201209301215.jar@4\:start,reference\:file\:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@4\:start,reference\:file\:org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@4\:start,reference\:file\:org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar@4,reference\:file\:org.apache.httpcomponents.httpcore_4.3.3.v201411290715.jar@4,reference\:file\:org.eclipse.equinox.console_1.1.0.v20140131-1639.jar@4\:start,reference\:file\:org.eclipse.equinox.http.jetty_3.0.200.v20131021-1843.jar@1\:start,reference\:file\:org.eclipse.equinox.http.servlet_1.1.500.v20140318-1755.jar@4,reference\:file\:org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar@4,reference\:file\:org.eclipse.jetty.continuation_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.http_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.io_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.security_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.server_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.servlet_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.jetty.util_8.1.16.v20140903.jar@4,reference\:file\:org.eclipse.om2m.binding.http_1.0.0.20170503-0856.jar@2\:start,reference\:file\:org.eclipse.om2m.binding.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.commons_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.commons.logging_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.core_1.0.0.20170503-0856.jar@4\:start,reference\:file\:org.eclipse.om2m.core.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.datamapping.jaxb_1.0.0.20170503-0856.jar@1\:start,reference\:file\:org.eclipse.om2m.datamapping.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.interworking.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.ipe.sample_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.persistence.eclipselink_1.0.0.20170503-0856.jar@2\:start,reference\:file\:org.eclipse.om2m.persistence.service_1.0.0.20170503-0856.jar@4,reference\:file\:org.eclipse.om2m.webapp.resourcesbrowser.xml_1.0.0.20170503-0856.jar@4\:start,reference\:file\:org.eclipse.osgi.services_3.4.0.v20140312-2051.jar@4
org.eclipse.om2m.cseBaseProtocol.default=http
org.eclipse.om2m.cseBaseName=mn-name
org.eclipse.om2m.cseBaseAddress=127.0.0.1
eclipse.p2.profile=DefaultProfile
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/db
osgi.framework.extensions=
org.eclipse.om2m.webInterfaceContext=/webpage
osgi.bundles.defaultStartLevel=4
org.eclipse.om2m.dbUser=om2m
org.eclipse.om2m.maxNrOfInstances=1000
osgi.framework=file\:plugins/org.eclipse.osgi_3.10.2.v20150203-1939.jar
org.eclipse.om2m.guestRequestingEntity=guest\:guest
org.eclipse.om2m.remoteCseName=in-name
org.eclipse.om2m.cseBaseId=mn-cse
org.eclipse.om2m.remoteCseContext=/
org.eclipse.om2m.dbDriver=org.h2.Driver
org.eclipse.om2m.remoteCseAddress=127.0.0.1
org.eclipse.om2m.adminRequestingEntity=admin\:admin
org.eclipse.om2m.cseType=MN
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
org.eclipse.om2m.cseAuthentication=true
eclipse.p2.data.area=@config.dir/../p2
org.eclipse.om2m.coap.port=5684
org.eclipse.om2m.dbPassword=om2m

运行

然后将IN-CSE和MN-CSE都运行起来(在OM2M安装里有介绍怎么运行),到http://127.0.0.1:8080/webpage 中可以在IN-CSE实例中查看到MN-CSE实例。

IN-CSE中查看MN-CSE

热评文章