1 / 29

Introduction to the ARM mbed Platform– A Hands-on Course

Introduction to the ARM mbed Platform– A Hands-on Course. Class 3: mbed Communications and Multitasking. January 11, 2017 Charles J. Lord, PE President, Consultant, Trainer Blue Ridge Advanced Design and Automation. This Week’s Agenda. 1/9 Peeking Under the mbed Hood 1/10 CMSIS, Hands-On

fteneyck
Download Presentation

Introduction to the ARM mbed Platform– A Hands-on Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to the ARM mbed Platform– A Hands-on Course Class 3: mbed Communications and Multitasking January 11, 2017 Charles J. Lord, PEPresident, Consultant, TrainerBlue Ridge Advanced Design and Automation

  2. This Week’s Agenda 1/9 Peeking Under the mbed Hood1/10 CMSIS, Hands-On 1/11 mbed Communications and Multitasking 1/12 The mbed Developer Network 1/13Porting mbed

  3. This Week’s Agenda 1/9 Peeking Under the mbed Hood1/10 CMSIS, Hands-On 1/11 mbed Communications and Multitasking 1/12 The mbed Developer Network 1/13Porting mbed

  4. Connectivity and RTOS Components

  5. Connectivity

  6. Broad Range – One Connection

  7. BTLE

  8. IEEE 802.15.4

  9. IEEE 802.11x

  10. LoRaWAN

  11. More on Ethernet • Sockets • UDP vs TCP • HTTP • Websockets • MQTT

  12. Berkeley Socket Interface 7 Protocol’s Application Layers 6 5 SocketInterface 4 Transport (ex. TCP/UDP) 3 Internet Data Transport Layers 2 Network 1

  13. Berkeley Sockets • API for base layer connectivity • Build modular for wide compatibility Berkeley Socket API

  14. UDP v TCP Sockets

  15. UDP TCP recvfrom()

  16. HTTP: Pros: • TCP based • Widely used • Stateless (open, grab, close) • Request and response Cons: • Bulky (1KB-1MB) • Implementation varies • Every resource requires a new connection

  17. HTTP Contents Request Request line Get/Post, HTTP version Request headers Host, user agent, language, cookies, etc Payload Blob of data (form data, measurement etc) Receive Status line HTTP version, status number Response headers Server, content type and length, cookie update etc Payload Blob of data (binary, HTML etc)

  18. Websockets ws:// Pros • TCP based, port 80 • Live connection • Server <-> client • Native support • Realtime Cons • Does not scale well • Inconsistent support • Requires dedicated server

  19. Websocket connection lifecycle Server Client handshake (http upgrade) connection opened messages open and persistent connection one side closes channel connection closed

  20. MQTT Pros Publish/Subscribe End of life will Small footprint Universal support Security (user/pass) Arbitrary packets Wild card topics Cons Requires server (broker) TCP based Security No formalized packet schema ISO/IEC PRF 20922

  21. MQTT: Publish/Subscribe sub(topic,data) Publisher Broker Subscriber pub(topic,data) pub(topic,data)

  22. MQTT: How Does It Work? Publish/Subscribe to topics Wildcard subscribe (+,#) Client ID LWT - living will Quality of Service (QoS) Three levels QoS L0) ==1 delivery, no confirm QoS L1) 1+ delivery, confirm QoS L2) ==1 delivery, confirm

  23. MQTT Summary Works on mobile, embedded, web, desktop (Seriously, there are libraries for all the languages) Lightweight-ish Medium weight for embedded TCP based (MQTT-SN, but who cares?) LWT is awesome Great for one <-> many Has cordova and Evothings plugin

  24. CMSIS-RTOS

  25. CMSIS-RTOS RTX

  26. CMSIS-RTOS • Standard API for RTOS • The ‘official’ RTOS, RTX, is one option • Our next class in three weeks (note it is at an earlier time), we will look at using Micrium uC/OS with mbed

  27. This Week’s Agenda 1/9 Peeking Under the mbed Hood1/10 CMSIS, Hands-On 1/11 mbed Communications and Multitasking 1/12 The mbed Developer Network 1/13Porting mbed

  28. Please stick around as I answer your questions! • Please give me a moment to scroll back through the chat window to find your questions • I will stay on chat as long as it takes to answer! • I am available to answer simple questions or to consult (or offer in-house training for your company)c.j.lord@ieee.orghttp://www.blueridgetechnc.comhttp://www.linkedin.com/in/charleslordTwitter: @charleslordhttps://www.github.com/bradatraining

More Related