IoT Programming Assignment This IoT programming assignment is a combination of your previous tutorials. In this assignment, you are required to use what you learned from the lectures and tutorials to...

hi


IoT Programming Assignment This IoT programming assignment is a combination of your previous tutorials. In this assignment, you are required to use what you learned from the lectures and tutorials to implement a complete IoT system. Assignment requirement: Your assignment document (word/pdf) must including the following contents: 1) The shared Github link of your codes. 2) Demo of your code. There are two options to demo your code. You can choose either of them: a) Contact the lecturer and book a time with the lecturer and demo your code via Zoom. If so, you do NOT need to include any links into your submitted document. b) Make a video to demo your code with your voice to explain your code. A silent demo video will not be accepted. The demo video must clearly show all the required functions of the system (refer to the grading criteria), otherwise the relevant points will NOT be given. If so, you need to include the shared link of your demo video in the document. Assignment deadline: 22 October, 2020, 23:59. Please build an IoT system based the following requirements. This system consists of two IoT end devices, an IoT gateway, MQTT broker and an IoT web server. The whole system has the following functions: 1) IoT end devices: the device 1 is collecting the CPU usage information and send it to the IoT gateway via UDP socket every 30 seconds. The device 2 is collecting the memory usage information and send it to the IoT gateway via UDP socket every 45 seconds. 2) IoT gateway:  When the IoT gateway receives the CPU usage information from the device 1, if the CPU usage is less than 10%, the IoT gateway will drop this information. If the CPU usage is over 30%, the IoT gateway will store the information into the local database.  When the IoT gateway receives the memory usage information from the device 2, if the memory usage is less than 20%, the IoT gateway will drop this information. If the memory usage is over 40%, the IoT gateway will store the information into the local database. 3) IoT Web Server: We can use the IoT web server to obtain the IoT end devices information from the IoT gateway.  In the IoT web server, we can manually send a request message to obtain the CPU usage of the device 1 to the IoT gateway via MQTT protocol by publishing a message with the topic topic/cpu_request. Once the IoT gateway receives this request message from the web server, it will query the latest 10 CPU usage information of the device 1 from the local database and send them back to the IoT web server via MQTT protocol with the topic topic/cpu_reply.  In the IoT web server, we can manually can send a request message to obtain the memory usage of the device 2 to the IoT gateway via MQTT protocol by publishing a message with the topic topic/mem_request. Once the IoT gateway receives this request message from the web server, it will query the latest 10 memory usage information of the device 2 from the local database and send them back to the IoT web server via MQTT protocol with the topic topic/mem_reply.  When the IoT web server obtains the CPU usage information of the device 1 from the IoT gateway, it displays the received information and checks them. Once the IoT web server finds that the CPU usage is over 50%, it will send a notification email to your email address for warning.  When the IoT web server obtains the memory usage information of the device 2 from the IoT gateway, it displays the received information and checks them. Once the IoT web server finds that the memory usage is over 80%, it will send a notification email to your email address for warning. In this programming assignment, you are requested to implement the above IoT system with all the functions. Additional information of this assignment is: a) Run the whole system in your own computer, except the MQTT broker. You can choose any types of the MQTT broker, such as a local broker or online free broker. b) Each device can be represented by a command line window, except the IoT web server. c) The tool cmder is recommended for Flask. d) To use virtual environment is a must for this assignment. e) To obtain CPU and memory usage, please refer to the module: psutil from the tutorial in Week 7. f) The part of the IoT web server code by using Flask is given in the LMS. The required Python packages are listed in requirements.txt. Please use pip install -r requirements.txt to install all dependencies in your virtual environment. You are required to complete the IoT web server based on the above system requirements, such as email. g) If the CPU or memory usage cannot reach the threshold, please manually stress your computer. h) DO NOT put any sensitive information of your email in the code (username and password). i) All the codes must be pushed to the Github. j) (Optional) You can deploy the IoT web server into one of the cloud platform, such as AWS, heroku or any other cloud platforms which support socket.io. However, since it is an optional task, you are required to explore it by yourself. The total points of this assignment are 30. But there are additional 6 points if you are able to complete the optional task. The grading criteria of this programming assignment is as follow: i. The IoT end device implementation (6 points): Collecting information, UDP socket client. ii. The IoT gateway implementation (14 points): Multithreading, data filtering, UDP socket server, MQTT, database iii. IoT web server (6 points): Email, data filtering iv. Pushing to Github ( 4 points) v. (Optional) IoT web server deployment in any cloud platform ( 6 points)
Oct 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here