Question: Project Description: This project will include a server that collects temperature readings from clients ( acting as sensors ) and stores them. Clients can request

Project Description: This project will include a server that collects temperature readings from clients (acting as sensors) and stores them. Clients can request aggregated data like the average temperature or the maximum temperature. Figure 1 illustrates the two main components of the system, which are as follows: 1. TemperatureServer: Accepts incoming connections requests from clients. It also receives recent temperature readings from clients, stores them, and handles queries for average, max, min, and recent readings. In addition, if the server detects that the temperature exceeds a maximum, it sends an alert to all the clients. 2. TemperatureClient: Simulates a temperature sensor that sends periodic temperature readings to the server and can request recent readings and aggregated data (e,g, average, max, min). Also, clients receive temperature alerts from the server and display them on the clients screens. The client uses the following commands to communicate with the server: Send: clients use this command to send their sensors reading to the client. The client automatically sends the readings every 3 seconds. o Example: The client sends to server: Send 22.5 The Server displays on the server screen: Temperature reading received from sensor 1 The server sends to the client: A temperature reading of 22.5 is received. Average: clients use this command to request the average of the last n temperature readings received by the server from the server. o Example: The client sends to server: Average 5// n=5 The server sends to client: Average Temperature is 21.4 Max: clients use this command to request the maximum temperature from the server. o Example: The client sends to server: Max The server sends to client: Max Temperature is 26.9 Min: clients use this command to request the minimum temperature from the server. o Example: The client sends to server: Min The server sends to client: Min Temperature is 19 Recent: clients use this command to request the recent n temperature readings received by the server. o Example: The client sends to server: Recent n The server sends to client: Recent Temperature readings are 25.6,18,21.8,20,26.9. Figure 1: Remote Temperature Monitoring and Notification System The server stores the received temperature readings from the clients in a list. In addition, It notifies all the connected clients about the temperature if the average temperature exceeds a specific threshold, for example, 30. The alert message sent by the server to all connected clients is Temperature Exceeded the maximum threshold of 30. The server also records all actions in a log file, such as receiving temperature data, processing client requests, and sending responses. The log file will store timestamps and descriptions of each action for easy monitoring. Please note that you could format the log file in any format. It should show the data, time, and actions happening on the server. A sample of the log file output could be as follows: [2024-10-2415:32:10] Server is running [2024-10-2415:33:20] Client connected: /127.0.0.1[2024-10-2415:34:05] Received temperature: 23.5 from /127.0.0.1[2024-10-2415:35:10] Request average temperature: from /127.0.0.1
[2024-10-2415:35:11] Sent average temperature: 21.2 to /127.0.0.1[2024-10-2415:36:40] Client disconnected: /127.0.0.1 To simulate temperature data by the clients sensors, a number between 15 and 40 must be generated randomly. Please note that not all clients have to use the entire range of temperatures. Some of them, for example, may only generate random numbers between 25 and 40. The remote temperature monitoring system must run as follows: 1. The TemperatureServer application should have an infinite loop to accept connection requests from the Temperature Client. 2. The TemperatureClient needs to run over a period of time. The minimum time of execution is (60) seconds, which is equivalent to 20 readings. You can enter this value at runtime (e.g., user input or read from file). Project Instructions: This is a group project with EXACTLY 4 or 5 members in each project group. The project includes three main tasks: implementing a client-server application, writing a professional project report, and project discussion, which consists of a demo of the application and a discussion of the report. The client-server application should be written in Java programming language. The implementation of the remote temperature monitoring application is based on the client-server architecture, and it should use TCP sockets. Although using threads is not required; however, using them is encouraged. If you use them, make sure that you mention that in the introduction of the report and what the benefit of using them is. Deliverables: You are required to submit the project application and report files on Blackboard before the deadline as follows: The complete source code files for the client and server in a director

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!