Skip to content

iot-lnu/diwah-intelligent-wearable-dashboard

Repository files navigation

DIWAH Intelligent Wearable Dashboard

Analytics dashboard for wearable sensor data from the DIWAH study at LNU. Visualizes accelerometer, heart rate, and other physiological signals from multiple subjects across different conditions (activity vs rest).

Quick Start for Collaborators

If you received a backup of the InfluxDB data, follow these steps to set up and run the dashboard on your machine.

Prerequisites

Step 1: Install InfluxDB v2

  1. Download and install InfluxDB OSS v2
  2. Start InfluxDB:
    influxd
    Or if using the provided docker-compose.yml:
    docker compose up -d influxdb
  3. InfluxDB UI will be available at: http://127.0.0.1:8086

Step 2: Restore the Data Backup

  1. Stop InfluxDB if it's running:

    taskkill /F /IM influxd.exe

    Or for Docker:

    docker compose down
  2. Extract the backup you received (e.g., manual_backup_20251202.zip)

  3. Copy the backup to the InfluxDB data folder:

    xcopy /E /I manual_backup_20251202 influxdb-data
  4. Start InfluxDB again:

    influxd

    Or Docker:

    docker compose up -d influxdb

Step 3: Generate Your Access Token

  1. Open InfluxDB UI: http://127.0.0.1:8086
  2. Login with credentials provided (default: admin / admin12345)
  3. Go to DataAPI Tokens
  4. Click Generate API TokenAll Access Token
  5. Copy the token (you'll need it in the next step)

Step 4: Set Up Python Environment

  1. Clone or extract the dashboard repository

  2. Create a virtual environment:

    python -m venv .venv
  3. Activate the environment:

    .venv\Scripts\activate
  4. Install dependencies:

    pip install -r requirements.txt

Step 5: Configure the Dashboard

  1. Create a .env file in the project root:

    notepad .env
  2. Add your configuration (replace <YOUR_TOKEN> with the token from Step 3):

    INFLUX_URL=http://localhost:8086
    INFLUX_TOKEN=<YOUR_TOKEN>
    INFLUX_ORG=diwah
    INFLUX_BUCKET=wearables
    
  3. Save and close

Step 6: Run the Dashboard

Option A: Run directly with Python

python src\analytics_dashboard.py

Option B: Run with Docker Compose (Recommended)

docker compose up

The dashboard will start at: http://localhost:8050

Open it in your browser and select a subject and condition to view the data.

Docker Compose Setup

The project includes a docker-compose.yml file that runs both InfluxDB and the dashboard in containers.

Prerequisites

  • Docker and Docker Compose installed
  • A .env file in the project root (see Step 5 above)

Running with Docker Compose

  1. Create a .env file in the project root with your InfluxDB configuration:

    INFLUX_TOKEN=your-token-here
    INFLUX_ORG=diwah
    INFLUX_BUCKET=wearables
    INFLUX_USERNAME=admin
    INFLUX_PASSWORD=admin12345
    
  2. Start all services:

    docker compose up
  3. Access the dashboard at http://localhost:8050

    • The dashboard is accessible from your host machine
    • InfluxDB UI is available at http://localhost:8086
  4. Stop services:

    docker compose down

The dashboard container automatically reads environment variables from the .env file and connects to the InfluxDB container.

Dashboard Features

  • Time Series Visualization: Raw and 5-second aggregated sensor data
  • Statistical Analysis: Descriptive stats, correlations, data quality metrics
  • Activity vs Rest Comparison: T-tests and Cohen's d effect sizes
  • Multi-subject Support: Filter by subject ID and condition
  • Responsive UI: Three-column layout with KPI cards and interactive plots

Data Processing Details

  1. Actigraph file:

    • Has 11 header lines with metadata
    • Timestamp format: "2024-05-14 09:41:01"
    • Columns: timestamp, x, y, z
    • Uses commas as decimal separators (European format!)
  2. Bangle file:

    • No header
    • Timestamp is delta time in milliseconds
    • Columns: Time, Acc_x, Acc_y, Acc_z, HRM_r, HRM_f, PPG_r, PPG_o
    • Time accumulates (20, 80, 80, 80...)
  3. EmotiBit file:

    • Complex format with multiple sensor types mixed together
    • Variable number of columns
    • Timestamp in filename + packet timestamps
    • Columns: local_timestamp, emotibit_timestamp, data_length, type_tag, ...

Timestamp Alignment:

  • Actigraph: Has absolute timestamps → used as reference
  • Bangle: Cumulative milliseconds → aligned to reference
  • EmotiBit: Filename timestamp + relative time → aligned to reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages