Starting from:

$30

WEB-Project 1 Reading and Querying Sensor Data in NodeJS Solved

This project involves reading and querying sensor data. The data is organized in three levels:

1.   Sensor Types: A sensor type de nes the information for a model of a sensor. The information includes the manufacturer, modelNumber, the kind of quantity measured, the unit of measurement and the max and min limits of the measurement. Note that any reading outside these limits will necessarily be in error.

Each sensor type is assigned a unique id.

2.   Sensors: These are the actual sensors. Each sensor has a speci ed sensor type. The information includes the model (the id of the corresponding sensor type), the period in seconds after which the sensor makes the next reading, and a max and min range of expected values. Note that any reading outside this expected range will constitute an outOfRange condition.

Note that the expected range of a sensor will be a sub-interval of the limits of the corresponding sensor type.

Each sensor is assigned a unique id.

3.   Sensor Data A stream of the data readings from the sensors. Each reading consists of a timestamp’d value produced by a sensor identi ed by its sensorId.

Note that each reading can be classi ed as being in one of three states: error The value of the reading is outside the limits of the sensor model.

outOfRange The value of the reading is outside the range expected for the measuring sensor.

            ok         The value of the reading is within the range of expected values.

It is guaranteed that the time between two readings from the same sensor will be an exact multiple of the sensor’s period.

The data model should become absolutely clear after looking at the provided data les.

1.3       Requirements
You must push a submit/prj1-sol directory to your github repository such that typing npm ci within that directory is su cient to run the project using ./index.js.

You are being provided with an index.js which provides the required commandline behavior. What you speci cally need to do is add code to the provided sensors.js source le as per the requirements in that le.

Additionally, your submit/prj1-sol must contain a vm.png image le to verify that you have set up your VM correctly. Speci cally, the image must show a x2go client window running on your VM. The captured x2go window must show a terminal window containing the output of the following commands:

$ hostname; hostname -I

$ ls ~/git-repos

$ ls ~/cs544

$ ls ~/i?44

$ crontab -l | tail -3

The behavior of the program is illustrated in this annotated log.

1.4        Provided Files
The prj1-sol directory contains a start for your project. It contains the following les:

sensors.js This skeleton le constitutes the guts of your project. You will need to esh out the skeleton, adding code as per the documentation. You should feel free to add any auxiliary function or method de nitions as required.

index.js This le provides the complete command-line behavior which is required by your program. It requires sensors.js. You must not modify this le; this ensures that your Sensors class meets its speci cations and facilitates automated testing by testing only the Sensors API.

More products