MQTT aggregator
Find a file
2025-11-13 19:46:29 +00:00
.github/workflows chore(ci): makek it easy to validate against newer version(s) of python 2025-05-28 22:55:58 +02:00
deploy feat: drop bot integration 2025-10-19 19:23:38 +02:00
src/aggregator test: update assertions 2025-11-13 20:37:52 +01:00
.gitignore chore: bring python version under version control for documentation and tooling 2025-04-20 10:26:18 +02:00
.pre-commit-config.yaml chore(ci): add precommit 2025-05-26 21:53:36 +02:00
.python-version chore: align python-version with prod 2025-05-26 16:58:54 +00:00
Aggregator Architecture.png Updated Architecture wireframe 2019-01-30 12:19:44 +01:00
LICENSE Initial commit 2019-01-25 23:24:40 +01:00
pyproject.toml chore(test): migrate to pytest 2025-05-28 22:31:06 +02:00
README.md feat: drop chores functionality 2025-07-13 19:09:03 +02:00
requirements.txt feat: drop bot integration 2025-10-19 19:23:38 +02:00
run-tests.py chore(test): migrate to pytest 2025-05-28 22:31:06 +02:00
server-dev.py feat: drop bot integration 2025-10-19 19:23:38 +02:00
server-prod.py feat: drop bot integration 2025-10-19 19:23:38 +02:00

MakerSpace Leiden Aggregator

Welcome to the MakerSpace Leiden Aggregator. This software aggregates and distributes real-time information about the makerspace.

Features

  • Listens to MQTT messages
  • Aggregates useful information (like who is at the space now, what machines are on, etc.)
  • Publishes the information live via HTTP and WebSockets

System Design

Architecture

Aggregator Architecture Diagram

Architecture diagram also available at: https://balsamiq.cloud/s84bb/pl6cb2r

Quick Start Guide

System Requirements

  • Python 3.7
  • Python 3 venv
  • Redis
  • git

Installation

Standard Setup

  1. Clone the repository:
    git clone https://github.com/MakerSpaceLeiden/aggregator.git
    
  2. Set up virtual environment:
    python3.7 -m venv venv
    . venv/bin/activate
    
  3. Install Python dependencies:
    pip install -r requirements.txt
    

Note for OSX 10.14 users: If you have a locked down ~/Library, use:

pip install --no-cache-dir -r requirements.txt

to avoid having to write in ~/Library/Caches/pip/wheel.

Running Locally

After installation, start the development server:

python server-dev.py

Testing

Run the test suite with:

python run-tests.py

Production Environment

The server runs in production using systemd.

Location: /usr/local/aggregator

Managing the Service:

  • View environment:
    sudo systemctl show-environment
    
  • Set environment variables:
    sudo systemctl set-environment var=value
    
  • Restart service:
    sudo systemctl restart msl_aggregator
    
  • View logs:
    sudo journalctl _PID=<pid>
    sudo journalctl --since="10 minutes ago"