Raspberry Pi, SenseHat and Weather Service

Similar documents
IoT Software Platforms

Real-Time Big Data Processing with Azure

User Guide. TotalGuide xd for ipad. User Guide FOR INTERNAL USE ONLY - NOT FOR DISTRIBUTION TO CONSUMERS OR THIRD PARTIES

KEPServerEX IoTGateway to Azure IoT Hub. Initial Setup and Configuration

Chunghwa Telecom Laboratories. CHT IoT Smart Platform and Ameba. Two-Way Communication Application. Case Instruction Document

Casambi App User Guide

Cisco Spectrum Expert Software Overview

User Manual for ICP DAS WISE Monitoring IoT Kit -Microsoft Azure IoT Starter Kit-

LEGO MINDSTORMS PROGRAMMING CAMP. Robotics Programming 101 Camp Curriculum

University of Cambridge Computing Service EndNote Basic (Online) for Bibliographies Rosemary Rodd 23 May 2014

WindData Explorer User Manual

Android ManageMyTVs Application User Guide Version 3.0

Main menu Top controls

JAMAR TRAX RD Detector Package Power Requirements Installation Setting Up The Unit

How to use EndNote? Training. Faculty of Fisheries and Protection of Waters USB Academic Library of USB March 26, 2015

Using SignalTap II in the Quartus II Software

Colour Features in Adobe Creative Suite

QUICK-START GUIDE LET S JUMP RIGHT IN

Mendeley Basics. Get Mendeley. Get Articles and Documents into Mendeley. Import Citations from a Website

User Guide. c Tightrope Media Systems Applies to Cablecast Build 46

EndNote Web. Quick Reference Card THOMSON SCIENTIFIC

DSP Laboratory: Analog to Digital and Digital to Analog Conversion *

Analyzing and Saving a Signal

User Guide. c Tightrope Media Systems Applies to Cablecast Build 1055

Downloading free Duluth Public Library e-books to your Sony Reader

Members QUICK REFERENCE GUIDE

Harmony Ultimate. User Guide

technology T05.2 teach with space MEET THE SENSE HAT Displaying text and images on the Sense HAT LED matrix

UG147: Flex Gecko 2.4 GHz, 20 dbm Range Test Demo User's Guide

SignalTap: An In-System Logic Analyzer

Casambi Smart Switching

Rogers Enhanced Guide

GET STARTED WITH ACADEMIC WRITER

Cyan Sample. Forward T Software. Infotainment Channel Design Sample. Revision as of January 22, 2009 г. Instruction on Installation and Use

Managing a Time Clock Station

Positive Attendance. Overview What is Positive Attendance? Who may use Positive Attendance? How does the Positive Attendance option work?

The Administrator s Guide to using EndNote online

5620 SAM SERVICE AWARE MANAGER. SMM GNE Driver Version Guide

VIBRIO. User Manual. by Toast Mobile

How to Build A Table of Authorities in Word * By: Morgan Otway

ONLINE QUICK REFERENCE CARD ENDNOTE

For support, video tutorials, webinars and further information visit us at

Quick Reference Manual

Tektronix RSA306 USB Spectrum Analyzer

Viewing Set-Top Box Data

Pi-Star Setup: Connect the LAN cable and then power on the Pi.

R.E.A.D.S. INSTRUCTIONS FOR KINDLE ereaders

NoodleTools Quick Start Guide. For Students & Teachers. For Teachers Only

EndNote for Mac. User Guide. UTS Library University of Technology Sydney UTS CRICOS PROVIDER CODE 00099F

GETTING STARTED WITH ENDNOTE

EndNote for Mac. EndNote for PC. User Guide. UTS Library University of Technology Sydney UTS CRICOS PROVIDER CODE 00099F

Go! Guide: The Notes Tab in the EHR

Lab experience 1: Introduction to LabView

The Kaffeine Handbook. Jürgen Kofler Christophe Thommeret Mauro Carvalho Chehab

