This document provides guidance on developing a connected device solution for a coffee cup called the Connected Cup using WSO2 IoT Server. It describes developing a device agent to display data on the cup, device APIs for communication, UI extensions, analytics processing, a device plugin, and a Carbon feature. Code samples and links are provided for each aspect including getting started with the Connected Cup sample.
Heart Disease Prediction using machine learning.pptx
WSO2 IoTS Device Manufacturer Guide
1. WSO2 IOTS
D E V I C E M A N U FA 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
2. 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.
3. 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.
4. 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
5. 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.
Device
Type
Device
APIs
6. UI EXTENSIONS
• Goal:Allow customers to remotely monitor the cup and see the
status of the coffee.
• InWSO2 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
theWSO2 IoTS Jaggery application pages.
Device
Type
UI
UI Ext
7. 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.
Device
Type
DAS
Analytics
8. DEVICE PLUGINS
• A device plugin is an OSGI bundle that gets wired with theWSO2
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. Device
Type
CDMF
Plugins
Carbon
17. 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
18. 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
19. WRITE CARBON FEATURE
• Users ofWSO2 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+Feature
https://docs.wso2.com/display/Carbon4411/Developing+a+Carbon+Feature
20. START CONNECTED CUP
• Build the Connected Cup device type
• Run the samples-deployer.xml file
• Run the device-deployer.xml file
• Start or restartWSO2 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