CS 5412/LECTURE 3 PROGRAMMING AN IOT SYSTEM
Ken Birman Spring, 2019
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 1
CS 5412/LECTURE 3 Ken Birman PROGRAMMING AN I O T SYSTEM Spring, - - PowerPoint PPT Presentation
CS 5412/LECTURE 3 Ken Birman PROGRAMMING AN I O T SYSTEM Spring, 2019 HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 1 HOW DO WE PROGRAM THE I O T CLOUD? This is a very rapidly evolving and exciting question! To give some context,
Ken Birman Spring, 2019
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 1
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 2
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 3
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 4
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 6
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 7
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 8
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 9
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 10
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 11
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 12
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 13
Event Meaning Issues On/Off/Idle Power mode When turned on, must authenticate NewIMG Took a photo Should we download it? How fast is the link? StorageWarning Low on space Which images to delete FocusWarning Dirty sensor Something is preventing auto-focus from working.
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 14
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 15
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 16
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 17
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 18
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 19
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 20
WiFi link Azure IoT Edge “Point of Presence” High Speed Internet Link (but connectivity may be intermittent) Azure Intelligent IoT Cloud This is the normal Azure cloud, but extended to manage IoT devices in a smart way
Azure Function Server
First stage of filtering might handle, discard or transform the event Camera event Camera event
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 21
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 22
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 23
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 24
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 25
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 26
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 27
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 28
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 29
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 30
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 31
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 32
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 33
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 34
Idle Swivel Focus Take Photo Handle various mundane events Movement sensed! Point the camera Send swivel command to Camera {args…} Motion event {args…} Pointed! Focus the camera Send focus command to Camera {args…} Camera movement done {args…} Focused! Take a photo Send photo command to Camera {args…} Focus operation done {args…} Captured photo {info, } Orange: “camera to Azure IoT” Green: “Azure IoT to camera”
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 35
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP
3 6
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 37
Current State: Data in the (key,value) store can hold any information you like Version=17
New Event Function launched to handle it Triggered action (issued after successful state update)
Updated state replaces prior state (“Replace state version 17 with state version 18”)
1 2 3 4 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 38
Current State: Data in the (key,value) store can hold any information you like Version=17
New Event Function launched to handle it Must retry!
Tries to update version 16, but version has changed to 17…
1 2 3 4 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 39
Current State: Data in the (key,value) store can hold any information you like Version=18
New Event Function launched to handle it Triggered action (issued after successful state update)
Updated state replaces prior state (“Replace state version 18 with state version 19”)
1 6 7 8 9
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP
4
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 41
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP
4 2
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP
4 3
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 44
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 45
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 46
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 47
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 48
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 49
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 50
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 51
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 52
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 53
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 54
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 55