Internet-of-Things (IoT)

Slides:



Advertisements
Similar presentations
Variables and Functions ROBOTC Software. Variables A variable is a space in your robots memory where data can be stored, including whole numbers, decimal.
Advertisements

ExamView Test Generator
Login window pops up when signing into the website Internet Explorer white screen and login prompt won’t close.
GOOGLE CHROME SETUP CHROMEBOOKS. DO YOU KNOW WHAT IS A CHROMEBOOK
CS1203 Uploading homework to be graded. C Click Here.
IT:Network:Applications VIRTUAL DESKTOP INFRASTRUCTURE.
Chapter 61 Flags A flag is a variable that keeps track of whether a certain situation has occurred. The data type most suited to flags is Boolean.
Training.
Hands-On Microsoft Windows Server Connecting Through Terminal Services Terminal server – Enables clients to run services and software applications.
Fundamentals of Python: From First Programs Through Data Structures
Basics Dayton Metro Library Place photo here August 10, 2015.
POP Configuration Microsoft Outlook What is POP? Short for Post Office Protocol, a protocol used to retrieve from a mail server. Most.
DataStax Enterprise on Microsoft Azure. BrightView Analytics provides a robust Software-as-a-Service (SaaS) business solution, which delivers critical.
SQL Azure Database Windows Azure SQL Database is a feature-rich, fully managed relational database service that offers a highly productive experience,
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
1 ISA Server 2004 Installation & Configuration Overview By Nicholas Quinn.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
SECURING DATA FOR ER STAFF Windy L. Newton May 29, 2015.
Chapter 14: Remote Server Administration BAI617. Chapter Topics Configure Windows Server 2008 R2 servers for remote administration Remotely connect to.
CSE 305 Theory of Database Tutorial on Connecting with Sybase from Java program and Developing GUI Jalal Mahmud, TA, CSE 305.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
A little PHP. Enter the simple HTML code seen below.
1 Chapter Overview Using the New Connection Wizard to configure network and Internet connections Using the New Connection Wizard to configure outbound.
Esri Maps for Office A brief introduction Dan Ames 9/20/2012.
STRINGS CMSC 201 – Lab 3. Overview Objectives for today's lab:  Obtain experience using strings in Python, including looping over characters in strings.
Learningcomputer.com SQL Server 2008 Configuration Manager.
How To Configure Thunderbird For Your Webspace Account.
Management Software For Engineering Project Management
Client/Server Socket Programming Project
BSG Group - Dau Anh Trong1 Introduction about MS SQL Server 2005.
FTP Using FileZilla CS10001 – Computer Literacy. Step 1: Understanding the Interface Quickconnect Bar Message Log Area Local site navigation (either lab.
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
Uploading Web Page  It would be meaningful to share your web page with the rest of the net user.  Thus, we have to upload the web page to the web server.
PROGRAMMING INFORMATION. PROCEDURES IN PYTHON Procedures can make code shorter, simpler, and easier to write. If you wanted, for example, to use a certain.
Installing and Configuring Windows Server Exam QUESTION 1: You work as an administrator at ABC.com. The ABC.com network.
A little PHP. Enter the simple HTML code seen below.
Profound.js: The future of open source development on IBM i
How to Start SQL Server and SSDT BI in Local
Internet of Things.
A little PHP.
How to use IoT in Bluemix
Written by Anthony McNicoll
Introducing Instructions
Installation and Configuration
RASPBERRY PI WORKSHOP.
MQTT & Raspberry Pi Managing Networked Sensors
NSE4-5.4 Dumps
How to Fix Windows 10 Update Error 0x ?.
The Internet of Things (IoT)
PT0-001 Braindumps Questions
VCE Questions Dumps
Internet-of-Things (IoT)
Step by step guide on IoT data synchronization using MQTT
Internet-of-Things (IoT)
Software Programming J. Holvikivi 2014.
How to your WhiteBox Bridge design
Internet-of-Things (IoT)
MQTT JIRA – 324 Consolidate list of optional server capabilities and review how they are signaled to the client Rahul Gupta.
Loops CIS 40 – Introduction to Programming in Python
DOMOTICA MAY MONTH Sander Claassen John Heesterbeek Ad van Berlo
TA: Donghyun (David) Kim
Message Queuing Telemetry Transport (Internet of Things)
IST346: Internet of Things
Message Queuing Telemetry Transport Lightweight Messaging for IoT
Actively learn student account setup
IP Addresses & Ports IP Addresses – identify a device on a network
Open your Play Store, Look for: Kyocera Mobile Print
Presentation transcript:

Internet-of-Things (IoT) Summer Engineering Program 2018 University of Notre Dame LAB COMPONENT

Assignment 4: MQTT Task 1: Configure MQTT broker Task 2: Write an MQTT publisher for your RPi; your publisher should periodically publish sensor data Task 3: Write an MQTT subscriber for your RPi; your subscriber should activate an actuator Task 4: Work in teams of 2-4 to build a complete IoT system that does something meaningful using at least 2 RPis, 1 sensor, 1 output device, and the MQTT broker (if PIR + LED only, max score is 90%; max score is 100% if at least one new sensor or output device)

RPi Preparations for MQTT sudo apt-get update sudo apt-get install python-pip pip install paho-mqtt

Configure MQTT Broker Sign up for account at: https://www.cloudmqtt.com/ Create new instance: Descriptive name Plan: free Location: doesn‘t matter much Tags: can ignore Click instance to learn server name, username, password, and port number

Backup Broker Information (If Needed) fortuitous-butcher.cloudmqtt.com User: smrpzowq Password: ahxFJm2zWXJF Port: 1883

Set Up MQTTlens Optional, but good for debugging Install/start Chrome Look for MQTTlens Google Chrome application Establish a new connection: use server, username, password, port number Choose a “topic“; subscribe to topic; publish to topic Provides real-time feedback

Using MQTT in Python Program import paho.mqtt.client as mqtt import time import sys #Create a client instance client = mqtt.Client() #Set username and password for broker client.username_pw_set(username, pwd) #Connect to broker connect(host, port) #Start client loop client.loop_start() ... #Disconnect (end of program) client.disconnect() client.loop_stop()

Available Callbacks client.on_log = on_log client.on_connect = on_connect client.on_disconnect = on_disconnect client.on_subscribe = on_subscribe client.on_unsubscribe = on_unsubscribe client.on_publish = on_publish client.on_message = on_message

Callback Examples def on_connect(client, userdata, flags, rc): print("rc: " + str(rc)) def on_message(client, obj, msg): print(msg.topic + " " + str(msg.qos) + " " + str(msg.payload)) def on_publish(client, obj, mid): print("mid: " + str(mid)) def on_subscribe(client, obj, mid, granted_qos): print("Subscribed: " + str(mid) + " " + str(granted_qos)) def on_log(client, obj, level, string): print(string)

Connection Establishment connected = False #initiate connection; in on_connect set connected to True (make sure „connected“ is a global variable) while connected == False         time.sleep(1)

MQTT Publish & Subscribe client.subscribe(topic, quality) client.publish(topic, sensordata)

MQTT Program import statements callback functions create client instance set callback functions for client connect to broker and start loop wait until connection established subscribe to topic(s) (if subscriber) publish to topic(s) (if publisher) if program ended, disconnect and stop loop

MQTT Program while (1): try: #if publisher: mqttc.publish(topic, sensordata) time.sleep(desired_sleep_period) except KeyboardInterrupt: client.disconnect() sys.exit()