balance-subscriber

A service to listen for messages and save the data.

https://github.com/iot-balance-project/balance-mqtt-subscriber

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary

Keywords

iot mqtt
Last synced: 6 months ago · JSON representation ·

Repository

A service to listen for messages and save the data.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • Open Issues: 1
  • Releases: 10
Topics
iot mqtt
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Citation Security

README.md

Tests

MQTT subscriber

A service to listen for messages and save the data.

mermaid flowchart LR publisher --> broker broker --> subscriber subscriber --> storage[(Storage)]

Installation

There is a Bash script to install this service: install.sh. There are further details below.

Install Python package

Create a virtual environment

bash sudo mkdir -p /opt/balance-subscriber sudo python3 -m venv /opt/balance-subscriber/venv

Activate the virtual environment

bash source /opt/balance-subscriber/venv/bin/activate

Install this package

bash pip install --upgrade balance-subscriber

Set up service

Create a service account called balance-subscriber.

bash sudo useradd --system balance-subscriber

This user must have permissions to write to the target data directory.

Install the systemd service.

bash cp --verbose ./systemd/balance-subscriber.service /etc/systemd/system/balance-subscriber.service

Reload all systemd unit files

bash sudo systemctl daemon-reload

Enable the service

bash sudo systemctl enable balance-subscriber.service

Configuration

Configure the service using the systemd configuration editor.

bash sudo systemctl edit balance-subscriber.service

This will create or edit an override configuration file in the directory /etc/systemd/system/balance-subscriber.service.d. Edit this file to set the options for the service, such as the target data directory. Each row defines an environment variable containing a configuration setting for the service.

unit file (systemd) [Service] Environment="DATA_DIR=/tmp"

Then, restart the service as described in the service control section.

Options

The following options are available.

| Setting | Required | Description | Default | |--------------| -------- |----------------------------------------------------------------|-----------| | DATA_DIR | Required | The path of the target directory to serialise MQTT messages to. | | | HOST | Optional | MQTT broker host name | localhost | | PORT | Optional | MQTT broker port | 1883 | | USERNAME | Optional | MQTT broker username | | | PASSWORD | Optional | MQTT broker password | | | TOPICS | Optional | MQTT topics | # | | QOS | Optional | Quality of service (0, 1, 2) | 0 | | KEEP_ALIVE | Optional | MQTT broker keep-alive interval (time in seconds) | 60 | | LOG_LEVEL | Optional | Logging verbosity | WARNING | | EXT | Optional | File extension for saved messages | .bin |

These settings are specified in the configuration file for the systemd service as described above.

Usage

The app will run as a service in the background.

Service control

Start the service

bash sudo systemctl start balance-subscriber.service

Stop the service

bash sudo systemctl stop balance-subscriber.service

Restart the service

bash sudo systemctl restart balance-subscriber.service

Monitoring

View service status

bash sudo systemctl status balance-subscriber.service

View logs

bash sudo journalctl -u balance-subscriber.service --since "1 hour ago"

Owner

  • Name: IoT balance project
  • Login: IoT-balance-project
  • Kind: organization

Citation (CITATION.cff)

# https://citation-file-format.github.io/
cff-version: 1.2.0
title: Balance MQTT subscriber
type: software
repository-code: 'https://github.com/IoT-balance-project/balance-mqtt-subscriber'
authors: 
  - given-names: "Joe Salvador Thornhill"
    family-names: Heffer
    affiliation: "University of Sheffield"
    orcid: "https://orcid.org/0000-0001-8733-1117"

GitHub Events

Total
  • Create event: 75
  • Issues event: 10
  • Release event: 16
  • Watch event: 1
  • Delete event: 57
  • Issue comment event: 4
  • Public event: 1
  • Push event: 98
  • Pull request review comment event: 2
  • Pull request review event: 1
  • Pull request event: 121
  • Fork event: 1
Last Year
  • Create event: 75
  • Issues event: 10
  • Release event: 16
  • Watch event: 1
  • Delete event: 57
  • Issue comment event: 4
  • Public event: 1
  • Push event: 98
  • Pull request review comment event: 2
  • Pull request review event: 1
  • Pull request event: 121
  • Fork event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 88
  • Total Committers: 1
  • Avg Commits per committer: 88.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 88
  • Committers: 1
  • Avg Commits per committer: 88.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joe Heffer j****r@s****k 88
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 5
  • Total pull requests: 82
  • Average time to close issues: about 5 hours
  • Average time to close pull requests: about 6 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.02
  • Merged pull requests: 78
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 82
  • Average time to close issues: about 5 hours
  • Average time to close pull requests: about 6 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.02
  • Merged pull requests: 78
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Joe-Heffer-Shef (8)
Pull Request Authors
  • Joe-Heffer-Shef (127)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 55 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 11
  • Total maintainers: 1
pypi.org: balance-subscriber

MQTT listener to save data

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 55 Last month
Rankings
Dependent packages count: 10.0%
Average: 33.1%
Dependent repos count: 56.3%
Maintainers (1)
Last synced: 7 months ago