Send action to ARTIK device

Slides:



Advertisements
Similar presentations
Staying in Sync with Cloud 2 Device Messaging. About Me Chris Risner Twitter: chrisrisner.
Advertisements

Getting Started: Arxterra Control Panel & Android Applications
1Proprietary and Confidential AirVantage API – Getting started David SCIAMMA – June 13th 2014.
App Inventor Barb Ericson July 3, 2013.
UIAlertView, UIActionSheet, and Facebook Connection Lecture 4 1.
Android Fragments.
Fluke thermometer 54II Press green button to turn the thermometer on or off. If it does not turn on replace batteries.
Android Development (Basics)
Intro to Android Programming George Nychis Srinivasan Seshan.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Self Checklist Purchase a Clicker and Turning Account License Create Turning Account Register your Clicker through your LMS (Blackboard, Canvas, D2L,
Self Checklist Purchase a Clicker and Turning Account License
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Mobile Programming Lecture 16 The Facebook API. Agenda The Setup Hello, Facebook User Facebook Permissions Access Token Logging Out Graph API.
Blio App Tutorial for Android. eBooks Axis 360/Blio.
Self Guided Tour of TagMate™QC Display Tag DATA Tag Data: PRINT TagMate™QC SETUP Display STATS Tags: START and READ SEND All Data to PC Additional Capabilities.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
First App Bhanu Kishan. Note Before proceeding further, please go through the MIT App Inventor tutorials in Youtube for better understanding the slides.
Android Boot Camp for Developers Using Java, 3E
Getting to Know Your Computer Your File System Applications What’s running on your machine Its own devices Networking.
How to Register your clicker and set the Channel First of course check- out a clicker at HH 114.
Accessing an ODBC Database. External Data ODBC Command From ACL Project Screen use External Data ODBC Command.
User Interface – Switch Panel 6 Gang Switch Panel Configuration guide RS485 Terminal Fixing hole Bayonet Front ViewBack View.
Cevgroup.org C utting E dge V isionaries. cevgroup.org TODAY’s TALK 1) Internet Of Things (IoT) 2) Wi-Fi Controlled Robots 3) Augmented Reality.
目录 12 in 1 Sensor Features ● PIR motion sensor ● Ultrasonic sensor ● LUX sensor ● Temperature sensor ● 2 Dry contacts ● 2 external condition inputs ● IR(infrared)
Final Presentation Smart-Home Smart-Switch using Arduino
Welcome to Revenue Court Case Monitoring System (RCCMS)
Multiple Access Methods
North Attleboro High School
Multifunctional Sensor
Getting Started: Arxterra Control Panel & Application
The Login Page is the first page your customers
Always Connected introduces Tigo SMART 3.0 This guide is interactive!
Dry contact sensor HDL-MSD04.40 HDL-MSD08.40.
Instructor: Mazhar Hussain
Winsteon Automated Window.
Wireless 4 Buttons Touch Panel
Visual Programming week # 02 APP (Application) Architecture.
Wireless 3 Buttons Touch Panel
Activities and Intents
Social Networks Integration in Android
Mobile Application Development BSCS-7 Lecture # 13
Keypad Lockout - Available June 15, 2015
How to register and use the app for Law Enforcement users?
Firebase Cloud messaging A primer
How to register and use ODMAP for Fire/EMS and other partners
You’re using Top Hat this term!
Collaboration with Google Docs
GSM door opener Model RTU5015 RTU5025 .Different appearance ,the same function.
Cloud-based software to control and manage spend across an organisation, focusing on indirect or non- stock purchases.
CIS 470 Mobile App Development
IBM Systems Middleware Integration – IBM API Economy Strategy
and the properties. I named this lblName.
Putting the I in IoT.
Process Monitoring and Control Systems
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Always Connected introduces Tigo SMART 3.1 This guide is interactive!
Tap Play Store in your mobile.wait for next screen.
Internet of Things Company
Android Programming Tutorial
Programming Mobile Applications with Android
CIS 470 Mobile App Development
Nir Zaidman and Michael Tahar
How to get a CADian authority (Returning client)
Multiple Access Methods
Mobile Programming Dr. Mohsin Ali Memon.
OWS + SureView Integration
Registration Stand By Me
Mobile Programming Broadcast Receivers.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Send action to ARTIK device ARTIK Lecture 3

