This document provides an overview of the OCEAN IoT platform and describes how to set up an IoT system using its components. It introduces the OCEAN alliance and its open-source IoT platforms Mobius and &Cube, which are based on the oneM2M standard. It also discusses using the MQTT protocol with Mosquitto as the broker. The document then explains how to install and run Mobius, &Cube, a device app, and Mosquitto both with and without MQTT to transmit sensor data from a Raspberry Pi to Mobius via &Cube. It concludes with references for further reading.
4. IoT Platform
• OCEAN
– Formerly Open alliance for iot standard
– Global partnership based on open source and
IoT standards
– Aims to promote the development and
commercialization of IoT platforms, products,
and services by widespread adoption of IoT
standards-compliant open source.
– http://iotocean.org/
4
5. 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
5
6. 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
6
9. Process ( without MQTT )
Server
Yellow
Turtle
Database
MySQLRaspberry Pi
Bluez TAS Thyme
Raspberry Pi
Bluez TAS Thyme
Raspberry Pi
Bluez TAS Thyme USER
Application
Beacon
Data
9
10. 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. )
10
11. Process ( without MQTT )
• Start Thyme
– We must modify conf.xml of Thyme in order to connect
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 Mobius
11
12. 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. )
12
13. Process ( without MQTT )
• Start Thyme_TAS
– You can see data transfer ( TAS -> Thyme -> Mobius ).
Figure 9. Console of Mobius
( Pictures can be little different. )
13
15. MQTT Protocol
• MQTT
– Formerly MQ Telemetry Transport
– A lightweight messaging protocol for small
sensors and mobile devices.
– The publish-subscribe messaging
pattern requires a message broker.
– http://mqtt.org/
15
16. 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.
16
17. MQTT broker
• Mosquitto
– Open source message broker that
implements the MQTT
– https://mosquitto.org/
• Others
– Emqttd, ActiveMQ, Apollo, HiveMQ, IBM
MessageSight, JoramMQ, RabbitMQ, Solace
Message Routers, and VerneMQ.
17
18. 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.
18
19. Process ( with MQTT )
Server
Yellow
Turtle
Server
Mosquitto
broker
Database
MySQL
Raspberry Pi
Bluez TAS Thyme
Raspberry Pi
Bluez TAS Thyme
Raspberry Pi
Bluez TAS Thyme USER
Application
Beacon
Data
MQTT
proxy
Figure 10. Example (Remote MQTT broker)
19
20. 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
function (mqtt_forwarding).
20
21. 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. )
21
22. 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 different. )
Figure 12. Console of Mobius (pxymqtt)
22
23. Process ( with MQTT )
• All program start like the former process.
– We can see data transmission.
Figure 14. Console of mosquito ( Pictures can be little different. )
23
24. 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
24