Internet of Things CW2 RESIT Session 2020-21 Submission Document

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

V 0.

1 16th June 2021

20/21 B - Internet of Things (MMI123998-20-B)

CW2 Resit Assessment Submission

First Name
Surname
Student ID
Date

Your IBM Cloud


Username
Your IBM Cloud
Password
URL of Node-RED
instance on IBM
Cloud
Node-RED
Username
Node-RED
Password

I declare that this coursework is an original piece of work that has been created only by me. The
work is not based on previous coursework that has been submitted as part of another module or
submitted to another academic programme of study.

I also declare that I have read and understand the guidance on plagiarism that is provided on the
web pages (and the linked pages) at:
1. https://www.gcu.ac.uk/library/smile/plagiarismandreferencing/
2. https://www.gcu.ac.uk/student/support/induction/essentials/itguide/plagiarism/
3. Section 9.6 and related sections of:
https://www.gcu.ac.uk/media/gcalwebv2/theuniversity/gaq/dogfiles/senate/Code%20of
%20Student%20Conduct%202017-18%20GBV%20Policy%20update
%20120218%20FINAL%20UPDATED%20SPSO%20ADDRESS%2018.12.18.pdf

Enter your name below as confirmation of these two declarations.


Name:

Note that the submitted file must be named in the following format:

<SURNAME>_<FIRSTNAME>_CW2_REPORT.docx
If any of the name fields are not applicable for your GCU-registered name then please insert a ‘-‘
(dash) character for that field.

!!!! Please use this document as the template for submission. It is expected that all MS Word styles
and headings will remain exactly as they appear in this template. Please insert the answer directly
below each question. Keep all headings and the text of each question within the document. !!!!

Page 1 of 5
V 0.1 16th June 2021

1 Instructions
The submission is based upon the specification provided in the document: ‘Internet of Things CW2
RESIT Session 2020-21 Technology Specification.docx’.

2 IoT Device

2.1 Description of supplied Node-RED flow

(a) The supplied Node-RED flow in Appendix A of the Technology Specification document
contains a Node-RED function node with the code shown below. Please explain all aspects of
the function code, from receiving a message until returning.

// Array of simulated temperatures


var temp1 = [15, 17, 18.5, 20, 21.5, 23, 24, 22.2, 19, 1];

// Array of simulated relative humidities


var humidity1 = [50, 55, 61, 68, 65, 60, 80, 70, 62, 53];

var counter1 = context.get('counter1') || 0;


counter1 = counter1 + 1;
if (counter1 > 9)
counter1 = 0;
context.set('counter1', counter1);

msg = {
payload:
{
d: {
"temperature": temp1[counter1],
"humidity": humidity1[counter1]
}
}
};
return msg;

(a) Provide a screenshot of the entire deployed IoT Device flow on PC (or Mac). This screenshot
should show all elements of the flow and should also show that that the Watson IoT node and
MQTT node are connected.

(b) Provide the complete exported flow code for the IoT Device.

Exported code for IoT Device

Page 2 of 5
V 0.1 16th June 2021

2.2 Watson IoT Service.

(a) Describe the creation of the Watson IoT Service device entry, including the creation of the
device-type.

(b) Show the credentials that are returned for the creation of device: ‘CW2Dev1’. Explain why
(on first creating these) you should store these credentials securely. Please provide a text
version of these credentials – not a screenshot.

(c) After sending several data entries to the Watson IoT Service, provide a screenshot of the
CW2 Board, showing all three Cards.

2.3 Execution of the IoT Device Application

(a) Take a screenshot of the IoT Device Node-RED Debug panel output for the case where the
temperature value is > 23 and the panel shows a copy of the object sent. Please expand the
object on the panel so that all fields can be seen. The date-time of the Debug output should
also be visible.

(b) Take a screenshot of the IoT Device Node-RED Debug panel for the data received by the
MQTT input (from IBM Cloud) in response to this ‘high-temperature’ situation in part (a)
directly above. Please expand the object on the panel so that all fields can be seen. The date-
time of the Debug output should also be visible.

3 IBM Cloud Node-RED Application

(a) Provide a screenshot of the Dashboard chart showing a history of at least 10 pairs of values
for temperature and humidity.

(b) Provide a screenshot of a Debug output that shows a copy of the incoming message received
from the IoT Device, that triggers your flow to send to your Slack channel. Please expand the
object on the panel so that all fields can be seen. The date-time of the Debug output should
also be visible.

(c) Provide a screenshot of a Debug output that shows a copy of a message sent to your Slack
channel. Please expand the object on the panel so that all fields can be seen. The date-time of
the Debug output should also be visible.

(d) Provide a screenshot from your Slack channel, showing the message received via the message
sent in part (c) above.

(e) Provide a screenshot of a Debug output that shows a copy of the incoming message received
from the IoT Device, that triggers your flow to write to the Cloudant database. Please expand
the object on the panel so that all fields can be seen. The date-time of the Debug output
should also be visible.

Page 3 of 5
V 0.1 16th June 2021

(f) Provide a screenshot (from the Cloudant database service) of the contents of the specific
document inserted into the database in response to the example data in part (e) above.

(c) Provide a screenshot of the entire deployed Node-RED IBM Cloud flow. This screenshot
should show all elements of the flow and should show that the IBM IoT node and MQTT
node are connected.

(g) Provide the complete exported flow code for the IBM Cloud Node-RED application.

Exported code for the IBM Cloud Node-RED application:

OVER/ Marking Scheme

Page 4 of 5
V 0.1 16th June 2021

Marking Scheme CW2 Resit


Section Possible Mark Comments
Mark
IoT Device
Function code description. 6
Watson IoT Device is
configured within Watson IoT 10
Service.
Node-RED Watson IoT node
is connecting to Watson IoT
10
Service. Data can be sent to
the service.
Watson IoT Service Board
10
contains four working Cards.
MQTT node is connected to
5
broker.
MQTT message can be
received from IBM Cloud 5
application.
IBM Cloud Application
IoT data can be received via
10
IBM IoT node.
Dashboard chart working and
14
has clear labelling.
Slack message is sent and
received by Slack channel, for 10
the ‘high-humidity’ case.
MQTT message is sent to IoT
device, for the ‘high- 10
temperature’ case.
A document is stored in the
Cloudant database for the 10
‘low-temperature’ case.
Total 100

Page 5 of 5

You might also like