wso2 iots device manufacturer guide

27
WSO2 IOTS DEVICE MANUFACTURER GUIDE WSO2 IOT SERVER 3.0.0

Upload: hugo-lu

Post on 14-Apr-2017

38 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: WSO2 IoTS Device Manufacturer Guide

WSO2 IOTSD E V I C E M A N U F A C T U R E R G U I D E

W S O 2 I OT S E RV E R 3 . 0 . 0

Page 2: WSO2 IoTS Device Manufacturer Guide

PLANETBUCKS

• The customers are in a hurry to grab a coffee and rush back to work/home.

• Planetbucks can get a competitive advantage in the market if they are able to take the coffee to the customer's work place/home, without them having to come to the store.

Page 3: WSO2 IoTS Device Manufacturer Guide

CONNECTED CUP

• Display the level of coffee and temperature on the cup.

• Allow customers to order coffee by clicking a button on the cup.

• Allow customers to remotely monitor the cup and see the status of the coffee.

• Allow Planetbucks to study the customer drinking patterns and the coffee consumption.

Page 4: WSO2 IoTS Device Manufacturer Guide

DEVICE AGENT

• Goal: Display the level of coffee and temperature on the cup.

• It is necessary to install/burn a software program into the hardware device. The software program is known as the device agent. The agent can be written in any programming language that is supported by the device, such as Java, C, Arduino-C, Python, Lua and more.

Device

Agent

Page 5: WSO2 IoTS Device Manufacturer Guide

DEVICE API

• Goal: Allow customers to order coffee by clicking a button on the cup.

• The Connected Cup needs to communicate with the user's mobile application that monitors the cup, and send details on the consumer buying patterns and the coffee consumption data to Planetbucks. Therefore, we create APIs for the Connected Cup device to communicate with external devices, the server and the device management console.

DeviceType

Device API

s

Page 6: WSO2 IoTS Device Manufacturer Guide

UI EXTENSIONS

• Goal: Allow customers to remotely monitor the cup and see the status of the coffee.

• In WSO2 IoTS each device type has it's own UI that lists the device specific details. Therefore, when writing your own device type you need to write the UI units for the device specific details to be listed in the WSO2 IoTS Jaggery application pages.

DeviceType

UI

UI Ext

Page 7: WSO2 IoTS Device Manufacturer Guide

ANALYTICS

• Goal: Allow Planetbucks to study the customer drinking patterns and the coffee consumption.

• Connected Cup has one or more sensors to gather data, e.g. the level of coffee in the cup and its temperature. WSO2 IoT Server uses WSO2 Data Analytics Server (DAS) to write batch analytics and process historical sensor data.

DeviceType

DAS

Analytics

Page 8: WSO2 IoTS Device Manufacturer Guide

DEVICE PLUGINS

• A device plugin is an OSGI bundle that gets wired with the WSO2 CDMF (Connected Device Management Framework). Each device requires a specific device plugin. A specific device plugin is required due to the following reasons:

– Enables its creator to have control over the device.

– A device can have its own unique set of attributes. DeviceType

CDMF

Plugins

Carbon

Page 9: WSO2 IoTS Device Manufacturer Guide

THE WHOLE PICTURE

DeviceType

DAS

CDMF

Device

UI

UI ExtA

nalytics

Plugins

API

s

Agent

Page 10: WSO2 IoTS Device Manufacturer Guide

SENSOR DATA PROCESSING

Page 11: WSO2 IoTS Device Manufacturer Guide

DEVICE ACCESS VIA APPS

Page 12: WSO2 IoTS Device Manufacturer Guide

S A M P L E C O D E

Page 13: WSO2 IoTS Device Manufacturer Guide

CONNECTED CUP

$ git clone https://github.com/wso2/product-iots.git

Page 14: WSO2 IoTS Device Manufacturer Guide

WRITE DEVICE AGENTS

https://docs.wso2.com/display/IoTS300/Writing+Device+Agents

# web controller of Connected Cup simulator

# Connected Cup simulator

Page 15: WSO2 IoTS Device Manufacturer Guide

WRITE DEVICE APIS

# create a JAXRS web application for controller and manager APIs

https://docs.wso2.com/display/IoTS300/Writing+Device+APIs

Page 16: WSO2 IoTS Device Manufacturer Guide

WRITE UI EXTENSIONS

https://docs.wso2.com/display/IoTS300/Writing+UI+Extensions

# show the historical data

# show the device type

# show the device details# show the real time data

# jaggery web framework

Page 17: WSO2 IoTS Device Manufacturer Guide

WRITE BATCH ANALYTICS

# includes the content to bind the stream to the receiver# includes the analytics script used to summarize data streams# includes the schema to persist and format the streaming data# includes the content to define the data format of streaming data

# create an archive of all the artifacts created below

# includes the content to define the data format of streaming data# includes the content to bind the stream to the receiver# includes the content to bind the stream to the publisher# includes the siddhi script used to process read time data# create an archive of all the artifacts created below

https://docs.wso2.com/display/IoTS300/Writing+Analytics

Page 18: WSO2 IoTS Device Manufacturer Guide

WRITE DEVICE PLUGIN

# implement DeviceManagementService interface# implement DeviceManager interface

# register the service as an OSGI service

https://docs.wso2.com/display/IoTS300/Writing+Device+Plugins

Page 19: WSO2 IoTS Device Manufacturer Guide

WRITE CARBON FEATURE

• Users of WSO2 products can extend the features by developing new components and deploying them in the server.

# create the database scripts# define the database scripts# includes the device type configurations

# create and configure the agent

# copy the files from the P2 repository to the WSO2 IoTS pack

# create the device type as a feature with maven

https://docs.wso2.com/display/IoTS300/Writing+the+Device+Featurehttps://docs.wso2.com/display/Carbon4411/Developing+a+Carbon+Feature

Page 20: WSO2 IoTS Device Manufacturer Guide

START CONNECTED CUP

• Build the Connected Cup device type

• Run the samples-deployer.xml file

• Run the device-deployer.xml file

• Start or restart WSO2 IoTS• Access the device management console and see the connected cup

device in the device page

https://docs.wso2.com/display/IoTS300/Device+Manufacturer+Guide#DeviceManufacturerGuide-StartingConnectedCup

$ cd <IoT_HOME>/samples/connectedcup$ mvn clean install

$ cd <IoT_HOME>/samples$ mvn clean install -f samples-deployer.xml

$ cd <IoT_HOME>/plugins$ mvn clean install -f plugins-deployer.xml

Page 21: WSO2 IoTS Device Manufacturer Guide

TROUBLESHOOTING

• <M2_HOME>/conf/settings.xml<proxies><proxy>...</proxy></proxies>

• <IoT_HOME>/samples/connectedcup/component/plugin/pom.xml<Import-Package>org.wso2.carbon.base.*</Import-Package>

• Configuring WSO2 IoT Server with the IP instead of localhost

– https://docs.wso2.com/display/IoTS310/Configuring+WSO2+IoT+Server+with+the+IP

Page 22: WSO2 IoTS Device Manufacturer Guide

C A R B O N D E V I C E M G T P L U G I N S

Page 23: WSO2 IoTS Device Manufacturer Guide

DEVICE MGT PLUGINS

$ git clone https://github.com/wso2/carbon-device-mgt-plugins.git

Page 24: WSO2 IoTS Device Manufacturer Guide

DEVICE TYPES

Page 25: WSO2 IoTS Device Manufacturer Guide

MOBILE PLUGINS

Page 26: WSO2 IoTS Device Manufacturer Guide

FEATURES

Page 27: WSO2 IoTS Device Manufacturer Guide

Q & A