Skip to content

Ambient-Node/Ambient-Node-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± Ambient Node Mobile App


image image

슀마트 에어 μ„œν˜λ ˆμ΄ν„° μ œμ–΄ 및 λͺ¨λ‹ˆν„°λ§μ„ μœ„ν•œ Flutter μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜

λ³Έ 앱은 BLE 기반의 μ˜€ν”„λΌμΈ μ œμ–΄λ₯Ό ν•΅μ‹¬μœΌλ‘œ ν•˜λ©°, λŒ€μš©λŸ‰ 데이터 전솑을 μœ„ν•œ 자체 Chunking ν”„λ‘œν† μ½œκ³Ό ACK 기반 μ‹ λ’°μ„± 톡신을 κ΅¬ν˜„ν•˜μ˜€μŠ΅λ‹ˆλ‹€.


πŸ› οΈ Tech Stack

Frontend & Mobile
Flutter Dart

Communication Protocol
BLE MQTT

Design & Tools
Figma Android iOS

Key Libraries

  • flutter_blue_plus - BLE 톡신
  • provider - μƒνƒœ 관리
  • shared_preferences - 둜컬 μ €μž₯μ†Œ
  • fl_chart - 데이터 μ‹œκ°ν™”

πŸ“‚ μ•± μ•„ν‚€ν…μ²˜ (App Architecture)

lib/
β”œβ”€β”€ main.dart                 # μ•± μ—”νŠΈλ¦¬ 및 μƒνƒœ 관리 (Lifted State)
β”œβ”€β”€ screens/                  # UI ν™”λ©΄ (Dashboard, Control, Analytics)
β”œβ”€β”€ services/                 # λΉ„μ¦ˆλ‹ˆμŠ€ 둜직 및 톡신
β”œβ”€β”€ models/                   # 데이터 λͺ¨λΈ (User, AnalyticsData)
└── utils/                    # μœ ν‹Έλ¦¬ν‹° (SnackBar Helper, Constants)

πŸ“‘ 핡심 톡신 기술 (Communication Protocol)

1. BLE 데이터 전솑 (Custom Protocol)

BLE의 MTU(νŒ¨ν‚· 크기) μ œν•œμ„ κ·Ήλ³΅ν•˜κ³  데이터 무결성을 보μž₯ν•˜κΈ° μœ„ν•΄ 자체 ν”„λ‘œν† μ½œμ„ μ„€κ³„ν–ˆμŠ΅λ‹ˆλ‹€.

  • Chunking (λΆ„ν•  전솑): μ΄λ―Έμ§€λŠ” 480λ°”μ΄νŠΈ λ‹¨μœ„λ‘œ λΆ„ν• λ˜μ–΄ <CHUNK:i/total> 헀더와 ν•¨κ»˜ μ „μ†‘λ˜λ©°, μˆ˜μ‹  μΈ‘μ—μ„œ μž¬μ‘°λ¦½ν•©λ‹ˆλ‹€.
  • Reliability (ACK): μ€‘μš” λͺ…λ Ή(user_register, delete, timer)은 κΈ°κΈ°λ‘œλΆ€ν„° 처리 μ™„λ£Œ 응닡(ACK)을 μˆ˜μ‹ ν•΄μ•Όλ§Œ μ„±κ³΅μœΌλ‘œ κ°„μ£Όν•˜λŠ” νŠΈλžœμž­μ…˜ 방식을 μ‚¬μš©ν•©λ‹ˆλ‹€.
// ACK λŒ€κΈ° μ˜ˆμ‹œ (비동기 νŠΈλžœμž­μ…˜)
bool success = await ble.sendRequestWithAck({
  'action': 'user_register',
  'user_id': '...',
  // ...
});

2. MQTT 연동 (Optional Statistics)

둜컬 μ œμ–΄ 외에 μ„œλ²„μ— μΆ•μ λœ 빅데이터 톡계λ₯Ό μ‘°νšŒν•˜κΈ° μœ„ν•΄ MQTTλ₯Ό 보쑰적으둜 ν™œμš©ν•©λ‹ˆλ‹€.

  • μš”μ²­: ambient/stats/request (기간별 μ‚¬μš©λŸ‰, μ„ ν˜Έ λͺ¨λ“œ λ“±)
  • 응닡: ambient/stats/response (JSON 포맷의 톡계 데이터)

πŸ“Š 데이터 뢄석 및 μΈμ‚¬μ΄νŠΈ (Analytics Engine)

μ•± λ‚΄λΆ€μ—μ„œ SharedPreferences에 μ €μž₯된 둜그λ₯Ό λΆ„μ„ν•˜μ—¬ μ‚¬μš©μž λ§žμΆ€ν˜• 리포트λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.

  • In-App Analytics: λ³„λ„μ˜ μ„œλ²„ μ—°μ‚° 없이 μ•± λ‚΄λΆ€ μ•Œκ³ λ¦¬μ¦˜μœΌλ‘œ μ£Ό μ‚¬μš© μ‹œκ°„λŒ€(Top Hour), μ„ ν˜Έ 풍속 등을 μ‹€μ‹œκ°„μœΌλ‘œ λΆ„μ„ν•©λ‹ˆλ‹€.
  • Natural Language Insight: λΆ„μ„λœ 데이터λ₯Ό "주둜 14μ‹œμ— 선풍기λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€"와 같은 μžμ—°μ–΄ λ¬Έμž₯으둜 λ³€ν™˜ν•˜μ—¬ μ œκ³΅ν•©λ‹ˆλ‹€.
  • Visualization: 일간/μ£Όκ°„ μ‚¬μš© νŒ¨ν„΄μ„ μ‹œκ°ν™”λœ κ·Έλž˜ν”„(Bar/Donut Chart)둜 ν‘œν˜„ν•©λ‹ˆλ‹€.

πŸ› οΈ 개발 및 λΉŒλ“œ κ°€μ΄λ“œ (Development)

1. ν™˜κ²½ μ„€μ •

Flutter SDK μ„€μΉ˜ ν›„ μ˜μ‘΄μ„±μ„ μ„€μΉ˜ν•©λ‹ˆλ‹€.

flutter pub get

2. μ‹€ν–‰ 및 ν…ŒμŠ€νŠΈ

λ””λ°”μ΄μŠ€λ₯Ό μ—°κ²°ν•˜κ³  앱을 μ‹€ν–‰ν•©λ‹ˆλ‹€.

# λ””λ°”μ΄μŠ€ μ‹€ν–‰
flutter run

# λ‹¨μœ„ ν…ŒμŠ€νŠΈ μ‹€ν–‰
flutter test

About

Flutter Application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors