SlideShare a Scribd company logo
1 of 19
WSO2 IoT Server
Implementing Device Gateway Pattern using Android Device
& XBee
Sumedha Rubasinghe
Charitha Goonetilleke
June, 2017
2
Solution Overview
NEXBOX A95X
XBee on USB explorer
Arduino with XBee shield
Relay module
3
Device Gateway Pattern (N devices / 1 comm. module)
NEXBOX A95X
XBee on USB explorer
Arduino with XBee shield
Relay module
Device Gateway
Edge Devices
Communication
Module
Coordinator
4
Device Gateway Pattern
NEXBOX A95X
XBee on USB explorer
Arduino with XBee shield
Relay module
Device Gateway
Device1
Device2
Device3
Wireless
Communication
Module
Edge Device
WSO2 Android Agent on Android TV Box
5
WSO2 IoT Platform
6
Device Instance Details Page
WSO2 IoT Platform
7
Device in location X
Control operations on
Android TV Box
Control operation for
configuring XBee devices
Device Instance Details Page
WSO2 IoT Platform
8
Sending Video URL
to a remote TV box
WSO2 IoT Platform
9
Sending message to
a remote TV box
WSO2 IoT Platform
10
Control messages to
XBee module
connected to TV box
WSO2 IoT Platform
11
Adding an edge
XBee device
(name,serial #)
WSO2 IoT Platform
12
Newly added edge device
Light bulb with control
operations ON/OFF
WSO2 IoT Platform
13
Edge Computing with Siddhi + Android
14
WSO2 Android Agent
WSO2 Siddhi
@Plan:name('edgeAnalytics')
define stream edgeDeviceEventStream (ac int, window int, light int, temperature float, humidity float, keycard int);
@info(name = 'alertQuery') from edgeDeviceEventStream[(1 == ac or 1 == window or 1 == light) and 0 == keycard]
select ac, window, light insert into alertOutputStream;
@info(name = 'temperatureQuery') from every te1=edgeDeviceEventStream, te2=edgeDeviceEventStream[te1.temperature != temperature ]
select te2.temperature insert into temperatureOutputStream;
@info(name = 'humidityQuery') from every he1=edgeDeviceEventStream, he2=edgeDeviceEventStream[he1.humidity != humidity ]
select he2.humidity insert into humidityOutputStream;
@info(name = 'acQuery') from every ae1=edgeDeviceEventStream, ae2=edgeDeviceEventStream[ae1.ac != ac ]
select ae2.ac insert into acOutputStream;
@info(name = 'windowQuery') from every we1=edgeDeviceEventStream, we2=edgeDeviceEventStream[we1.window != window ]
select we2.window insert into windowOutputStream;
@info(name = 'keycardQuery') from every ke1=edgeDeviceEventStream, ke2=edgeDeviceEventStream[ke1.keycard != keycard ]
select ke2.keycard insert into keycardOutputStream;
Sample query
15
@Plan:name('edgeAnalytics')
define stream edgeDeviceEventStream (ac int, window int, light int, temperature float,
humidity float, keycard int);
@info(name = 'alertQuery') from edgeDeviceEventStream[(1 == ac or 1 == window or 1 ==
light) and 0 == keycard]
select ac, window, light insert into alertOutputStream;
@info(name = 'temperatureQuery') from every te1=edgeDeviceEventStream,
te2=edgeDeviceEventStream[te1.temperature != temperature ]
select te2.temperature insert into temperatureOutputStream;
@info(name = 'humidityQuery') from every he1=edgeDeviceEventStream,
he2=edgeDeviceEventStream[he1.humidity != humidity ]
select he2.humidity insert into humidityOutputStream;
Sample query
16
@info(name = 'humidityQuery') from every he1=edgeDeviceEventStream,
he2=edgeDeviceEventStream[he1.humidity != humidity ]
select he2.humidity insert into humidityOutputStream;
@info(name = 'acQuery') from every ae1=edgeDeviceEventStream,
ae2=edgeDeviceEventStream[ae1.ac != ac ]
select ae2.ac insert into acOutputStream;
@info(name = 'windowQuery') from every we1=edgeDeviceEventStream,
we2=edgeDeviceEventStream[we1.window != window ]
select we2.window insert into windowOutputStream;
@info(name = 'keycardQuery') from every ke1=edgeDeviceEventStream,
ke2=edgeDeviceEventStream[ke1.keycard != keycard ]
select ke2.keycard insert into keycardOutputStream;
Sample query
17
private void findSerialPortDevice() {
// This snippet will try to open the first encountered usb device connected, excluding usb root hubs
HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList();
if (!usbDevices.isEmpty()) {
boolean keep = true;
for (Map.Entry<String, UsbDevice> entry : usbDevices.entrySet()) {
device = entry.getValue();
int deviceVID = device.getVendorId();
int devicePID = device.getProductId();
Log.d(TAG, "deviceVID: " + Integer.toHexString(deviceVID) + " devicePID: " +
Integer.toHexString(devicePID));
if (deviceVID == 0x0403 && devicePID == 0x6001) {
// There is a device connected to our Android device. Try to open it as a Serial Port.
requestUserPermission();
keep = false;
} else {
connection = null;
device = null;
}
Android to USB
18
THANK YOU
wso2.com

More Related Content

What's hot

OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICONOSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
jochen.hiller
 
Io t idas_intro_ul20_nobkg
Io t idas_intro_ul20_nobkgIo t idas_intro_ul20_nobkg
Io t idas_intro_ul20_nobkg
FIWARE
 

What's hot (20)

Azure IoT End-to-End
Azure IoT End-to-EndAzure IoT End-to-End
Azure IoT End-to-End
 
WSO2Con ASIA 2016: WSO2 IoT Server: Your Foundation for the Internet of Things
WSO2Con ASIA 2016: WSO2 IoT Server: Your Foundation for the Internet of ThingsWSO2Con ASIA 2016: WSO2 IoT Server: Your Foundation for the Internet of Things
WSO2Con ASIA 2016: WSO2 IoT Server: Your Foundation for the Internet of Things
 
IoT on the Edge
IoT on the EdgeIoT on the Edge
IoT on the Edge
 
OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICONOSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
OSGi Users' Forum Germany - Meeting Darmstadt 2014-04-14 - QIVICON
 
Io t solutions world congress 2018 review Henk Jan van Wijk Conclusion Connect
Io t solutions world congress 2018 review Henk Jan van Wijk  Conclusion Connect Io t solutions world congress 2018 review Henk Jan van Wijk  Conclusion Connect
Io t solutions world congress 2018 review Henk Jan van Wijk Conclusion Connect
 
How to Join the Fiware IoT-Ready Programme
How to Join the Fiware IoT-Ready ProgrammeHow to Join the Fiware IoT-Ready Programme
How to Join the Fiware IoT-Ready Programme
 
New Features for Mobile Device Management (MDM) With Entgra
New Features for Mobile Device Management (MDM) With EntgraNew Features for Mobile Device Management (MDM) With Entgra
New Features for Mobile Device Management (MDM) With Entgra
 
FIWARE Overview of Generic Enablers
FIWARE Overview of Generic EnablersFIWARE Overview of Generic Enablers
FIWARE Overview of Generic Enablers
 
Training thethings.iO
Training thethings.iOTraining thethings.iO
Training thethings.iO
 
Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)
Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)
Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)
 
201410 1 fiware-overview
201410 1 fiware-overview201410 1 fiware-overview
201410 1 fiware-overview
 
Using FIWARE and Microsoft Azure for the development of IoT solutions
Using FIWARE and Microsoft Azure for the development of IoT solutionsUsing FIWARE and Microsoft Azure for the development of IoT solutions
Using FIWARE and Microsoft Azure for the development of IoT solutions
 
Io t idas_intro_ul20_nobkg
Io t idas_intro_ul20_nobkgIo t idas_intro_ul20_nobkg
Io t idas_intro_ul20_nobkg
 
Securing Access to SaaS Apps with WSO2 Identity Server
Securing Access to SaaS Apps with WSO2 Identity ServerSecuring Access to SaaS Apps with WSO2 Identity Server
Securing Access to SaaS Apps with WSO2 Identity Server
 
Build 2017 - B8024 - Connected intelligent things with Windows IoT Core and A...
Build 2017 - B8024 - Connected intelligent things with Windows IoT Core and A...Build 2017 - B8024 - Connected intelligent things with Windows IoT Core and A...
Build 2017 - B8024 - Connected intelligent things with Windows IoT Core and A...
 
WSO2Con EU 2016: WSO2 IoT Server: Your Foundation for the Internet of Things
WSO2Con EU 2016: WSO2 IoT Server:  Your Foundation for the Internet of ThingsWSO2Con EU 2016: WSO2 IoT Server:  Your Foundation for the Internet of Things
WSO2Con EU 2016: WSO2 IoT Server: Your Foundation for the Internet of Things
 
Internet of things (IoT) with Azure
Internet of things (IoT) with AzureInternet of things (IoT) with Azure
Internet of things (IoT) with Azure
 
Connecting IoT devices to Azure
Connecting IoT devices to AzureConnecting IoT devices to Azure
Connecting IoT devices to Azure
 
Building IoT Solutions using Windows IoT Core
Building IoT Solutions using Windows IoT CoreBuilding IoT Solutions using Windows IoT Core
Building IoT Solutions using Windows IoT Core
 
A Complete IoT Backend Infrastructure in FIWARE
A Complete IoT Backend Infrastructure in FIWAREA Complete IoT Backend Infrastructure in FIWARE
A Complete IoT Backend Infrastructure in FIWARE
 

Similar to WSO2 IoT Server: Implementing Device Gateway Pattern using Android Device & XBee

3 2--power-aware-cloud
3 2--power-aware-cloud3 2--power-aware-cloud
3 2--power-aware-cloud
BHUVIJAYAVELU
 

Similar to WSO2 IoT Server: Implementing Device Gateway Pattern using Android Device & XBee (20)

Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
 
communicate with instrument by using lan
communicate with instrument by using lancommunicate with instrument by using lan
communicate with instrument by using lan
 
Android Things - The IoT platform from Google
Android Things - The IoT platform from GoogleAndroid Things - The IoT platform from Google
Android Things - The IoT platform from Google
 
Introducing the Sun SPOTs
Introducing the Sun SPOTsIntroducing the Sun SPOTs
Introducing the Sun SPOTs
 
RAHUL NASKAR IOT.ppt
RAHUL NASKAR IOT.pptRAHUL NASKAR IOT.ppt
RAHUL NASKAR IOT.ppt
 
Generating cross platform .NET based azure IoTdevice
Generating cross platform .NET based azure IoTdeviceGenerating cross platform .NET based azure IoTdevice
Generating cross platform .NET based azure IoTdevice
 
BooT-IoT: A Privacy-Aware Authentication Scheme for Secure Bootstrapping of I...
BooT-IoT: A Privacy-Aware Authentication Scheme for Secure Bootstrapping of I...BooT-IoT: A Privacy-Aware Authentication Scheme for Secure Bootstrapping of I...
BooT-IoT: A Privacy-Aware Authentication Scheme for Secure Bootstrapping of I...
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
 
3 2--power-aware-cloud
3 2--power-aware-cloud3 2--power-aware-cloud
3 2--power-aware-cloud
 
How to Program SmartThings
How to Program SmartThingsHow to Program SmartThings
How to Program SmartThings
 
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdf
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdfAdvanced View Arduino Projects List - Use Arduino for Projects-2.pdf
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdf
 
IRJET- Design and Implementation of IoT based Portable Outdoor Dust Density M...
IRJET- Design and Implementation of IoT based Portable Outdoor Dust Density M...IRJET- Design and Implementation of IoT based Portable Outdoor Dust Density M...
IRJET- Design and Implementation of IoT based Portable Outdoor Dust Density M...
 
ArjunCV
ArjunCVArjunCV
ArjunCV
 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mind
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*
 
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 

More from WSO2

Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected Products
WSO2
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital Businesses
WSO2
 

More from WSO2 (20)

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in Choreo
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on Azure
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdf
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos Identity
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdf
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing Choreo
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected Products
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital Businesses
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformation
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking Experiences
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready Bank
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

WSO2 IoT Server: Implementing Device Gateway Pattern using Android Device & XBee

  • 1. WSO2 IoT Server Implementing Device Gateway Pattern using Android Device & XBee Sumedha Rubasinghe Charitha Goonetilleke June, 2017
  • 2. 2 Solution Overview NEXBOX A95X XBee on USB explorer Arduino with XBee shield Relay module
  • 3. 3 Device Gateway Pattern (N devices / 1 comm. module) NEXBOX A95X XBee on USB explorer Arduino with XBee shield Relay module Device Gateway Edge Devices Communication Module Coordinator
  • 4. 4 Device Gateway Pattern NEXBOX A95X XBee on USB explorer Arduino with XBee shield Relay module Device Gateway Device1 Device2 Device3 Wireless Communication Module Edge Device
  • 5. WSO2 Android Agent on Android TV Box 5
  • 6. WSO2 IoT Platform 6 Device Instance Details Page
  • 7. WSO2 IoT Platform 7 Device in location X Control operations on Android TV Box Control operation for configuring XBee devices Device Instance Details Page
  • 8. WSO2 IoT Platform 8 Sending Video URL to a remote TV box
  • 9. WSO2 IoT Platform 9 Sending message to a remote TV box
  • 10. WSO2 IoT Platform 10 Control messages to XBee module connected to TV box
  • 11. WSO2 IoT Platform 11 Adding an edge XBee device (name,serial #)
  • 12. WSO2 IoT Platform 12 Newly added edge device Light bulb with control operations ON/OFF
  • 14. Edge Computing with Siddhi + Android 14 WSO2 Android Agent WSO2 Siddhi
  • 15. @Plan:name('edgeAnalytics') define stream edgeDeviceEventStream (ac int, window int, light int, temperature float, humidity float, keycard int); @info(name = 'alertQuery') from edgeDeviceEventStream[(1 == ac or 1 == window or 1 == light) and 0 == keycard] select ac, window, light insert into alertOutputStream; @info(name = 'temperatureQuery') from every te1=edgeDeviceEventStream, te2=edgeDeviceEventStream[te1.temperature != temperature ] select te2.temperature insert into temperatureOutputStream; @info(name = 'humidityQuery') from every he1=edgeDeviceEventStream, he2=edgeDeviceEventStream[he1.humidity != humidity ] select he2.humidity insert into humidityOutputStream; @info(name = 'acQuery') from every ae1=edgeDeviceEventStream, ae2=edgeDeviceEventStream[ae1.ac != ac ] select ae2.ac insert into acOutputStream; @info(name = 'windowQuery') from every we1=edgeDeviceEventStream, we2=edgeDeviceEventStream[we1.window != window ] select we2.window insert into windowOutputStream; @info(name = 'keycardQuery') from every ke1=edgeDeviceEventStream, ke2=edgeDeviceEventStream[ke1.keycard != keycard ] select ke2.keycard insert into keycardOutputStream; Sample query 15
  • 16. @Plan:name('edgeAnalytics') define stream edgeDeviceEventStream (ac int, window int, light int, temperature float, humidity float, keycard int); @info(name = 'alertQuery') from edgeDeviceEventStream[(1 == ac or 1 == window or 1 == light) and 0 == keycard] select ac, window, light insert into alertOutputStream; @info(name = 'temperatureQuery') from every te1=edgeDeviceEventStream, te2=edgeDeviceEventStream[te1.temperature != temperature ] select te2.temperature insert into temperatureOutputStream; @info(name = 'humidityQuery') from every he1=edgeDeviceEventStream, he2=edgeDeviceEventStream[he1.humidity != humidity ] select he2.humidity insert into humidityOutputStream; Sample query 16
  • 17. @info(name = 'humidityQuery') from every he1=edgeDeviceEventStream, he2=edgeDeviceEventStream[he1.humidity != humidity ] select he2.humidity insert into humidityOutputStream; @info(name = 'acQuery') from every ae1=edgeDeviceEventStream, ae2=edgeDeviceEventStream[ae1.ac != ac ] select ae2.ac insert into acOutputStream; @info(name = 'windowQuery') from every we1=edgeDeviceEventStream, we2=edgeDeviceEventStream[we1.window != window ] select we2.window insert into windowOutputStream; @info(name = 'keycardQuery') from every ke1=edgeDeviceEventStream, ke2=edgeDeviceEventStream[ke1.keycard != keycard ] select ke2.keycard insert into keycardOutputStream; Sample query 17
  • 18. private void findSerialPortDevice() { // This snippet will try to open the first encountered usb device connected, excluding usb root hubs HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList(); if (!usbDevices.isEmpty()) { boolean keep = true; for (Map.Entry<String, UsbDevice> entry : usbDevices.entrySet()) { device = entry.getValue(); int deviceVID = device.getVendorId(); int devicePID = device.getProductId(); Log.d(TAG, "deviceVID: " + Integer.toHexString(deviceVID) + " devicePID: " + Integer.toHexString(devicePID)); if (deviceVID == 0x0403 && devicePID == 0x6001) { // There is a device connected to our Android device. Try to open it as a Serial Port. requestUserPermission(); keep = false; } else { connection = null; device = null; } Android to USB 18