Upload
-
View
168
Download
9
Embed Size (px)
Citation preview
1
OCEAN IoT Platform Guide IoT Platform Startup guide
July 17th, 2016
Youngmin Kim
2
INDEX
• IoT Platform
– Mobius Yellow Turtle– &Cube: Thyme (TAS)
• Process (without MQTT)
• MQTT broker
– Mosquitto
• Process (with MQTT)
• Reference
CrePAS 6th the first session
3
IoT Platform
4CrePAS 6th the first session
IoT Platform• OCEAN– Formerly Open alliance for iot standard– Global partnership based on open source and IoT
standards– Aims to promote the development and commer-
cialization of IoT platforms, products, and services by widespread adoption of IoT standards-compli-ant open source.
– http://iotocean.org/
5CrePAS 6th the first session
IoT Platform• Mobius – Yellow Turtle– An open source software of oneM2M-based IoT
Server Platform based on Node.js Java Script.– The source code and files of Yellow Turtle are under
the OCEAN license terms and conditions, i.e., 3-clause BSD open source license.
– http://www.iotocean.org/download/?tab1=1&tab2=20
6CrePAS 6th the first session
IoT Platform• &Cube: Thyme– An open source software of oneM2M-based IoT
Device Platform based on Node.js Java Script.– The source code and files of Thyme are under the
OCEAN license terms and conditions, i.e., 3-clause BSD open source license.
– http://www.iotocean.org/download/?tab1=2
7CrePAS 6th the first session
IoT Platform Schema
ADNAE
ADNAE
ADNAE
IN
CSE
AEMca
Mca Mcc’
Mobius – Yel-low Turtle
&Cube -Thyme
Mcn
Figure 1. Example (Node. js version)
8CrePAS 6th the first session
IoT Platform Schema
AE(Con-tents)
IN-CSE(Mobius:
Yellow Tur-tle
Beacon
TAS AE (&Cube: Thyme)
Raspberry Pi
CSE-Mo-bius
AE
ss_1_ctrl
ss_1Subscrip-
tionSubscrip-
tion
BLE
9CrePAS 6th the first session
Process ( without MQTT )
Server
Yellow Turtle
Database
MySQLRaspberry PiBlue
z TAS Thyme
Raspberry PiBlue
z TAS Thyme
Raspberry PiBlue
z TAS Thyme USERApplica-
tion
Beacon
Data
10CrePAS 6th the first session
Process ( without MQTT )• Start Mobius– First implement make CSE ID.– ER_DUP_ENTRY is because of second implement.– QnA page
• http://www.iotocean.org/Community/?tab1=2
Figure 4. Console of Mobius ( Pictures can be little different. )
11CrePAS 6th the first session
Process ( without MQTT )• Start Thyme– We must modify conf.xml of Thyme in order to con-
nect Mobius (cbhost = Mobius server’s IP address).– Create IDs that can be modified conf.xml
( Pictures can be little different. )Figure 5. Console of Thyme
Figure 6. Console of Mo-bius
12CrePAS 6th the first session
Process ( without MQTT )• Start Thyme_TAS– We can see data transfer ( TAS -> Thyme -> Mobius ).– If you want to implement TAS in windows, http://www.iotocean.org/Community/view.asp?pageNo=2&tab1=1&tab2=0&tab3=all&sType&word=&idx=1163
Figure 7. Console of TAS
Figure 8. Console of Thyme( Pictures can be little different. )
13CrePAS 6th the first session
Process ( without MQTT )• Start Thyme_TAS– You can see data transfer ( TAS -> Thyme ->
Mobius ).
Figure 9. Console of Mobius
( Pictures can be little differ-ent. )
14
MQTT broker
15CrePAS 6th the first session
MQTT Protocol• MQTT– Formerly MQ Telemetry Transport– A lightweight messaging protocol for
small sensors and mobile devices.– The publish-subscribe messaging pat-
tern requires a message broker.– http://mqtt.org/
16CrePAS 6th the first session
MQTT Method• MQTT Method
– Connect• Waits for a connection to be established with the server.
– Disconnect• Waits for the MQTT client to finish any work it must do, and
for the TCP/IP session to disconnect.– Subscribe
• Waits for completion of the Subscribe or Unsubscribe method.– Unsubscribe
• Requests the server unsubscribe the client from one or more topics.
– Publish• Returns immediately to the application thread after passing
the request to the MQTT client.
17CrePAS 6th the first session
MQTT broker• Mosquitto– Open source message broker that imple-
ments the MQTT– https://mosquitto.org/
• Others– Emqttd, ActiveMQ, Apollo, HiveMQ, IBM
MessageSight, JoramMQ, RabbitMQ, Solace Message Routers, and VerneMQ.
18CrePAS 6th the first session
MQTT broker• Mosquitto– Synopsis
• Mosquitto [-c config file] [-d | --daemon][-p port number][-v]
– Options• -p, --port
– Listen on the port specified instead of the default 1883.
• -v, --verbose– Use verbose logging.
19CrePAS 6th the first session
Process ( with MQTT )ServerYellow Turtle
ServerMosquit-tobroker
Database
MySQLRaspberry Pi
Bluez TAS Thyme
Raspberry PiBlue
z TAS Thyme
Raspberry PiBlue
z TAS Thyme USERApplica-
tion
Beacon
Data
MQTT proxy
Figure 10. Example (Remote MQTT broker)
20CrePAS 6th the first session
Process ( with MQTT )• This case implements the former.• But something different.
– We must implement two js file in Mobius (app.js, pxymqtt.js).
– We have to change implement file in Thyme (app.js -> mqtt_app.js).
– We use mosqutto (MQTT broker).– We must modify TAS conf.xml in order to match
Thyme’s mqtt_conf.xml (parentport = tasport).– Also we have to assign mqtt proxy (conf.json of Mobius –
mqttproxy = mosquitto’s IP address).– We need forwarding, so we have to uncomment func-
tion (mqtt_forwarding).
21CrePAS 6th the first session
Process ( with MQTT )• Start mosquitto.– We use this for MQTT broker.– If we want to use proxy server, we must modify
Mobius conf.json file (mqttproxy = MQTT server IP address).
– Command : mosquitto.exe -v
Figure 11. Console of Mosquitto
( Pictures can be little different. )
22CrePAS 6th the first session
Process ( with MQTT )• Start Mobius - pxymqtt.
– We need forwarding, so we have to uncomment function (mqtt_forwarding).
Figure 13. Console of Mosquitto ( Pictures can be little dif -ferent. )
Figure 12. Console of Mobius (pxymqtt)
23CrePAS 6th the first session
Process ( with MQTT )• All program start like the former process.–We can see data transmission.
Figure 14. Console of mosquito ( Pictures can be little differ-ent. )
24CrePAS 6th the first session
TEST Environment• Raspberry Pi
– node : v0.10.29– npm : v1.4.21– Thyme : v1.5– Thyme TAS : v1.3
• Server (Windows 10, Windows server 2012 R2)– Node.js : v4.4.4, v4.4.6, v4.4.7– Nginx : v1.10.1– Mobius (Yellow Turtle) : v2.0.5– Mosquitto : v1.3.5
25
Reference
26CrePAS 6th the first session
Reference• Web page
– http://iotocean.org– https://en.wikipedia.org/wiki/MQTT– http://mqtt.org– https://mosquitto.org/
• Document– 『 oneM2M 서비스 플랫폼 표준 해설서』 , 한국정보통신기술협회 ,
2014-11-30– 『 oneM2M 어플리케이션 개발자 가이드 표준 해설서』 ,
한국정보통신기술협회 , 2015-11-30– 「 MQTT Version 3.1.1 」 , OASIS, 2014-10-29– 「 Mobius : Yellow Turtle Installation Guide v1.9 」 , OCEAN, 2016-
12– 「“개방형 사물인터넷 플랫폼 (Mobius, &Cube) 기반 서비스 개발 실습”
교육 과정」 , 전자부품연구원