- Mohit Sharma

Internet of Things and Urban Sensing

©2019 Mohit, NYU CUSP 

https://slides.com/mohitsharma44/urban-sensing-2019​/live

https://github.com/Mohitsharma44/CUSP-GX-6004-C​

Coursework

mohit sharma (mohit.sharma@nyu.edu)

Day 1
Introduction to IoT
- What is IoT
- Why IoT
Communication Models
Introduction to using Raspberry Pi as an IoT module
- What is a Raspberry Pi
- Using Raspberry Pi as a platform for prototyping
Hands-on
- Demo installing OS on Raspberry Pi
- Refresher on basic Linux commands
- First login and setting things up for next session
Go Crazy with the Pi's for the rest of the day!!

What should you expect from this session?

mohit sharma (mohit.sharma@nyu.edu)

  • Understand the idea of Internet of Things.
  • Basic technical aspects involved with the Internet of Things.
  • Familiar with the Raspberry Pi hardware architecture.
  • Working knowledge on setting up a Raspberry Pi for IoT development.
  • Able to ssh into your Raspberry Pi IoT module

Collaborate

mohit sharma (mohit.sharma@nyu.edu)

 

Shared Document: bit.ly/iot-notes

(For adding notes, points, need clarification, misc.)

 

Github Repo:
https://github.com/Mohitsharma44/CUSP-GX-6004-C

(Code / Scripts)

Connect to WiFi AP

mohit sharma (mohit.sharma@nyu.edu)

Connect to WiFi: iotclass-5, 
(authentication: iotclass)
Do Not Stay on NYU or NYU-legacy or any other AP

Do NOT connect to iotclass

If you cannot see iotclass-5, let me know.

What is IoT

mohit sharma (mohit.sharma@nyu.edu)

  • Current top Tech buzzwords
  • Large corporations value its market in tens of trillions of dollars.
  • There are also plans to release tens of billions of connected devices.
  • Despite this, nobody seems to agree on what Internet of Things (IoT) actually is.

The only thing people agree on is that whatever it is, it is worth a lot of money.

What is IoT

mohit sharma (mohit.sharma@nyu.edu)

  • Internet of Everything
  • Web of Things
  • Internet of People and Things
  • Machine-to-Machine
  • Cyber-Physical Systems
    (...)

And where there is a lot of money, there is a lot of competition, which means there is a lot of confusion!

But in order to proceed, we need to Define IoT

What is IoT

mohit sharma (mohit.sharma@nyu.edu)

Before we define IoT, let's look at why IoT?

  • IoT was a term first coined by Kevin Ashton, a British technology pioneer in 1999 when most data on the Internet was entered or captured by human beings.
  • Ashton coined the term to illustrate the power of using Radio-Frequency Identification (RFID) tags in order to count and track goods more efficiently and without any human intervention.
  • But, if systems can access data captured by sensors directly, of course, the data will be both more abundant and more correct . This was known decades ago and is a field of study in its own right, labeled "sensor networks".​

What is IoT

mohit sharma (mohit.sharma@nyu.edu)

  • So IoT = Sensor networks?
    IoT is not same as sensor networks since `Things` doesn't have to be sensors and similarly sensor networks doesn't HAVE to be connected to Internet.
  • ​So IoT = Big data?
    IoT is not same as Big Data because `Things` are not required to capture or generate data.
  • M2M?
    IoT is not part M2M because being on Internet, it is implied that humans can access these `Things` directly.
    And No, IoT is also not CPS because CPS concern themselves with non-Internet protocols for transfer of messages between devices etc.

What the .... is IoT ?

mohit sharma (mohit.sharma@nyu.edu)

A very simple definition would go something like this:

The IoT is what we get when we connect `Things`, which are not operated by humans, to the Internet.

This is IoT

mohit sharma (mohit.sharma@nyu.edu)

Something you can connect to..
Something that can connect to you..
Something that is connected to internet..
Something that senses..
Something that crunches and exchanges data..
Something that automates..
Something that connects to other things..

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

From an operational perspective, it is useful to think technically about how the IoT devices connect and communicate. (RFC 7452)

  1. Device to Device Communication
  2. Device to Cloud Communication
  3. Device to Gateway Model
  4. Back-End Data-Sharing Model

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

Device to Device (D2D) Communication

  • Devices will be the main users in the IoT ecosystem and thus D2D communication[1]

Smart Bulb

Smart Switch

Wireless Network
e.g. Bluetooth, Z-Wave, ZigBee
  • These network allows devices that adhere to a particular communication protocol to communicate.
  • Eg. Home Automation -- lights, door locks, thermostat etc.

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

Device to Cloud (D2C) Communication

  • In this model, the IoT device connects directly to an Internet cloud application service provider.

Device with Sound sensor

Device with CO
sensor

HTTP, TLS, TCP, IP

CoAP, UDP, IP

Application Server

Eg. NEST, Samsung Smart TVs, etc.

CUSP's $4.2M NSF-funded project -- SONYC uses this model in production!

And so will we, in this course!

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

Device to Gateway (D2G) Communication

  • In this model, the IoT device connects to an Internet cloud application service provider via Local Gateway.

Device with Sound sensor

Device with CO
sensor

HTTP, TLS,
TCP, IP

CoAP, UDP,
IP

Application Server

Local Gateway

IPv4 / IPv6

Bluetooth, WiFi, Ethernet, LR-WPAN

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

Back-End Data-Sharing Model

  • Users can export and analyze the smart object data from a cloud service in combination with data from other sources.

Device with Sound sensor

Device with CO
sensor

HTTP, TLS,
TCP, IP

CoAP, UDP,
IP

Application Server 1

Application Server 2

Application Server 3

Protocol Buffers,
JSON

Communication Models

mohit sharma (mohit.sharma@nyu.edu)

What governs the selection of communication models?

  • Technical complexity
  • Availability of resources
  • Open versus Proprietary nature of the IoT devices
  • Device interoperability
  • Enabling user (adding value to the user) 

Raspberry Pi

mohit sharma (mohit.sharma@nyu.edu)

Introduction to Rpi as an IoT module

Raspberry Pi

mohit sharma (mohit.sharma@nyu.edu)

That's all it takes to start using Raspberry Pi

Get to know your IoT module

Total of 4 USB 2.0 ports
10/100 Mbps Eth port
28 GPIO Pins*
MicroSD card
Video
Out
5V 2A 
DC_supply

Raspberry Pi

mohit sharma (mohit.sharma@nyu.edu)

Get to know your IoT module

26 "general use" GPIO pins

  • UART  / serial communication (Pin 8, 10)
    
  • Communicate with external peripheral like Arduino (I2CPin 3, 5, 27, 28) 
  • Pulse code modulation (Pin 12, 35, 38, 40)
  • General Purpose Clock (Pin 7, 29, 31) and so on ...
You may want to check out: https://pinout.xyz

mohit sharma (mohit.sharma@nyu.edu)

image credit: http://www.flaticon.com/authors/eucalyp
SensorX
Rpi
Data!

Not So Fast!

Get to know your IoT module

mohit sharma (mohit.sharma@nyu.edu)

SensorX
Rpi
Data!
0.46020967,  2.34629644,  0.16289884,  1.7682243 ,  1.09522783
0, 1
Analog
Digital

Why?

Example

mohit sharma (mohit.sharma@nyu.edu)

SensorX
Rpi
0, 1
Analog
Digital

So?

Example

ADC

ADC

1.10, 1.66, 2.21, 2.77, 3.33, 3.89, 4.44, 5.00

mohit sharma (mohit.sharma@nyu.edu)

1.10, 1.66, 2.21, 2.77, 3.33, 3.89, 4.44, 5.00
0, 1, 
10, 11, 
100, 101, 110, 111
Analog
Digital

How?

ADC

example of ADC
MCP3008

ADS1x15

Raspberry Pi

mohit sharma (mohit.sharma@nyu.edu)

Get to know your IoT module

Debian optimized for the Raspberry Pi hardware
  • Debian has a reputation within the Linux community for being very high-quality, stable and scalable.
  • Extensive and friendly user community.

mohit sharma (mohit.sharma@nyu.edu)

Installing Raspbian

Default Raspbian Jessie [Lite and Desktop]

Customized Raspbian

Other OS [Ubuntu, Windows IoT Core]

mohit sharma (mohit.sharma@nyu.edu)

Default Raspbian Stretch
[Lite and Desktop]

Download the Raspbian Stretch image

Prep the micro SD card

Flash micro SD card

mohit sharma (mohit.sharma@nyu.edu)

Customized Raspbian

Download PiBakery

Fire up PiBakery

CUSP IoT2017

PiBakery

mohit sharma (mohit.sharma@nyu.edu)

Other OS*

* I haven't tested these in-depth

mohit sharma (mohit.sharma@nyu.edu)

Our Lab!

mohit sharma (mohit.sharma@nyu.edu)

Hands On!

Connect to WiFi: iotclass-5, 
(authentication: iotclass5)

Go to: http://192.168.1.99:8888
(note the port number)

Login with your NYU net-id

Download the ssh key
(Make note of the IP address (this is where your Pi is waiting for you!!)

mohit sharma (mohit.sharma@nyu.edu)

What should you expect from this session?

  • Learn Logging!!
  • Collecting Stats from Pi
  • Things involved in setting up server - client communication
  • Basics of Websocket
  • Real-time Visualization
  • Technologies for client server communication.
  • Sending some sensing data to the server

mohit sharma (mohit.sharma@nyu.edu)

Connect to WiFi AP

Connect to WiFi: iotclass-5, 
(authentication: iotclass)
Do Not Stay on NYU or NYU-legacy or any other AP

Do NOT connect to iotclass

If you cannot see iotclass-5, let me know*.
* well, I really dont have spare laptops, so just peep into your neighbors

mohit sharma (mohit.sharma@nyu.edu)

Keep Updating the shared Document

 

Shared Document: bit.ly/iot-notes

(For adding notes, points, need clarification, misc.)

mohit sharma (mohit.sharma@nyu.edu)

Uh - Oh!

(Check): sudo dpkg -L wireless-tools

(If not installed): sudo apt-get install wireless-tools

(Install): sudo apt-get update
(Install): sudo apt-get install curl python-pycurl

(Install): sudo pip install psutils

mohit sharma (mohit.sharma@nyu.edu)

Feedback

Live Poll (will end by tonight)

Link: http://etc.ch/2w8c

mohit sharma (mohit.sharma@nyu.edu)

Poll Check!!

Made with Slides.com