Language:EN
Pages: 9
Words: 2087
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
storing data in the firestore database collections

Storing data in the firestore database collections

2023-24 - Internet of Things (MMI126818)

RESIT Coursework 2: Combined Specification and Submission Template.

4.1 Storing data in the Firestore database Collections 6

4.2 Analysing the data 7

Caledonian Email Address

Location (Glasgow or London)

Enter your name below as confirmation of this declaration.
Name: YOUR NAME
    • The Resit CW2 specification

    • The details of each response that is expected for each part of the CW.

CW2 Specific Notes

Introduction

Port: 1883

Subscription Topic 1: org-glasgow-west/veh-type-2/dev-VEH6543/telemetry

Vehicle ‘Fault’ messages are published on the ‘state’ topic. There is a range of possible vehicle faults. For testing purposes these faults arrive approximately every minute. No publishing is required by you. You must only subscribe.

Received data format example:

Q1: Node-RED Dashboard

    • A Centigrade chart

    • A Fahrenheit chart

    • You should provide an appropriate ‘tab’ name.

    • The ‘groups’ that are used on the tab should have appropriate names.

Screenshot of dashboard below
Screenshot of flow below
  1. Provide a screenshot of the configuration of the chart node used in the flow.

Screenshot of chart configuration below
  1. Provide a copy of the code used for the Node-RED function(s) that creates the correct data to be sent to the chart nodes. Any function must be given an appropriate name, with the function-name and code provided below. Only textual code is acceptable, not screenshots.

Q2: Google Maps on Node-RED Cloud Deployment

  • Places a marker on the map for the vehicle location, erasing any previous marker.

  • The marker has an InfoWindow that delivers two data-items with suitable labels:

Two screenshots of map with marker and InfoWindow below
  1. Provide a copy of the code used for the Node-RED function that creates the object to be sent to the Google Maps flow.

Code (in text format). Provide the function name and then the JavaScript content below.

Screenshot from debug panel below

Q3 Using a database to store and analyse the vehicle data (on Cloud)

Storing data in the Firestore database Collections

Telemetry messages :

  • Firestore collection name: ‘vehicle_telemetry_data’.

    • The time in UTC Milliseconds. The key should be: ‘date_time_UTC_milliseconds’. You must generate the value for this with suitable code.

State messages:

    • The time in UTC Milliseconds. The key should be: “date_time_UTC_milliseconds”.

    • The fault type: The key should be ‘vehicle_fault_type’.

Screenshot of flow below
Screenshot 1 (document based upon telemetry messages) below
Screenshot 2 (document based upon state messages) below

Code (in text format) for storing Telemetry messages. Provide the function name and then the JavaScript content below.

Code (in text format) for storing State messages. Provide the function name and then the JavaScript content below.

Analysing the data

….

….

….

….

Screenshot below

You must deliver the following:

  • A screenshot of the flow.

Flow Screenshot below

The query code for 20 minutes of temperature data.

The code to set-up the data/configuration for the statistics node.

Debug output screenshot of highest temperature value below

Code Export

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : samiyasabra

PageId: DOC686D5BF