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
|
|
|
|
|
---|
The Resit CW2 specification
The details of each response that is expected for each part of the CW.
Feel free to state any assumptions that you make in responding to any section.
Unless specifically stated otherwise, you are required to provide only your own diagrams/screenshots as part of your responses.
have consistent layout,
be spell-checked,
The report must be submitted via Turnitin and must be in .docx format only; PDF files will NOT be accepted.
Writing Skills
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 |
---|
Provide a screenshot of the configuration of the chart node used in the flow.
Screenshot of chart configuration below |
---|
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 |
---|
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 |
---|