Embedded Systems and IOT Unit-4

You might also like

Download as pdf
Download as pdf
You are on page 1of 60
_ UNIT Iv loT Communication and Open Platforms TS syllabus ication Models and APIs - IoT Ce ic JoT Communicat “ommunication Protocols - Bluetooth - WiFi- ss GSM modules - Open Plaform (ike Raspberry Pi) trehteenre = Prograntne Interfacing ~ Accessing GPIO Pins - Sending and Receiving Signals Using GPIO Pins - Connect to the Cloud. . ‘Contents 41 [oT Communication Models and APIs 62 loT Communication Protocols 63 ZigBee 64 GPS 65 GSM Modules 66 Open Platform : Raspberry Pi Architecture 67 Raspberry Pi Interfacing 6.8 Raspberry Pi Programming 69 Connecting to the Cloud 610 Two Marks Questions with Answers @ scanned with OKEN Scanner OB loT Communication and, p en loT Communication Models and APIs + Io devices connect and communicate through their technical gp, . models. An effective communication model shows how the process Ng helps one understand how communication can be done, . The Internet of Things enables people and things (devices) to yy sony wherever they are, using any network or service they like. IoT allows to td multiple devices (things) to communicate with each other. conn There are four basic types of IoT communication models as given are ag i Request-Response Model, Publisher-Subscriber Model, Push-Putl yg: Exclusive Pair Model. and Request / Response model : * In the Request / Response model, client requests information from the waits till the response is served from the server. Fig. 6.1.1 shows Response model. Server ang Request HTTP 200 OK (content) Fig. 6.1.1 Request / Response model * HTTP protocol is used by Request / Response model. For example, a browser client may request a web page from the server through a "Request" and the corresponding web page will be served by the server as a "Response". The client and the server can communicate one to one or one to many with more requests, This model is stateless communication model and each request-response pait is independent of others. Publish / Subscribe model : Publishers : Publishers generate event data and publishes them. * Subscribers received. + Subscribers submit their subscriptions and process the evens Publish/Subscribe service : It's the mediator/broker that filters and routes ever’s from publishers to interested subscribers, TECHNICAL PUBLICATIONS® - an up-thrust for knowledge _ @ scanned with OKEN Scanner 23 e : Lo Conmnton gus Publish / Subscribe mode Opn Pay fms Fig. 6.4.2 Publish / Subscribe model piishers and subscribers are autonomous, which eno the presence of each other. ch means that they do not model i puted embedded systems. quitous computing and sure of publishers or subscribers does not bring down the ene syste sus if sgrong guarantee on broker to deliver content to subscriber. A SOT event, it assumes that all corresponding subsethers nag Pet . in brok : would receive it. ‘Potential bottleneck in brokers when subscribers and publishers overload them, sh Pull model : " puia procedure push the data to queues and consumers pull the data fom the ues, Fig, 6.3 shows push-pull model Publisher | +f aueve2 E1 Consumer Consumer © Fig. 6.1.3 Push - pull model Simetimes does queue act as buffer in between producer and consumer. Producer iteed to be aware of the consumers. It model : Ai at ; sion model fommunication model is full duplex, bi-direction@! Ee excusive stent connection between client and server Fig. 6.14 ahrst for know? TECHNICAL PUBLICATIONS® - 2” UP © Scanned with OKEN Scanner ~*~ Embedded Systems and loT 6-4 LoT Communication and op en for connection Response (ACK) Data “Client |-_--—*"§ + server Data +ACK Request for closing connection Response for closing connection Fig. 6.1.4 Exclusive Pair model * Client send request to server for opening the connection. This connectio, n is till the client send request for closing the connection. Pen loT Communication APIs 1. REST based communication API : + A large part of the interoperability, scale, and control for IoT can be achieves through API management. Standards-based design patterns for Web APIs, apy management, and a RESTful architecture provide tremendous value in simpliyng the task of interoperability across heterogeneous systems handling vast amounts of data. + Representational State Transfer (REST) APIs follow the request-response communication model. * Applications conforming to the REST constraints can be called RESTful. RESTful systems typically communicate over HTTP with the same Methods (GET, POST, PUT, DELETE etc) that browsers use to retrieve web pages and to send data to remote servers. 1. Client-Server : Requires that a service offer one or more operations and that services wait for clients to request these operations. 2. Stateless : Requires communication between service consumer (client) and service provider (server) to be stateless. 3. Cache : Requires responses to be clearly labeled as cacheable or non-cacheable. 4. Uniform interface : Requires all service providers and consumers within 4 REST-compliant architecture to share a single common interface for al operations. as it 5. Layered system : Requires the ability to add or remove intermediaries * runtime without disrupting the system, TECHNICAL PUBLICATIONS® - an up-thrust for knowledge @ scanned with OKEN Scanner “pode-on-Demand : Allows logic wi ated independently from ger “Toon service Providers to consume Hh alent FQUESE ANG server tegen PE ears expect each message io pg nt 2 apple jntain all the information sy a ie this Kind of message are", es n client and server can haye lecessay compl Stateless” oo TPlete the eta ies Pag request methods and actions ; data, SSB paso 4, GBT Return whatever information ig identified by . ey eR HEAD oa fo GET except that the serv. }equest-URy, ~ message-body in oe only the meta ae eT Must not a 4, OPTIONS : Retum information about the commun ~ the request/response chain identifieg by the \Unication 4 PUT + Requests that the enclosed ¢ Request-URI. oe RequestUR, OS alable on THY be stored under the Supplied POST : Requests that the origin server aq i ‘cept the entity as a new subordinate of the resource id YY enclosed in Request-URI. te the resource identified by the ’ lentified by the he request '& DELETE : Requests that the origin server del Request-URI. The first three are read-only operations, While the last tree are write operations based Communication API : cket support full-duplex, two-way communication between client and t APIs reduce the network traffic and latency as there is no overhead for fonnection setup and termination requests for each message. |WebSocket uses a standard HTTP requestresponse sequence to esblsh a ion. When the connection is established, the WebSocket API provides a id write interface for reading and writing data over the established on in an asynchronous full duplex manner. it tion gt also provides an interface for asynchronously closing the conne ‘om either side, Communication Protocols te yf JoT syste nication protocols are used as a backbone of unication protocols ao connectivity and coupling to applications. Co to exchange data over the network for knowiedg® TECHNICAL PUBLIGATIONS® - nus! @ scanned with OKEN Scanner —d al a 6-6 loT Communication and Open Pa | Embedded Systems an ms forms error correction and detection, icati performs error CO «Communication protocol also perio 1g mechanism etc. data encoding, addressint . ion are the ; + Sequence control, lost of packet retransmissi other funetong communication protocol. Bluetooth Bluetooth is a wireless technology that enables a wireless device to communicate in the 2.4 GHz Industrial Scientific and Medical (ISM band). ‘The number of hardware manufacturers adapting the Bluetooth technology 3 providing Bluetooth modules is rapidly increasing. This has made the modules Feasonably cheap and is driving the market to provide smaller highly integrateg products. ‘This, on the other hand, benefits adaptive markets such as the sensor market Hopefully, Bluetooth opens up possibilities of creating cheap, efficient, wire sensor- and control networks. Bluetooth is a short range, low cost and Iow power wireless communication standard. Today, we can find Bluetooth chips. Embedded in PCs, laptops, digital cameras, GPS de-vices, Smart Phones and 3 whole range of other electronic devices. Bluetooth supports point-to-point and point-to-multipoint connections. '* Bluetooth operates in the 2.4 GHz Industrial, Scientific and Medical (ISM) band at a maximum data rate of 720 kbps. It uses Frequency Hopping Spread Spectrum that divides the frequency band yielding 79 channels. The modulation used is a Gaussian-shaped binary Frequency Shift Keying (GFSK) modulation scheme. AW cont less «Fig. 6.2.1 shows use of Bluetooth in embedded system. Bluetooth Bluetooth PC modules modules Fig, 6.2.1 Use of Bluetooth in embedded system * Bluetooth uses TDD (Time Division Duplex) to perform full-dupl communication. The master defines slots of time and allocates one slot per s!#¥* TECHNICAL PUBLICATIONS® - an up-thnist for knowledge @ scanned with OKEN Scanner 1d lo 6-7 ce! e !oT Communication and Open Platforms [e organized in maste th lave modi i leat “ind up to 255 slaves in py ‘ode, The topology supports 1 master, arked oe ot al ies. mode. The master defines the clock and time * master cal request - change his role with a slave, at which point the slave ‘mes the master and the master becomes the slave. For example : A head pone starts the communication as a master, but it prefers to be the slave. Two pasic topologies are possible in Bluetooth : Piconet and Scatternet Topology. devices have 3 modes to sav i ssi juetooth @ power energy in tr i . ae : sniff mode, hold mode and parked mode. rl WiFi |, WiFi means Wireless Fidelity. It is a wireless technology that uses radio frequency to transmit data through the air. The standard for Wireless Local Area Networks (WLANs). It's actually IEEE 802.11, a family of standards. Wi-Fi is based on the 902.11 standard : 802.11a, 802.11b and 802.11g, « IEEE created standard, but Wi-Fi Alliance certifies products. The Wireless Ethernet Compatibility Alliance started the Wi-Fi--wireless fidelity--certification program to ensure that equipment claiming 802.11 compliance was genuinely interoperable. WiFi systems are the half duplex shared media configurations, where all stations transmit and receive on the same radio channel. WiFi combines concepts found in CSMA/CA and MACAW, but also offers features to preserve energy. The developers of the 802.11 specifications develop a collision avoidance mechanism called the Distributed Control Function (DCF). According to DCF, a Wifi station will transmit only when the channel is clear. All transmissions are acknowledged, so if a station does not receive an acknowledgement, it assumes a collision occurred and retries. ISM Band * ISM stands for Industrial, Scientific, and Medical. ISM bands are set aside for equipment that is related to industrial or scientific processes or is used by medical equipment. * Pethaps the most familiar ISM-band device is the microwave over which operates in the 2.4-GHz ISM band. * The ISM bands are license-free, provided that devices are low-power. You don't Reed a license to set up and operate a wireless network. * WLAN architecture : Ad-Hoc mode : Peer-to-peer setup where clients can connect to each other directly. Generally not used for business networks. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge @ scanned with OKEN Scanner 6-8 Embedded Systems and joT ther directly. It's set up for g a sad of time. For example, the participants: oy si create an ad hoc network at the beginning 7 wnon the meeting ends. laf Communieation and Open py form *Pltom i each ol + Mobile stations communicate tO purpose and for a short meeting in a conference r00! the meeting and dissolve it w! «© Wi-Fi network services are as follows + 1. Distribution and integration : 2, Association, re-association and disassociation 3, Authentication and deauthentication id iva " t 4. . laa a eae is used by mobile stations in an infrastructure netizoy, every time they send data, Once a frame has been accepted by an access point, uses the distribution service to deliver the frame to its destination. Any communication that uses an access point travels through the distribution service, including communications between two mobile stations associated with the same access point. © Integration : Is a service provided by the distribution system; it allows the connection of the distribution system to a non-IEEE 80211 network, ‘The integration function is specific to the distribution system used and therefore is not specified by 802.11, except in terms of the services it must offer. * Association : Delivery of frames to mobile stations is made possible because mobile stations register, or associate, with access points. The distribution system can then use the registration information to determine which access point to use for any mobile station, * Reassociations : When a mobile station moves between basic service areas within a single extended service area, it must evaluate signal strength and perhaps switch complete, it is as if the station i station is no longer attached to the network. Disassociation is a polite task to do during the station shutdown process, The C is, ho F i ie ck pre 5. MAC ii disassociating. ‘ons that leave the network without formally TECHNICAL PuBLIcarioy © 89 Up-thrust for knaudacinn @ scanned with OKEN Scanner systems and loT 6-9 Be ion / deauthegagg ito Opn ts uthetication / deauthentication unicatic Open Prattorms A m y Physi: wired LAN security solution, Wited eng uly 18 a major offices. Wireless networks ca letwork's equipm component of a however and therefore must al offer the same a aA be locked inside i lepend on additi of physical securit ensure that users accessing the network a additional authentication Tian a necessary prerequisite to ass © authorized es to . to do ay i ‘ciation 80. Authentication i authorized to use the network, because only auth isso taste e eauthentication termin. 7 ee ied before netw Ae an authenticated relationship. B F is neede ork use is authorized, a side effet of deamon termination of any current association. effect of deauthentication is «Each 802.11a/b/g device can o} i perate in one of four i i possible modes : 4. Master mode (also called AP or infrastructure mode) is used t is that looks like a traditional access point, ee Manages a is sometimes also referred to as client mode. Wireless cards in manage’ met le will join a network created by a master and will automaticall change their channel to match it. 7 Ad-hoc mode creates a multipoint-to-multipoint network where there is no single master node or AP. In ad-hoc mode, each wireless card communicates directly with its neighbors. 4, Monitor mode is used by some tools to passively listen to all radio traffic on a given channel. When in monitor mode, wireless cards transmit no data. EE] ZigBee + ZigBee is built on top of the IEEE 802.1544 standard. ZigBee provides routing and multichop functions to the packet-based radio protocol. ZigBee is a registered trademark of the ZigBee Alliance. 802.154™ is a trademark of the Institute of Blectrical and Electronics Engineers (IEEE). 802.154 defines the physical and MAC layers, and ZigBee defines the network and application layers. * ZigBee is the primary protocol which builds on the 802.154 standard, adding @ network layer capable of peer-to-peer multi-hop mesh networking, a ee ae capable of handling complex security situations, and an application layer for interoperable application profiles. * The 802.15.4 specification was created and is specification defines the physical (PHY) and Media A of a personal area, low-power wireless network. * ZigBee is a wireless standard for home and com ZigBee Alliance, established in 2002. It is based on latest version of the standard is known § ZigBee Pi owiedge TECHNICAL puBLiCATIONS® ~ an up-thrust for kr j is maintained by IEEE. This ccess Control (MAC) layers mercial use developed by the an IEEE 802.154 standard, The ro and was published in 2007, @ scanned with OKEN Scanner ation and Oy 599 JoT Communical PEN Platform, Embedded Systems and loT e «A major feature of the ZigBee protocol is its mesh network topology tha ie self-healing and auto-routing. Mesh networks do not depend on any single connection; if one link is broken, devices search through the mesh to find anothe, available route. This capability makes a ZigBee-based network very reliable ang onal ZigBee Alliance, an open, is inistered by the ZigBee 7 Non-profit ansechton of approwimaely 400 members. The Alliance certes produce or promotes worldwide adoption of ZigBee as the wirelessly networked standard fo sensing and control in consumer, commercial and industrial areas. The ZigBee specifications enhance the IEEE 802.15.4 standard by adding network and security layers and an application framework. * ZigBee is an open, global, packet-based protocol designed to provide an easy-to-use architecture for secure, reliable, low power wireless networks. Flow or Process control equipment can be place anywhere and still communicate with the rest of the system. It can also be moved, since the network doesn't care about the physical location of a sensor, pump or valve. ZigBee targets the application domain of low power, low duty cycle and low data rate requirement devices. Figure below shows the example of a ZigBee network. TEEE 802.15.4 supports star and peer-to-peer topologies. The ZigBee specification supports star and two kinds of peer-to-peer topologies, mesh and cluster tree, ZigBee-compliant devices are sometimes specified as supporting point-to-point and point-to-multipoint topologies. Features 1. Stochastic addressing : A device is assigned a random address and announced, Mechanism for address conflict resolution. Parents node don't need to maintain assigned address table, 2, Link management : Each node maintains quality of links to neighbors. Link quality is used as link cost in routing. 3. Frequency agility : Nodes experience interfe : rence ser, which then selects another channel, apetenrer aa | 4, Asymmetric link : Each node may be asymmetric, has different transmit power and sensitivity. Paths @ scanned with OKEN Scanner id loT + 6-11 Jo Communication and Open Platforms igBe® Architecture rig 621 sO" position of ZigBee and IEEE 802.15.4, Gale Gana ‘Application layer i ——r— [Profi ‘ ‘Appl support i - Application profile a] twork Ne Zigbee network | | [Application framework : SSCS Network layer Link MAC oe MAG layer oe [ IEEE 602.15.4 868/915 2450 154 Physical TE Gaye Fig, 6.3.1 Zigbee stack layers above MAC and PHY, including the NWK (network) layet, APS, ZDO and security layers. Tt ZigBee that provides the mesh retworking and multihop capabilites, enhances the reliability of data packet delivery and specifies application-to-application interoperability. ZigBee does not use all of the 802154 MAC/PHY specification; only @ small subset. This allows stack vendors to offer smaller solutions by providing a limited MAC for their ZigBee stacks. ZigBee is asynchronous. Any node may transmit at any time, Only the CSMA/CA, a MAC/evel mechanism, prevents nodes from talking over each other. Application (APL) Layer : The top layer in the ZigBee protocol stack consists of the Application Framework, ZigBee Device Object (ZDO) and Application Support (APS) Sublayer. Application Framework : It pi the ZigBee stack, It also specifies a range of stan descriptors to assist in service discovery, frame formal key value pair construct to rapidly develop simple attribute-based profiles. ee device. A single ZigBee node lication object supports endpoints ZigBee specifies all the rofile onto rovides a description of how to build a p dard data types for profiles, ts for transporting data and a Sa at an endpoint that controls the ZigB “Upports up to 240 application objects. Each app TECHNICAL PUBLICATIONS® - an upethrust for knowledge ‘ Scanned with OKEN Scanner T Communication and ©, 6-12 ie nn OPN Pleterng Embedded Systems and loT 41 p40 (with endpoint 0 reserved for the ZigBee pi numbered between 1 an Object (ZDO). eel ZigBee Cluster Library (ZCL) is a brary of Se i sites by any application, This allows common clusters t0 be revs baste i OF differen, fnctonal domains, for example, the same lighting clus oe can be used for an, application that requires lighting controls, such as home automation a4 commercial building automation. + Each cluster has two "ends", client and server. Working of Zigboo ; : + ZigBee basically uses digital radios to allow devices to communicate with ong ts of several types of devices. A Network another. A typical ZigBee network consis i coordinator is a device that sets up the network, is aware of all the nodes within its network, and manages both the information about each node as well as the information that is being transmitted/received within the network. Every ZigBee network must contain a network coordinator. Other Full Function Devices (FFD's) may be found in the network, and these devices support all of the 802.15.4 functions. They can serve as network coordinators, network routers or as devices that interact with the physical world. Requests for ‘manipulates ient f- -| Server the data In the output In the input cluster lst cluster list Fig. 6.3.2 * The final device found in these networks is the Reduced Function Device (RFD), which usually only serve as devices that interact with the physical world. Logical Device Types * Fig, 63.3 shows Zigbee network. ZigBee Coordinators (ZCs) form networks. * The ZigBee stack resides on a ZigBee logical device. There are three logical device types : Coordinator, Router and End device, It is at the network layer that the di : | ifferences ii ionalit aoe are determined, It is expected that in a ZigBen meen are "i TECHNICAL PUBLICATIONS® . an up-thrust for knowledge @ scanned with OKEN Scanner p — systems and [oT tn a ZigBee network there is «In 2 vad only one coordinator c network. The number of and/or end devices depends on fhe application feqirements and the Maditions of the physical site. within networks that support sleeping end devices, the coordinator or one of the routers must be designated as Primary Discovery Cache Device. These cache devices provide server services to routers 6-13 End device’ Coordinator | \ aa loT Communication and Open Platforms \ et” Router “<* l Router End device E> End device f > 4 Pa : Fig. 6.3.3 Zigbee network upload and store discovery information, as well as respond to discovery requests, on behalf of the sleeping end devices. Function of ZigBee coordinator : It forms a network. It esi tablishes the 802.15.4 channel on which the network will operate. It establishes the extended and short PAN ID for the network. | Tt decides on the stack profile to use (compile or run-time option). It acts as the arbiter for End-Device-Bind (a commissioning option). It acts as a router for mesh routing. . Tkacts as the top of the tree, if tree routing enabled. Function of ZigBee routers : . Finding and joining the " . Participating in routing, Rene correct " network . Perpetuating broadcasts across the network including discovering and maintaining routes 5. Storing packets on behalf of sleeping children * Functions of ZigBee end-devices : 1. Finding and joining the " correct " network TECHNICAL 1 2 3. 4. 5, It acts as the Trust Center for secure applications and networks. 6. 7. 8. Allowing other devices to join the network (if permit-join enabled) PUBLICATIONS® - an up-thrust for knowledge @ scanned with OKEN Scanner t loT Communication ang Embedded Systems and loT ont¢ Spe” Plato, 2. Polling their parents to see if any messages were sent to them while they were | asleep. Finding a new parent if the link to the old parent is lost (NWK rejoin) Sleeping most of the time to conserve batteries when not in use by 4, application. ZigBee Network Formation 1, Forming a Network : © The coordinator initiates network formation. « After forming the network, the coordinator can function as a router & can accept requests from other devices wishing to join the network. * Depending on the stack and application profile used, the coordinator might alsy perform additional duties after network formation. 2. Joining a Network * A device finds a network by scanning channels. © When a device finds a network with the correct stack profile that is open to joining, it can request to join that network. * A device sends its join request to one of the network's router nodes & the device receiving the request can then use the callback to accept the request or deny it 3. Network Communication * All nodes that communicate on a network transmit and receive on the same channel, or frequency. * ZigBee uses a Personal Area Network Identifier (PAN ID) to identify a network this provides a way for two networks to exist on the same channel while still maintaining separate traffic flow. Network Layer * The Zigbee networking layer is probably one of the most complex layers in the protocol stack. * Network layer responsibilities : Establishment of a new network. 1 2. New device configuration, addressing assignment, network synchronization 3. Frames security | 4. Message routing, | TECHNICAL PUBLICATIONS® - an up-tnrust for knowledge @ scanned with OKEN Scanner fe loT Communicatic ystems and [OT the transmit — side, the APS layer septation Sub Layer (APS) = gends data down to the network ST ‘APS Rx layet via a data request. Inside haf ===" the data request, the APS specifies NWK layer| the destination address, whether Ni nee or not route discovery will be je NWK Rx allowed, and the radius. Nw seu The radius js the maximum hops ------------4>--7> 7 : that the frame will be allowed to : travel. This is mostly used in MAC Tx MAC Rx. 7 proadcasts. Once inside the data MAC layer est, the network header is Tied out and then the address is Hate examined. probably best to make a distinction between network addressing are two sets of addresses in each Zigbee frame : the dresses and the Zigbee network source/destination At this point, it's and MAC addressing. There 902.15.4 source/destination a addresses. ZigBee uses two unique addresses per node : a long address (MAC address) and a short address (Network address). also called the IEEE or MAC address, is assigned by the 202.154 radio), and does not change for the life ely identifies the widget from all other the 64 bits (8 bytes) of this address space vyices for every square meter on earth. controlled by IEEE. A block of Each IEEE address uniquely ‘The top three bytes (24 bits) and the bottom five bytes (OEM). The long address, manufacturer of a device using an of the device. The long address uniqi 802.154 widgets in the world. In fact, are large enough to include 123, 853 de ‘The IEEE address space, surprisingly enough, is them can be purchased by the manufacturer, identifies this node from any other node in the world, ae called the Organizational Unique Identifier (oun, (40 bits) are managed by the Original Equipment Manufacturer ( Components : 1. Network Layer Data Entity (NLDE) : 2. Network Layer Management Entity (NLME) = discovery, route discovery, joining/leaving 4 network, -- ‘Makes NPDU from NSDU Configure new device, neighbor TECHNICAL PUBLIGATIONS® - an upethust for knowledge ; aia @ scanned with OKEN Scanner 6-16 lo Communlation ond Open Pay Embedded Systems and [oT ome Capabilities (RFD/FFD), Security Jove ‘ighbor 3. Network Layer Information Base (NIB) : rotocol ve : i ' ‘sion, route discovery time, max retries for route discovery PI table, «Fig 63.5 shows ZigBee network layer frame format. Sie | Multicast] Source an | 3r| soa | Rave ieee end | IEEE ader| control | route |Pevoad mn 16> | 16> ted 8 Ol’ 64D (OG4D_ O/B Variable urce Dest Sto Tipe | eng [carer aa | Seeuty | Toute [ee addr| IEEE addr | Resva Ff 4b tb tb tb 4b tb ab 00 Data 00 No discovery 01 Command 01 If no route, discover 10 or 11 Reserved 11 Foree discovery Fig. 6.3.5 ZigBee network layer frame format Simple Tree Routing Protocol * The tree network addresses are assigned using a distributed addressing scheme, ‘These addresses are unique within a particular network. As a result, acquire the relationship of two nodes through their network addresses, * The ZC becomes the root of the tree. Every device except the ZC has @ parent re child nodes. A ZED acts as a leaf in a router can the tree topology. * Fig. 6.3.6 shows tree architecture, @ Ziovee coordinator @ ZioBee router © zo ~~~ Depth o ~>-~ Depth 1 >>> = Depth 2 >> >= Depth n >> >= Depth n+4 @ scanned with OKEN Scanner systems: and loT 6-17 3 potted JoT Communication and Open Platforms a tree topology, the role of the ZigBee i oe nigue oi aes be oe : paar e to establish the network : 2 : tablist i ordinator determines the maximum number of node i ae eas Cm is the maximum number of chi a eee er of children and ‘Rm’ is the maxi aximu nber cae a aa may have as children. In addition, each node has a attbute ed es which - the minimum number of hops to reach the ‘ coordinator using 01 ly parent-child link. The ZigBee coordinator itself has a depth : zero and it determines the maximum tree depth of the network (Lm). also acknowledged, is only available in Stack Profile 0x01. Tree is just as pandwidth-efficient as mesh, and more efficient in terms of memory. But it has a major drawback: If links between parent and children break, it has no recovery. 50 ZigBee uses mesh by default. No communication overhead. : More transmission delay (not optimal path) Wher of ‘Tree routin: Advantages : Disadvantages failure. [EEF ZigBee-AODV (ZAoDV) tocol in ZigBee is a route discovery protocol si and Single point of « Another routing pro imilar to Ad-hoc On-demand Distance Vector Routing. AODV is a reactive protocol, ie» the network stays silent until a connection is requested. If a node wants to communicate with another one, it broadcasts a request to its neighbors who re-route the message and safeguard the node from which they received the message. Ifa node receives a message and it has an entry corres} in its routing table, it returns a RREP through the revers node. So, the source sends its data through this path to minimum number of hops. ponding to the destination e-path to the requesting the destination with the ther node without having the to send data to ano! .n initiates a route discovery In ZAODV, when a node desires related routing information, it buffers the data and thei process to find the optimal path for the destination. 1. Routing Table (RT) 2. Route Discovery Table (RDT) 3. Route Request Command Frame (RREQ) 4, Route Reply Command Frame (RREP) The ZigBee routing algorithm uses 4 path Toute discovery and maintenance. @ scanned with OKEN Scanner cost metric for route comparison during See ee ee eee ee Ss ee —— Embedded Systems and loT 6-18 lot Communication snd Open ay 1m, RREQ 1. The source node broadcasts a route request (RREQ) packet. 2. If a intermediate router receives an new RREQ it add RDT entry and rebroag.., the RREQ. 3. If a intermediate router receives an old RREQ, it shall compare the Forwarg Coy in the RREQ to the one stored in the RDT entry. 4. If the Cost is less, the router shall update the RDT entry and rebroadcast 4 RREQ again. 5. Using Source Address and Route Request ID, the RREQ can be unique identified. RREP 1. The destination node receives the RREQ, it responds by unicasting a route rep) (RREP) packet to its neighbor from which it received the RREQ. 2. The destination will choose the routing path with the lowest cost and then send ; route reply. 3. Finally, when the RREP reaches the originator, the route discovery process j finished. : * ZAODV can effectively reduce the transmission delay. However, the procedure 0 flooding RREQ wastes significant amount of bandwidth, memory and devia energy, and might cause a "broadcast storm" problem. TEES ops Layers * Application Support Sublayer (APS) is responsible for : 1. Binding tables Message forwarding between bound devices Group address definition and management Address mapping from 64-bit extended addresses to 16-bit NWK addresses . Fragmentation and reassembly of packets 6. Reliable data transport . The key to interfacing devices at the need/service level is the concept of binding Binding tables are kept by the coordinator and all routers in the network. Tht binding table maps a source address and source endpoint to one or mor destination addresses and endpoints. The cluster ID for a bound set of devices wil be the same, Ae PY g TECHNICAL PUBLICATIONS® - an up-thrust for knowledge @ scanned with OKEN Scanner ee layer is responsible for providing a data service to i 8 1 a the applicatic and the storage of the binding table itself, via | zighee's security services include methods for key establishment and transport, fevice management, and frame protection. The ZigBee specification defines rity for the MAC, network and APS layers. Security for applications is pically provided through Application Profiles, |. The APS layer allows frame security to be based on link keys or the network key Encryption can be applied at three different levels, the MAC layer, Network layer and the Application Support (APS) layer. A ZigBee frame will contain fields from all of these layers encapsulated within one another, and each later can encrypt its data payload. « The APS layer is also responsible for providing applications and the ZDO with key establishment, key transport, and device management services. Fig. 6.3.7 shows Zigbee frame with security on The APS level. Application of security suite adds auxiliary header and also an integrity code PHY | MAG | NWK] APS [Auillary] Enoryeted APS SYNC] oR | HOR | HOR |HOR| HOR | payload DS All of the above APS frame is integrity-protected Fig. 6.3.7 Zighee frame with security on the APS level vices provide the mechanism by which a ey, with another ZigBee device. Key tor device and a responder device, + ‘The APS sublayer is key establishment se ZigBee device may derive a shared secret k establishment involves two entities, an initia and is prefaced by a trust-provisioning step. fy ZigBee Applications * There are numerous applications th: and self-healing capabilities of ZigBee wirel 1. Energy management and efficiency : control of energy usage, provide customers wi : choice, better manage resources, and help to reduce environmental impact. e flexible management of lighting, heating tems from anywhere in the at are ideal for the redundant, self-configuring Jess mesh networks. Key ones include : "To provide greater information and th better service and more 2 Home automation : To provide mor and cooling, security, and home entertainment syst home. TECHNIGAL PUBLICATIONS - an up-thrust for knowledge @ scanned with OKEN Scanner 20 loT Communication ang o, Embedded Systems and loT et : ‘0 integrate and central 3, Building automation : To heating, cooling and security. foe 4, Industrial automation : To extend existing manufacturing and proces. cont systems reliability. Ei crs « The Global Positioning Sy: ) a consisting of a constellation of satellites bro: H tations and satellite control stations used for Monitoring ang e management of 4 Wghtin, B stem (GPS) is a space-based radio-navigation adcasting navigation signals network of ground st control. GPS system time is associated with Coordinated Universal Time or Ut¢ : observed by the US Naval Observatory. The accuracy of GPS is based on the clear and fine visibility of the sky, ang ay obstructions by means of tree branches or building density may lead to limite accuracy in the forest and urban areas. GPS satellites transmit signals to provide accurate PVT information to an unlimited number of users on the Earth. GPS satellites broadcast a signal that encodes position and time with a high accuracy derived from the satellite's atomic clock time standard. The GPS receivers use the time-of-arrival ranging to generate pseudorange to determine the user's position. * Currently 31 GPS satellites orbit the Earth at an altitude of approximately 11,000 miles providing users with accurate information on position, velocity and time anywhere in the world and in all weather conditions, * GPS includes three main segments : The space segment, control segment and user segment. * Fig. 6.4.1 shows GPS system. (Gee Fig. 6.4.1 on next page) The GPS space segment includes over 30 satellites in orbit operated and maintained by the US. Space Force. These satellites broadcast radio signals to control and monitoring stations on Earth and directly to users requiring highly precise satellite positioning. The USS. Space Force also oversees the GPS control segment. It includes mast" control and backup control stations, dedicated ground antennas and seve! monitor stations located worldwide. These stations work to ensure GPS setelit are healthy, oxbiting in the correct locations and have accurate atomic cloc % board. These stati . constelanee ators ate integral to the overall health and accuracy of TECHNICAL PUBLICATIONS® an up-rust for knowledge @ scanned with OKEN Scanner 1 lo Communication and Open Platforms Space segment GNSS Satellites GNSS Broadcast signals GNSS Control channel lay — 2 4 User segment Master control an ba stations stations Control segment Fig. 6.4.1 GPS system + The user segment includes everyone relying upon GPS satellites for PNT measurements. From a mobile phone providing directions to autonomous vehicles requiring lane-level positioning accuracy; from a farmer tracking planting and harvesting routes year-over-year to @ UAV mapping a rainforest, many applications use GPS for high precision positioning and accuracy around the world. EG csm Modules GSM stands for Global System for Mobile digital cellular radio. It is a second generatio voice services and data delivery using digital modulation. GSM support 200 full duplex channels per cell. Each channe! and downlink frequency. mbination of FDM, TDM and slotted ne handles channel access using @ CO) OHA. GSM is an open source system and it allows access to code. GSM comes in three flavours (frequency bands) : 900, 1800, 1900 MHz, Frequency and 900 is the orange flavour in Israel. Voice is digitized using full-rate coding. communication. It is widely used for 1 cellular standard developed to cater 1 uses different uplink TEGHNIGAL PUBLICATIONS® - an up-trust for owed? @ scanned with OKEN Scanner ey foT Communication and Open Plato a Embodied © Maximum distance the GSM supports Is 35 kilometers. Most 2G Gs, netwo, operate in the 900 MHz or 1800 MHz bands while 3G GSM in the 2199 a frequency band, . # The phyateal channel {n GSM is the timeslot, The logical channel is the informajg which goes through the physical channel. Both user data and signaling are login channele * User data is carried on the traffic channel (TCH), which is defined as 26 TDMA frames. There are lots of control channels for signaling, base station to Mobile, mobile to base station, i * Performance characteristics of GSM : Communication : Mobile, wireless digital communication; support for yoicg a) and data services. b) Total mobility : International access, chip-card enables use of access points of different providers. c) Worldwide connectivity : One number, the network handles localization. 4) High capacity : Better frequency efficiency, smaller cells, more customers per cell, e) High transmission quality : High audio quality and uninterrupted phone calls at higher speeds. f) Security functions : Access control, authentication via chip-card and PIN * Fig. 6.5.1 shows GSM architecture. GSM architecture consists of three subsystem : 1. Base Station Subsystem (BSS) 2. Network Switching Subsystem (NSS) 3. Mobile station (Cell phone) PSPDN Network subsystem Fig. 6.5.1 GSM architecture TECHNICAL PUBLICATIONS® an up-hrust for knowiedge ad @ scanned with OKEN Scanner 6. 23 lo Communication and Open Platforms nto ae capt _ ] * Not all the GPIO pins are programmal f aan ‘VDC positive power pins, some of them are negative ground pins ang 4 fy of them are marked DNC (do not connect): «The PI header has 17 programmable pins and the PS header adds 4 more, ‘+ Fig, 646.2 shows GPIO pin header. | «+ Reading from various environmental sensors, Writing output to de moto | "| ; LEDS for status. | Power Input + Micro-USB connector is used for power input __ Status LED _ ¢ It has five status LED. | | col ‘= Camera Serial Interface (CSI) can be used to connect a camera module to ‘ Raspberry Pi SD Card Slot » This card is used for loading operating system + The Raspberry Pi comes with a set of 26 exposed vertical pins on the board. These pins are a General Purpose Input /Output interface that is purposely not linked to any specific native function on the Raspberry Pi board. Raspberry 1 hea PIN® Namo Namo PIN# 3.3 VDC power | [6] © |» 5.0 VDC power @ SDAo(2c) |@ © [* once 9 scio(i2c) »|@OQ]o oviGround) 7 GPIO7 ]© ©[e no 15 ONC oO©O]s Ro 16 0 GPIOO =]|@O|s sriot 1 2 GPIO2 21© ©|z onc 3 GPIO3 21©@©O]a crios 4 ONC =1©©|a cPios 5 12 MOSI 21©©]8 onc 13 MISO 31@©|8 cris 6 44 SCLK 81 © ©[¥ ceo 10 DNC 8}0 ©O[8 cet 1 Us Cc a Aa Fig, 6.6.2 GPIO pin header TE ‘CHNICAL PUBLICATIONS® - an up-hrust for knowledge “ @ scanned with OKEN Scanner i systems and loT 6-37 | Gr pie an gam a Open atoms instead, the GPIO pins are there explicit i ly f hardware access directly to the board for the peo mS © ser to have k ile the pur . low-level poards, peripherals, LCD display screens Purposes of attaching other hardware and other hardware devices to the Pi, : Lights when the SD card ig accessed (marked OK on earlier boards) ‘Hooked up to 33 V power | | | On if network adapter is full duplex | Network activity light i i On if the network connection + The Raspberry Pi draws its power from a microUSB port and requires a microUSB-to-AC adapter. Because the Pi is a micro computer and not simply a cell phone getting a battery topped off, you need to use a high quality charger with stable power delivery that provides a consistent 5V with at least 700mA minimum output for older model units and 2.5 A for the Pi 3. [Hd Linux on Raspberry Pi * There are several unix like operating systems for the RPI and there is an operating system called RISC OS that has its origin at the developers of the first ARM chips. * The Raspberry Pi Foundation recommends the use of the following Linux Distributions: 1. Debian 7 2. Raspbian 3. Arch Linux ARM 4. QtonPi * Raspbian is a free operating system based on Debian optimized for the Raspberry Pi (RPI) hardware. * The default command prompt on the Pi consists of four compon Rig. 663, * Respbian is the desired operating system download and install the operating system on Raspbian, Win32Disklmager and USB memory cat ents shown in erry Pi. In order to for the Raspbeny ill need to our Raspberry Pi; you wil d reader. knowledge TECHNICAL PUBLIGATIONS® - an up-frust fOr ie — @ scanned with OKEN Scanner 6-38 Embedded Systems and loT 1. Download both —-Raspbian and Win32Disklmager and save somewhere easily accessible lof Gommuniction and Opn Patm, working username directory 2. Plug the USB memory card reader into pi@raspbenypi your computer . hostr t 3. Open Win32DiskImager peal) 4, Find the location of the image file and this the memory card 5. Click "Write" Fig. 6.6.3 Command prompt Logging In * Now itis time to tum on our Raspberry Pi, When the memory card, HDMI lead, Ethernet cable, mouse and keyboard are plugged in, plug in the power lead, * As soon as you do this. You screen should be black and filled with white tex This will be visible every time you turn on your raspberry pi. * Wait until your screen reads “raspberrypi login :" [ENTER] Password = raspberry [ENTER] Username = pi Se ery en eer TT RTT 7 RTBU Coe rm sarararet a} RULE eae on rar Part an Ronin Tet COL ae er rane ir DOr eet Starting the Raspblan GU} * GUI stands for Graphical User Interface nest common type of user interface a interact with the computer, [t makes u: hence the name ‘Graphical’ User Interf and is a type of operating system. It is the s it is a very ‘friendly’ way for people Se of pictures, graphics, icons and pointets ce. Fig. 6.6.4 shows Rasbian Linux desktoP TECHNICAL PUBLIcaTiON<® @ scanned with OKEN Scanner Oe lor Communication and Open Platforms Esp ‘paok partitian ta Fill ‘Change overscan a Set keyboard layout Change passward far Set Jocale Set tinezone Change nenbry split : Contigire overclocking Hots “Enabin on disable ssb server “Start desktop ov boot? Tey ta ugeade pen t-eont i SD card ‘pi? user

You might also like