The feature SMART Switch makes it possible to use ordinary wall switches as dimmers or for retrieving scenes set up before.

Word Tutorial 2: Editing and Formatting a Document

Save 20% off PostworkShop 3! Click here for the coupon code:

Cisco StadiumVision Defining Channels and Channel Guides in SV Director

2. Get a free Adobe ID at adobe.com (Click Sign In (top right corner), click Get an Adobe ID, fill in the form and click Sign Up)

All about Mendeley. University of Southampton 18 May mendeley.com. Michaela Kurschildgen, Customer Consultant Elsevier

DPS Telecom Your Partners in Network Alarm Management

StrataSync. DSAM 24 Hour POP Report

GUIDE TO GETTING STARTED

ipass Open Mobile 2.0 for Android Quick Start Guide

Tyler SIS Student 360 Mobile

Integrating Device Connectivity in IoT & Embedded devices

QUICK START GUIDE QT ANALOG HD CAMERA & DVR BUNDLE ENGLISH

Wilkes Repair: wilkes.net River Street, Wilkesboro, NC COMMUNICATIONS

1. Material and RMA orders. 2. Send event to my outlook calendar. 3. Engineers allowed to see other engineers calendars (Read-only access)

Activity P27: Speed of Sound in Air (Sound Sensor)

SuperStar Basics. Brian Bruderer. Sequence Editors

Downloading Overdrive E-books and Audiobooks for Tablets and Mobile Devices from the Marion Public Library

Defining and Labeling Circuits and Electrical Phasing in PLS-CADD

Welcome to the U-verse App

An Introduction to The Internet of Things

Using RefWorks Write-N-Cite for Mac v.2.5

AN-003 Displaying the Date and Time on LCD User Stations

Detecting Bosch IVA Events with Milestone XProtect

QUICK START GUIDE. QT Analog HD Camera & DVR Bundle ENGLISH

X-Sign 2.0 User Manual

Harvard Public Library Axis 360 ebooks and eaudiobooks on Android Devices

Getting started with

EndNote Basics Fall 2010, Room 14N-132 Peter Cohn, x8-5596

Franchise Broadcast Info

The world s smartest PVR. User guide 1

Remote Application Update for the RCM33xx

Netflix on the IMC IMC and up. User guide for viewing Netflix Content

Reason Overview3. Reason Overview

Digital Materials on Your Kindle Fire

USER GUIDE. Get the most out of your DTC TV service!

Tyler SIS Student 360 Mobile

Projector Management Application Version 7.00 Instruction Guide

XJTAG DFT Assistant for

How-to Setup Motion Detection on a Dahua DVR/NVR

Whole House Lighting Controller

INTRODUCTION TO ENDNOTE

IPTV Middleware ipad ManageMyTVs Application User Guide

ManageMyTVs App for AndroidTM

Swinburne University of Technology

ENTSOG Professional Data Warehouse System Documentation Transparency Platform User manual

Transcription:

Overview In this lab, you will send environmental information from your RaspberryPi + SenseHat to IoT Platform and display it on a dashboard. You will also use the weather service to check the weather for your area and display weather status on the Sense Hat. It is assumed you have already setup your RaspberryPi and Sense Hat and have Node-RED installed and running on it. Note: some of the tasks below contain a shortened link to the Bluemix dashboard that opens the US South Region. If you wish to use the UK region instead then substitute the link below US South: http://bit.ly/bluemix_new_us UK: http://bit.ly/bluemix_new_uk Copyright IBM Corp. 2017

Task 1. Deploy a New Application In this task, you will deploy a new Node-RED Starter Application and connect it to an existing IoT Platform. If you prefer you can deploy a new IoT Platform Starter. You will also add a new Weather Company service to the application. 1. Deploy new application: a. Open your Bluemix dashboard: http://bit.ly/bluemix_new_us b. In the All Apps section, click Create App:: c. In the Search bar, type node-red d. Click the Node-RED Starter Boilerplate: TIP: TIP: e. Give the new application a unique name Suggestion: IoT-BB-SenseHat-Weather-YourInitials+DOB f. Click Create g. Wait for the application to deploy Check the logs and look for the message Started Flows 2. Connect an existing IoT Platform Service a. Click the Connections tab in the sidebar: Raspberry Pi, SenseHat and Weather Service - 2 Copyright IBM Corp. 2017

