WSO2 IoTS Device Manufacturer Guide
-
Upload
hugo-lu -
Category
Engineering
-
view
36 -
download
0
Transcript of 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
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.
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.
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
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
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
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
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
THE WHOLE PICTURE
DeviceType
DAS
CDMF
Device
UI
UI ExtA
nalytics
Plugins
API
s
Agent
SENSOR DATA PROCESSING
DEVICE ACCESS VIA APPS
S A M P L E C O D E
CONNECTED CUP
$ git clone https://github.com/wso2/product-iots.git
WRITE DEVICE AGENTS
https://docs.wso2.com/display/IoTS300/Writing+Device+Agents
# web controller of Connected Cup simulator
# Connected Cup simulator
WRITE DEVICE APIS
# create a JAXRS web application for controller and manager APIs
https://docs.wso2.com/display/IoTS300/Writing+Device+APIs
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
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
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
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
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
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
C A R B O N D E V I C E M G T P L U G I N S
DEVICE MGT PLUGINS
$ git clone https://github.com/wso2/carbon-device-mgt-plugins.git
DEVICE TYPES
MOBILE PLUGINS
FEATURES
Q & A