diff_months: 13

MMI126818-21-B IoT Assignment

Download Solution Now
Added on: 2023-05-02 07:50:32
Order Code: //priority code
Question Task Id: 0
  • Subject Code :

    MMI126818-21-B

  • Country :

    Australia

Task 1 – Creating and deploying a Google Core IoT device for use with the sensor data  

Part (a) of this task represents a common challenge, interpreting the functionality of some new code  that you are given. 

  • You are provided with the Node-RED code and a spreadsheet.  
  1. The spreadsheet represents a range of sensor data (two sensors) for specific dates/times.  
  • The code should be deployed to your PC Node-RED. 
  • The code requires the following Node-RED library to be installed first: 
  • node-red-contrib-spreadsheet-in 
  • Reference: https://flows.nodered.org/node/node-red-contrib-spreadsheet-in

The Node-RED import code and the spreadsheet are available at:  https://caledonianac my.sharepoint.com/:f:/g/personal/pba4_gcu_ac_uk/EioDrlLHGTRIlBMy3i7sVt8B6eBqIeJ2Bx3wI0H0S pIM_w?e=dtuN6p

The code to read the spreadsheet is in the file: ‘IoT_CW2_IoT_Device_Code.txt’. 

(a) Explain the purpose of each part of the supplied code. Your description should start with the  first node and follow through in-sequence to the final node. You can refer to the ‘Help’  information provided for each node-type. 

Note: Use narrative and screenshots as required. Ensure that you discuss all node  configurations. 

(b) Within the Google Cloud Console create: 

  1. A new Google Core IoT registry. 
  2. Within that registry create a new Google Core IoT device representation. You should  create a relevant name for the device representation. You should include Pub/Sub topics for Telemetry and State. 
  3. Pub/Sub subscriptions for the Telemetry topic and the State topic. 

To evidence this, provide screenshots.  

  • Each screenshot must contain the browser URL bar and contain the full width of the  browser window. 
  • The following screenshots must be shown: 
  1.  ‘Registry Details’, including the configured topics. 
  2.  The registry entry for the new device that you have created. 

Note: Use narrative and screenshots as required. Ensure that you discuss all aspects of the  configuration, including security. 

(c) Describe how you set up this new Google Core IoT device on your PC Node-RED  implementation for sending both Telemetry and State messages. Discuss all configurations,  including authentication. 

Show a screenshot that demonstrates that the device is connected. 

Note: Use narrative and screenshots as required. Ensure that you discuss all aspects of the  configuration, including security.

(d) Examine the spreadsheet from start to finish. You will see that for some rows in the  spreadsheet, the sensor entries have values that are unusable.  

Extend the original code so that it ignores the rows with unusable values, rather than  emitting these values at the end of the flow. 

Provide evidence of this extension to the code, as follows: 

(e) On your PC Node-RED, join the output of the existing sensor code  

(‘IoT_CW2_IoT_Device_Code.txt’) to both Telemetry and State nodes, to send sensor  messages to Google Core IoT. These messages will be identical for Telemetry and State. Provide evidence that the messages have been received on Google Core IoT. You should see  the messages within each of the subscriptions with the Cloud Console pages for the Pub/Sub  Service. Once you are viewing a particular subscription (Telemetry or State), use the  ‘Messages’ tab to view the incoming messages.

Task 2 - Using the sensor data on Google Cloud  

(a) There is a requirement to view the sensor data on Google Cloud Node-RED. You should  already have deployed code to view data on Dashboard charts, within the Week 7 laboratory  Dashboard example.  

Create a Cloud Node-RED flow that includes the following: 

  • Subscribes to the IoT device Telemetry messages only. Do not subscribe to State  messages in your Node-RED application. The Telemetry data must come from the  IoT device (on your PC), via the Google Core IoT service. 
  • Provides a Node-RED dashboard with two charts (one for each sensor) that contain the data arriving from the IoT device. 
  • The charts should be correctly labelled and should each show the last 100  data points received. 

     You can ignore the timestamp received from the Telemetry messages.• Each screenshot must contain the browser URL bar and contain the full width of  the browser window. Screenshots that do not deliver this will not be marked. 

(b) Provide a Google Maps web page within the Cloud Node-RED application. On that page you  should provide a marker at the following location: 

Latitude: 55.94532323435053, Longitude: -3.1843848117904385 

Note: this location is: Edinburgh Nicolson Street. 

Within that marker you should provide an InfoWindow that contains the latest sensor data  from the two sensors, clearly labelled. 

The evidence required is:

(c) One of the laboratory sessions deals with creating a Cloud Function to store IoT data into a  Firestore database, on a particular database ‘Collection’. Based on that exercise you should  do the following: 

  • Create a new Cloud Function that is triggered by messages from the Pub/Sub ‘State’  topic that you have created (Note: we are not triggering from the Telemetry  

messages). 

  • This Cloud Function should save IoT State messages that arrive. This Cloud Function  code is very similar to the functionality of the previous Cloud Function within the lab  session, and you will need a new database collection. Please ensure that you store the entire contents of the payload of the received message. 
  • Send a set of ‘State’ messages from the IoT device to be processed by the Cloud  Function and stored in the database collection. These will be used for subsequent  database queries. 
  • The messages should have dates between: Start date/time: 01/01/2022 01:00:00 (this is the first data item  in the spreadsheet) End date/time: 21/01/2022 20:00:00 

Provide evidence as described below. 

[Note: Each screenshot must contain the browser URL bar and contain the full width of the  browser window. Screenshots that do not deliver this will not be marked]: 

Evidence: Provide a screenshot of Google Cloud Log that shows the execution of the Cloud  function, accessed from the three-dot menu on the Cloud Function entry on page:  https://console.cloud.google.com/functions/list 

You should specifically show within the Log output the IoT message object content that will create  the document in the database. 

Please ensure that you scroll the log entry to show all content, and include evidence that the Cloud  Function has actually executed without error. 

Evidence: From the Firebase Console, provide two screenshots, showing the contents of two  different Collection entries that have been created from the Cloud Function being triggered 

(d) A set of analytic operations is required within the Cloud Node-RED application, to deliver  insights into the received sensor data. The interface to these operations must be on the  same Node-RED dashboard as delivered for Section 4 Part (a). 

The specific requirements are:  

  • Delivery of a set of Node-RED dashboard buttons that trigger relevant operations to  deliver the following analysis, as dashboard text outputs. The analytical operations are  listed below.  

Note: The analysis must be based upon database queries, followed by any other  analytical operations (if required). 

  • There should be a separate dashboard button and dashboard output for each of the  following: 
  • The highest value of nitric_oxide within the entire set of stored data. 
  • The highest value of nitrogen_dioxide between two dates. 
  • The dates should be selected on the dashboard using date-selector  code. 
  • This code is available in the import file : ‘Node-RED_dates.txt’  supplied in the folder linked on Page 2 of this document. 
  • The most recent value of nitric_oxide.  This value should also be sent in a message to a Slack channel. The  message should describe what data is being sent. 
  • The median value of nitrogen_dioxide between two dates. 
  •  Use the date-selector code to set the date.  Use an appropriate node that will yield the ‘median’ statistic. 
  • Uploaded By : Katthy Wills
  • Posted on : May 02nd, 2023
  • Downloads : 0
  • Views : 153

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more