Communication API
Communication API
API and
Amazon web
services
Introduction to cloud storage models
Cloud computing is a transformative computing paradigm that involves
delivering applications and services over the internet
Popular cloud storage models are,
Web application messaging protocol(WAMP)
Xively’s platform-as-a-service(PaaS) which provides tools and services for
developing IoT solutions
Amazon Web Services(AWS) and their applications for IoT
Communication API
Cloud models are relied on communication API
Communication API facilitate data transfer, control information transfer from
application to cloud, one service to another
It also exist in the form of communication protocols
It supports RPC. PUBSUB and WAMP
Eg. Popular API is RESTful API (communication in cloud model)
Django web framework is used to implement communication API
WAMP AutoBahn for IoT
Web Application Messaging Protocol
Sub-protocol of Web socket which provides PubSub & RPC messaging pattern
Transport : channel that connects two peers
Session : conversation between two peers that runs over a transport
Client : peers that can have one or more roles
In publish – subscriber model, client can be:
Publisher: publisher publishes events to the topic maintained by the Broker
Subscriber : subscriber subscribes to the topics and receives the events
including payload
In PRC model, client can be:
Caller : Issues calls to the remote procedures along with call arguments
Callee :Executes the procedures to which the calls are issued by the caller
and returns the results back to the caller
Router : Routers are peers that perform generic call and event routing
In publish – subscribe model, Router has role of Broker,
Routes messages published to topic to all subscribers subscribed to the topic
In RPC model Router has the role of a Broker:
Dealer : acts as router, routes RPC calls from Caller to Callee & routes results
from Callee to Caller
Application Code: Application code runs on the Clients(Publisher,
Subscriber, Callee or Caller
Xively Cloud for IoT
Commercial Platform as a Service for the Internet of Things
Supports hundreds of platforms, millions of gateways and the billions of smart
devices
Comprehensive and secure infrastructure services
Online development tools and development center
Xively is an IoTCloud platform
It is an enterprise platform for building, managing, and deriving business
value from connected products
It also provides the cloud base API
It supports platforms and technologies like Android, Arduino, c etc.
Xively is a Platform as a Service which exposes its service via RESTful
API
It supports messaging service based on MQTT
Python Web Application Framework – Django
Django is an open source web application framework for developing web application in python
A web application framework is a collection of solutions, packages and best practices that allows
development of web application and dynamic websites
Django is based on Model – Template- View architecture and provides separation of data model
from business rules and user interface
It provides unified API to a database backend
Thus web applications built with Django can work with different databases without requiring any
code changes
With this flexibility in web application design combined with the powerful capabilities of the Python
language and the Python ecosystem, Django is best suited for cloud application
Django consists of an object –relational mapper, a web templating system and a regular– expression
based URL dispatcher
Django Architecture
Model
Acts as definition of stored data and handles interactions with database
In a web application, data can be stored in a relational database, non- relational database, an
XML file, etc
Django model is Python class that outlines variables and methods for particular type of data
Template
In a typical Django web application, the template is simply an HTML page with a few extra
placeholders
Django’s template language can be used to create various forms of text files(XML, email, CSS,
JavaScript, CSV, etc)
View
The view ties the model to the template
The view is where you write the code that actually generates the web
pages
Amazon Web Services for IoT
AWS IoT provides the cloud services that connect your IoT devices to other devices and AWS
cloud services.
AWS IoT provides device software that can help you integrate your IoT devices into AWS IoT-
based solutions.
If your devices can connect to AWS IoT, AWS IoT can connect them to the cloud services that
AWS provides.
AWS IoT lets you select the most appropriate and up-to-date technologies for your solution.
AWS IOT core support these protocols:-
MQTT (Message Queuing and Telemetry Transport)
MQTT over WSS (Websockets Secure)
HTTPS(Hypertext Transfer Protocol - Secure)
LoRaWAN (Long Range Wide Area Network)
The AWS IoT Core message broker supports devices and clients that use MQTT and
MQTT over WSS protocols to publish and subscribe to messages.
It also supports devices and clients that use the HTTPS protocol to publish messages.
AWS IoT Core for LoRaWAN helps you connect and manage wireless LoRaWAN (low-
power long-range Wide Area Network) devices.
AWS IoT Core for LoRaWAN replaces the need for you to develop and operate a
LoRaWAN Network Server (LNS).
How the devices and apps access AWS IoT
AWS IoT Device SDKs:- Build applications on your devices that send messages to and
receive messages from AWS IoT.
AWS IoT Core for LoRaWAN:- Connect and manage your long range WAN
(LoRaWAN) devices and gateways by using AWS IOT for core LoRawan.
AWS Command Line Interface (AWS CLI):- Run commands for AWS IoT on
Windows, macOS, and Linux.
AWS IoT API:- Build your IoT applications using HTTP or HTTPS requests. These API
actions allow you to programmatically create and manage thing objects, certificates, rules,
and policies.
AWS SDKs:- Build your IoT applications using language-specific APIs. These SDKs
wrap the HTTP/HTTPS API and allow you to program in any of the supported languages.