Skip to content
@knu-sunshine

knu-sunshine


Logo

Mr. Sunshine

Smart home app & server solution for lighting, curtain control, sunrise/sunset tracking, and automated environment-based controls.

🎥 View Demo · 🐞 Report Bug · 💬 Request Feature

🗂️ Table of Contents 🗂️
  1. About The Project
  2. Specifications
  3. Getting Started
  4. Usage Screenshot
  5. Contact

About The Project

<<사진2개>>

Background

With the recent development of smart home technology, it has become possible to effectively manage and automate lighting and curtain systems in the home. More and more users want to utilize these technologies for a more convenient life. In addition, there is a growing interest in environmental and energy conservation, and there is a growing need for an automatic control system to support it.

Project Objectives and Scope

The Mr. Sunshine project encompasses the following key functionalities:

  • Login: Users can log in to the app using their Google accounts.

  • Sunrise and Sunset Time Check: Users can conveniently check sunrise and sunset times on the initial screen.

  • Room Registration: Users have the ability to register rooms, which can contain various devices such as LED lights, curtains, and light sensors.

  • Device Registration: Multiple devices can be registered within each room.

  • Device Control: Users can register and control LED devices, adjusting brightness from 0 (off) to 100 (maximum brightness). Similarly, curtain devices can be registered and controlled, managing the curtain openness from 0 (closed) to 100 (fully open).

  • Room-Wide Device Control: Users can control all registered control-related devices (LED lights and curtains) within a room collectively.

  • Auto Mode: Auto mode relies on light sensors (minimum one for LED, curtain, and light) that periodically send light sensor values to the server. The server then compares these values with predefined thresholds. If the light sensor value falls below or exceeds the threshold, the server automatically adjusts the registered devices (LED lights and curtains) within the room to match the desired light level, aligning it with the predefined threshold.

This project uses IoT devices (LED, curtains, sensors) and MQTT for device control and sensor data transmission, while user-server interactions occur over HTTP. The server handles user control requests, AUTO mode, and device registrations, controlling IoT devices through MQTT.

🖼️ System Architecture 🖼️

System Architecture

🖼️ Database ERD 🖼️

스크린샷 2024-01-31 오후 6 37 50

*change
Initially, we set a deviceValue as an anttribute of a device class. but In this case, it is dangerous by it can be used as two meaning. So, we seperated it as a class.

Tech Stack

Category Technology
Application FlutterDartFigma
Server NodejsExpressnpmJavaScriptMQTT
Deployment Amazon_AWSAmazon_EC2Firebase
Database MongoDB
IoT Device RaspberryUbuntuPythonMQTT
Development Environment macOSWindowLinux
Collaborative Software GitGitHubNotionSkypeKakaoTalk

(back to top)

Specifications

Development Environment Specifications

Our project was developed in an Apple Silicon environment, which provided us with advanced computing capabilities and efficiency. Here are the details:

  • Platform: Apple Silicon (M1, M1 Pro, M1 Max, or later)
  • Operating System: macOS Big Sur or later
  • Memory: 8GB RAM or more
  • Storage: 256GB SSD or higher

We recommend using a similar Apple Silicon-based environment for development to ensure compatibility

Hardware Requirements for Client Device

For setting up the client device in this project, you will need the following hardware components:

  • Raspberry Pi 4 4GB(+@): The core computing unit for the kiosk.
  • MicroSD Card with webOS Image: Use a microSD card loaded with the webOS image to boot the Raspberry Pi. For this project, we have used the pre-built webOS OSE 2.24.0 image for Raspberry Pi 4, which can be downloaded from here. Additionally, if you need guidance on flashing the webOS Open Source Edition to your microSD card, please refer to flashing webos-ose guide for detailed instructions.
  • Touchscreen or Monitor: A display unit to interact with the kiosk. A touchscreen is preferred for a more interactive experience.
    we use this
  • Webcam: An essential component for facial recognition or other interactive features. Ensure compatibility with the Raspberry Pi.
  • Optional Input Devices: Devices like a mouse and keyboard for initial setup and troubleshooting.
  • Power Supply and Cables: A suitable power supply for the Raspberry Pi and screen, along with necessary cables such as HDMI for connectivity.

Ensure that you have all these components available before proceeding with the setup of your client device for the signage solution project.

webOS Offitial Docs

(back to top)

Getting Started

This guide will help you set up and run the project in your local environment. Follow these steps to get started.

Note: This guide is tailored for a setup on a single local PC. It can also be adapted for multi-server environments, accommodating both centralized and distributed systems efficiently.

Note: For effective data processing, we recommend hosting both the Flask application and database on the same system. This setup reduces latency and improves operational efficiency, especially for large, user-specific models.

Installation

The process for installing and setting up the project is as follows. This template does not rely on any external dependencies or services.

  1. Clone the repository.
    git clone https://github.com/noFlowWater/signage_solution.git
  2. Move into the cloned directory.
    cd signage_solution

After cloning and moving into the directory, you will find three folders in the project directory:
react, flask, nodejs.

Proceed with the project in the following order:

Each step is detailed in the README.md file of the respective folder, allowing you to sequentially progress and gather the necessary information.

(back to top)

Usage Screenshot

스크린샷 ㄱㄱ 아님 실사진.

(back to top)

Backend

File Directory Structure


스크린샷 2024-01-31 오후 6 46 52

We are largely divided into databases, api, and middleware, and the database directory is divided into a schema and a model created using the schema. api is classified according to its function, and middleware has an error handler for error processing.

Package.json


스크린샷 2024-01-31 오후 7 14 36

dependencies "axios": "^1.6.5" => use to open API Weather Source "dotenv": "^16.3.1" => load .env File "express": "^4.18.2" => to use express.js "express-session": "^1.17.3" => to use express-session "moment": "^2.30.1" => to calculate on Date "mongoose": "^8.0.4" => connect with mongoDB "mqtt": "^5.3.4" => communication with IOT by MQTT protocol "uuid": "^9.0.1" => use UUID for Database

Database


스크린샷 2024-01-31 오후 7 27 10

We used mongoDB. Since the project had to be carried out within a short period of time, it was decided to use the NOSQL database in anticipation of many changes within the project, and among them, mongoDB with good fluidity and scalability was decided to use. An Object Data Mapping (ODM) library called mongoose was used to connect Node.js and mongoDB.

Connect.js is executed before execution in app.js, which helps MongoDB proceed. Even if it is executed in duplicate, there is no concern about error occurrence because express.js avoids duplicate connections.

LogIn


KakaoTalk_Photo_2024-01-31-19-08-10

Login is executed with the above logic. It provides users who use Google OAuth with convenient and no additional membership registration is required.

MQTT communication with IOT


근찬씨 작성 레스고~

Contact

💡 노유수 (noFlowWater) : noyusu98@gmail.com

💡 윤진노 (jinno321) : jinno5522@gmail.com

💡 이민수 (ohyatt) : minsoo030232@gmail.com

💡 김현수 (beoldshoe) : howeve18@gmail.com

(back to top)

Popular repositories

  1. mr_sunshine_iot mr_sunshine_iot Public

    Python 2

  2. mr_sunshine_backend mr_sunshine_backend Public

    JavaScript

  3. mr_sunshine_client mr_sunshine_client Public

    Dart

  4. .github .github Public

    2

Repositories

Showing 4 of 4 repositories

Top languages

Loading…

Most used topics

Loading…