b. Click Connect New: c. In the Search field, type weat d. Click the Weather Company Data service: e. Click Create: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 3

f. Click Restage to restage the application: g. Wait until the application has finished restaging and is running: 3. Connect an existing IoT Platform: a. Click Connect existing: b. Click an existing IoT Platform service: c. Click Connect: d. Click Restage e. Wait for the application to finish restaging 4. Open the IoT Platform: a. Click the IoT Platform service to open it: Raspberry Pi, SenseHat and Weather Service - 4 Copyright IBM Corp. 2017

b. Click Launch Dashboard 5. Add a new Device Type a. In the sidebar, click Devices: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 5

b. Click the Device Types tab: c. Click Create Type: d. Click Create device type: e. In the Name field, type SenseHAT: Raspberry Pi, SenseHat and Weather Service - 6 Copyright IBM Corp. 2017

f. This is all the information required so click Next a few times until it turns into Create g. Click Create 6. Create a new device: a. On the Devices page, click Browse: b. Click Add Device: c. In the Choose Device Type field, select SenseHAT: d. At the bottom of the page, click Next e. In the Device ID field, type WeatherDisplay: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 7

TIP: You can use any ID you like you will enter the same device type and device id into Node-RED on the Pi in a few minutes. f. Click Next g. There is no Metadata so click Next h. In the Provide a token (optional) field, type 12345678 TIP: You can use any token you like as long as you can remember it. If you do not enter one then one will be generated for you which will be a very long string which you must record. Once the token has been generated and you close this page you can never get back to it. i. Click Next j. Click Add k. Record the Organization ID, Device Type, Device ID and token you will need these in a moment on your Pi: Task 2. Create a Flow on Raspberry Pi In this task, you will create a simple flow on your Raspberry Pi to read environmental information and send the data to the IoT Platform instance you created/connected to in Task 1. 1. Create a flow: a. Make sure Node-RED is running on your Raspberry Pi. b. Open a new web browser tab and navigate to the address of your Pi Flow editor for example: http://192.168.1.146:1880/ Raspberry Pi, SenseHat and Weather Service - 8 Copyright IBM Corp. 2017

c. From the palette, drag on a Sense HAT input node: d. Double-click the new node to edit it e. Clear Motion events f. Clear Joystick events: g. Click Done h. Drag on a debug node and connect it to the Sense HAT node: 2. Deploy and Test: a. Click Deploy b. Note the Sense HAT information in the debug panel: 3. Send data to IoT Platform: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 9

a. From the palette, drag on a Watson IoT output node: b. Double-click the new node to edit it: c. In the Connect as section, select Registered: d. Click the pencil icon in the Credentials field to add new credentials: e. Enter the device credentials you recorded in the previous step: Raspberry Pi, SenseHat and Weather Service - 10 Copyright IBM Corp. 2017

TIP: Be careful copying and pasting from the web dialog in IoT platform it is very easy to copy additional characters f. Click Add g. Click Done h. Connect the SenseHAT node to the Watson IoT node: 4. Deploy and Test a. Click Deploy b. Switch back to the Watson IoT Platform tab c. You should now be seeing SenseHAT data in IoT Platform: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 11

5. Unguided Exercise: a. Create Boards in the IoT Platform to display the Sense HAT data TIP: You will need to create a schema in IoT Platform. If you are unsure how to do this see the IoT Bootcamp lab on Sensor Data Visualization Task 3. Obtain Weather Data In this task, you will get the weather data from the Weather Service using location data from your home town. You will need the latitude and longitude which can be obtained from this website: http://ibm.biz/nasa-loc-finder. You will then publish some of the returned weather data to IoT Platform and modify the application on the Pi to subscribe to it such that the SenseHAT displays different colours based on the outside temperature. 1. Obtain your location co-ordinates: a. Open a new web browser tab and navigate to: http://ibm.biz/nasa-loc-finder b. Enter your location and click Search: Raspberry Pi, SenseHat and Weather Service - 12 Copyright IBM Corp. 2017

c. Record the co-ordinates reported: 2. Add a flow a. Return to the Bluemix tab b. Open the Node-RED Flow Editor in the application you deployed on Bluemix c. From the palette, drag on a weather insights node: d. Double-click the new node to edit it e. In the Service field, select Current Observations f. In the Location field, paste in the co-ordinates you obtained from the previous step: TIP: If you copy and paste be sure to remove the space between the longitude and latitude Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 13

g. Drag on a debug node and change its Output to msg.observation TIP: Check the Info tab for the node to see the other options h. Drag on an inject node and connect the nodes as shown below: 3. Deploy and Test: a. Click Deploy b. Activate the inject node and observe the results in the output window: Raspberry Pi, SenseHat and Weather Service - 14 Copyright IBM Corp. 2017

4. Separate temperature data: a. From the palette, drag on a change node b. Double-click the new node to edit it c. In the Name field, type Get Temp d. In the to field, change the type to msg e. In the to field, type observation.temp: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 15

f. Click Done g. Connect the weather insights node to the change node: 5. Publish Command IoT Platform: a. From the palette, drag on an ibmiot output node b. Double-click the new node to edit it c. In the Authentication field, select Bluemix Service d. In the Output Type field, select Device Command e. In the Device Type field, type SenseHAT f. In the Device Id field, type WeatherDisplay g. In the Command Type field, type setdisplay h. In the Data section, type {} TIP: The Data section will be overridden by the msg.payload Raspberry Pi, SenseHat and Weather Service - 16 Copyright IBM Corp. 2017

i. Click Done j. Connect the iot output node to the change node: 6. Publish at predefined intervals: a. Double-click the inject node to edit it b. In the Repeat field, select interval c. Change the interval to default as every 10 seconds Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 17

TIP: In a real system, you would only need to publish every few minutes/hours or even longer depending on the need. In the free version, you are only allowed 10 calls per minute. d. Click Done TIP: If you wish to test the flow before switching to the Pi simply add an iot input node and subscribe to the SenseHAT commands: Raspberry Pi, SenseHat and Weather Service - 18 Copyright IBM Corp. 2017

Task 4. Set the SenseHAT Display for Current Weather Conditions In this task, you will modify the flow to subscribe to commands from the IoT Platform and change the color of messages on the SenseHAT depending on current external temperature. 1. Subscribe to Weather commands: a. Switch to the Node-RED Flow Editor on your Raspberry Pi b. From the palette, drag on a Watson IoT input node: c. Double-click the new node to edit it d. In the Commands field, select specify command: e. In the Command field, type setdisplay: TIP: Remember these are still MQTT topics so you could have a topic tree and subscribe to specific commands as well as trees / branches f. Click Done 2. Process the command payload: Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 19

a. Open the supplied weathercheck.txt file in a text editor b. Copy all the text c. In the Node-RED Flow on your Pi, click the burger menu button and select Import à Clipboard: d. Paste in the copied text e. Click Import: f. Left-click on the flow canvas to place the new nodes Raspberry Pi, SenseHat and Weather Service - 20 Copyright IBM Corp. 2017

g. Connect the new switch node to the iot input node you just created: 3. Deploy and Test a. Click Deploy b. The SenseHAT should now display the current temperature using a colour that reflects whether it is warm or cold 4. Unguided exercise: a. Try building your own weather station dashboard b. Try storing the data in cloudant / dash so that later you can build an app to read that data at faster speeds and get time-lapse weather data for use in demos! Copyright IBM Corp. 2017 Raspberry Pi, SenseHat and Weather Service - 21

Raspberry Pi, SenseHat and Weather Service - 22 Copyright IBM Corp. 2017