Overall structure of example Send action to ARTIK device Make your own sensor Send action to ARTIK device

Overall structure of example

Today’s goal - We make our own abstract temperature sensor. - This sensor automatically send random temp at each 1 second. - We can turn on/off our own temperature sensor remotely.

Overall structure My Temp Device Send Action Send Action Monitor data Send data Report Temp data Report Temp data

Device channel (application) Device channel (device) Which API we use? My Temp Device Device channel (application) Device channel (device) Firehose(app) REST API Report Temp data Report Temp data

Warning : Aggregated structure - In this tutorial, android application and own sensor device is aggregated in one application. - So we use one Data channel websocket for both application and device. If you make independent sensor, you should make own data channel websocket for both app and sensor.

Application part & Sensor part Send turn on/off action through data channel websocket(app) when button clicked. Monitor data in real time through firehose websocket. Show data in real time. Sensor part If turn on, send random temp value at each 1 second. (Rest API) Receive action through data channel websocket(sensor). Check action whether it is turn on or turn off. Change state according to it.

Make your own sensor

Go to ARTIK Dashboard/Device type https://developer.artik.cloud/dashboard/devicetypes Click “New device type” button

Write device name Write both name as what you want. However Unique name should be unique in ARTIK cloud. Click “Create Device Type”

Click ‘New manifest’ button Manifest is a kind of recipe of your device. It shows some properties such as what data your sensor will send.

Define device field You can define what kind of data will be sent by your sensor. Save and click ‘next: device actions’ button

Define device action You can define what your device can do. Memory the name of action such as “turnon” and “turnoff” Save and click ‘Next: activate manifest’ button

Check your manifest and activate it Field name : used when we send data Action name : used when we send action

Connect your new device Find your device which you made. If you make your own data type, you can find the device here. This device is shown in only your account.

Memory device ID and device token

Set your application permission Find your device which you made. Turn on read and write permission to your application.

Send action to ARTIK device

Get project Get today’s example project in comnet. This tutorial is similar to previous tutorial which is used in last class. Basic layout xml and onCreate/onResume/onPause function is written. We will write other main process in this class.

See some pre-written code FirehoseWebSocket & DeviceChannelWebSocket both are used. Only one DeviceChannelWebSocket is used. It worked as not only app’s websocket but also sensor’s websocket. Because this example aggregate app and sensor. Boolean ‘turnon’ saves the state of sensor.

See some pre-written code DEVICE_ID : sensor’s device id SOURCE_DEVICE_ID : application’s device id(or name) Name of object who send action. CLIENT_ID : application id (different to SOURCE_DEVICE_ID) DEVICE_TOKEN : device token of sensor device. ACTION_NAME : action names which you define.

See some pre-written code App’s role Define turn on/off buttons click listener. We will make “SendActionInBackground” class which extend AsyncTask.

See some pre-written code App’s role App’s role Sensor’s role Define turn on/off buttons click listener. We will make “connectDeviceChannelWebSocket” method. FirehoseWebSocket is already made as last class.

See some pre-written code Sensor’s role SensorTemp is an AsyncTask which send temp data at each 1 second. OnResume, we execute it and OnPause, stop it.

Connecting Device channel websocket Almost structure is similar to Firehose websocket App’s role Sensor’s role Register source device (who send action) when websocket is open. In both app and sensor, we should register who will send action.

Connecting Device channel websocket Sensor’s role OnAction() is called when device “RECEIVE” an action. So this is sensor part. When sensor receive an action, it check whether the action is turn on or turn off.

Send temp data at each 1 second Extend AsyncTask Sensor’s role If the sensor is turn on it send temp data Sleep 1 second

Send temp data at each 1 second Sensor’s role Send data as you learned in previous lecture. Put data as your defined device field like key “temp” Send data with “Sensor’s device id”

Send action to ARTIK device App’s role Send action with following way. Put source device id (who send action) and device id (who receive action). Sdid : source device id Ddid : destination device id Put action name as you defined.

Overall flow Send action turn on / off in data channel websocket ARTIK onAction() in sensor’s data channel websocket App monitoring data Sensor sending data Send data to ARTIK with REST API ARTIK onMessage() in app’s firehose websocket