Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
3.0 Final
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Atlas committed Oct 15, 2021
1 parent 65efdc4 commit 4dabcb3
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 23 deletions.
74 changes: 69 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Home
账号&密码
管理员:202100 123456
用户:202101 123456
设备厂家:202102 123456
# BUPT Smart Home Web Project

The smart IoT home has always been one of the most advanced and popular concepts of the new age and is sought after by countless people. To date, there are several smart device companies on the market offering their full range of smart IoT home product solutions, providing a new way of living in the home for people around the world who love technology and IoT convenience.

Based on the concept of providing a simple, convenient and user-friendly smart home, BUPT Home has combined the best of what is already available in the market and introduced a new smart home product platform solution for users. It is a comprehensive solution consisting of a user side, a management side and hardware facilities.

In our smart homes, the comfort of the user is always at the forefront of the experience. Therefore, our Smart Home Management System has a user-friendly login and management interface. It also has simple, accurate and easy-to-use electronic hardware. We currently offer our customers a smart home with four devices: doors, lights, fans and sensors. Each device is connected to the Internet, allowing users to view and control their smart devices from a remote location. This is a great example of how intelligent the Smart House is. Of course, as the device manufacturers update the platform, more devices will be added to the platform to create more possibilities for the users' smart life.

We sincerely hope that our Smart House will bring convenience and safety to everyone who uses it, and that everyone will feel the charm of a modern Smart House.



## Project operating environment

Windows 10 Professional Edition X64 -- version 19043.1083

IntelliJ IDEA Ultimate 2021.1.3 X64 -- version 211.7628.21

Apache Tomcat X64 --version 9.0.52

MySQL Server Community X64 --version 8.0.25

MySQL Connector/JDBC X86 --version 8.0.25

Adobe Dreamweaver X64 --version 2021

(Optional) Navicat Premium 15 X64 --version 15.0.23

Maven --version 3.8.2

JDK --version 11LTS



## Web site

www.bupthome.com



## Server development environment

AWS EC2

Ubuntu X64 -- version 20.04

Apache Tomcat X64 --version 9.0.52

MySQL Server Community Linux --version 8.0.24

MySQL Connector/JDBC Linux --version 8.0.24

PHP --version 7.1

BT Pannel --version 7

Maven --version 3.8.2

Open JDK --version 1.80



## User account & password

User ID: 202101 PW: 123456

Admin ID: 202100 PW: 123456

Manuf ID: 202102 PW: 123456
9 changes: 4 additions & 5 deletions src/main/java/com/example/config/AutoGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class AutoGenerator {
LogMapper logMapper;
private double temperature = 30.0;
private double humidity = 50.0;
private double randomNumber = randomDouble();

@Scheduled(cron = "0 0/30 * * * ?")
public void generateDatesJob() {
Expand All @@ -33,17 +32,17 @@ public void generateDatesJob() {
private void generateDates() {

Sensor sensor = sensorMapper.selectByPrimaryKey(1);
temperature = sensor.getTemperature() + (randomNumber * 10 - 5);
humidity = sensor.getHumidity() + (randomNumber * 20 - 10);
temperature = sensor.getTemperature() + randomDouble(-5.0,5.0);
humidity = sensor.getHumidity() + randomDouble(-10.0,10.0);
if (humidity > 0 && humidity < 100) {
sensor.setHumidity(humidity);
} else {
sensor.setHumidity(50 + (randomNumber * 10 - 20));
sensor.setHumidity(50 + randomDouble(-10.0,10.0));
}
if (temperature > -20 && temperature < 50) {
sensor.setTemperature(temperature);
} else {
sensor.setTemperature(20 + (randomNumber * 5 - 10));
sensor.setTemperature(20 + randomDouble(-5.0,5.0));
}

sensorMapper.updateByPrimaryKeySelective(sensor);
Expand Down
17 changes: 8 additions & 9 deletions src/test/java/com/example/home/HomeApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ void autoTest() {

double temperature = 30.0;
double humidity = 50.0;
double randomNumber =randomDouble();
Sensor sensor = new Sensor();
sensor.setHumidity(50.0);
sensor.setTemperature(30.0);
for(int i = 0; i <100;i++){
temperature = sensor.getTemperature()+(randomNumber*10-5);
humidity = sensor.getHumidity()+(randomNumber*20-10);
if(humidity>0&&humidity<100){
temperature = sensor.getTemperature()+randomDouble(-5.0,5.0);
humidity = sensor.getHumidity()+randomDouble(-10.0,10.0);
if (humidity > 0 && humidity < 100) {
sensor.setHumidity(humidity);
}else{
sensor.setHumidity(50+(randomNumber*10-20));
} else {
sensor.setHumidity(50 + randomDouble(-10.0,10.0));
}
if(temperature>-20&&temperature<50){
if (temperature > -20 && temperature < 50) {
sensor.setTemperature(temperature);
}else{
sensor.setTemperature(20+(randomNumber*5-10));
} else {
sensor.setTemperature(20 + randomDouble(-5.0,5.0));
}
System.out.println("t="+temperature);
System.out.println("h="+humidity);
Expand Down
4 changes: 0 additions & 4 deletions 说明.txt

This file was deleted.

0 comments on commit 4dabcb3

Please sign in to comment.