KIT317 Internet of Things and Distributed Artificial Intelligence

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

KIT317

Assignment 1     2024

Due: 3pm, Friday April 12th

Tasks 18 marks

In this assignment, you are required to build an IoT device (using the Sense Hat Emulator) and have it communicate with a webserver (implemented in the same virtual machine).

You’ve been tasked with creating a prototype for a sensor device to be used by forestry workers to monitor the growing conditions of trees. You will need to emulate an IoT device that can take environmental readings and report them back to a webserver. Your device will need to have a setup mode and know whether its messages ae being received or not. Your webserver will log events and have a way of viewing that log. The requirements that each device must implement are below.

Environmental Sensor (emulated SenseHat device)

Your Environment sensor (Sensehat and python) needs to implement the following requirements:

· Detect movement events in real time. Classify the movement and set the state until it can be reported to the next time the movement is reported to the server.

o If the change in movement is less than 0.1, then it’s classified as normal.

o If there is a change greater that 0.1, then it’s classified as windy.

§ When a windy state is reported to the server, reset the state to normal.

o If there is a change greater that 0.3, then it’s classified as a collision.

§ When a collision state is reported to the server, the device stays in this state, and scrolls the collision message on the SenseHat screen. The collision message (and the state) can be cleared by pressing the middle button on the SenseHat.

· Report to the server every one minute.

o Send a timestamped message that contains:

§ The current temperature.

§ The current Humidity.

§ The current wind conditions.

· Once reported, the wind conditions should be reset back to normal.

o Report an offline error when an acknowledgement is not received from the server.

· Contain a normal operation mode and a setup mode.

o Setup mode is entered by pressing the middle button on the SenseHat while not in a collision state.

o Pressing the left and right buttons will change the mode between temperature and humidity.

§ Display some sort of visual indicator (icon or scrolling text) to show which mode is currently selected.

o Pressing up and down will change the threshold for the selected mode (temp/humidity).

§ Use scrolling text to indicate the current value to the user.

o Pressing the middle button will exit the setup mode, or after no button has been pressed for 10 seconds.

o While setup mode is active, the device should not report to the server.

Webserver

Your webserver (php) will need to implement the following requirements:

· Receive updates from the environmental sensor every minute and log the data.

o Save the temperature, humidity, wind conditions and device timestamp on the server (along with a server timestamp) to an XML file.

o Save the temperature and humidity thresholds in the XML file.

o Return an acknowledgement to the device .

· Your server should also implement a way of viewing the log by reading from the XML file and.

o Report the total number of timestamps recorded.

o Displays the current temp and humidity threshold.

o The view should display as a table every timestamp where by:

§ The timestamps for when temperature and humidity were above the thresholds.

§ There was a collision event recorded.

§ The total number of high wind states that were recorded.

Demonstration 2 marks

Along with your code (zipped) and diagram, you should record a quick video that demonstrates your system. Your video should be a screen recording, whereby you demonstrate your virtual machine environment, showing off all the features of your IoT device in the SenseHat emulator, and your webserver running in a browser. In your video, you should talk through the features as you demonstrate them to the marker.

Marking Scheme

The assignment submission should include:

· Your code for the sensehat (python) and server (php) as a zip file.

· A diagram of the system that you implemented, showing how the device moves between states.

· A demonstration of the system.

Your IoT device detects wind events in real time

· Detects movement from the IMU, correctly classifies the state and correctly returns to normal once reported.

3

· Partially implemented but fails one or more of the above.

1

· Nothing is implemented

0

Your IoT device reports to the server

· Reads environmental data, reports it to the server (with wind conditions and a timestamp), displays an error if the server does not acknowledge.

3

· Partially implemented but fails one or more of the above.

1

· Nothing is implemented

0

Your IoT device contains a setup mode

· Your device correctly enters and leaves setup mode, switches between temperature and humidity modes, changes the thresholds, correctly reports them to the server, times out and exits setup.

5

· One of the features above is not working

3

· Two or more of the features above are not working

1

· Not Implemented

0

Your server logs data from your IoT device

· Receives input from the IoT device and logs it to an XML file, returns an acknowledgement to the IoT device.

2

· Partially implemented but fails one or more of the above.

1

· Not Implemented

0

Your webserver implements a way to view the log.

· The webserver implements a view of the relevant log events, displays the current thresholds, number of events reported.

2

· It is implemented but one of the features do not work properly

1

· Not Implemented

0

Flow Chart or State Transition Diagram

3




发表评论

电子邮件地址不会被公开。 必填项已用*标注