Skip to content

starwit/msu-manager

Repository files navigation

MSU Manager Service

This components manages various aspects for Mobilytix Sensoring Units among which are power and thermal management.
One of its core features is receiving commands from the HCU (Hardware Control Unit). It is shipped for Debian based Linux distributions and is tested with Ubuntu.

Local Development

To run the application manually you can use Poetry:

poetry install
poetry run fastapi run msu_manager/main.py

Usage

Service is shipped as APT package, see release page to download latest package. How to configure and use service see manual.

Build

Here are all necessarey information for developers, to build and run service.

Prerequisites

Things you need to build package.

  • Python
  • Poetry
  • build-essentials

Build APT package

Makefile has target to build an APT package. Virtual environment is created by exporting Poetry dependencies into a requirements.txt file. APT is build like so:

poetry self add poetry-plugin-export
make build-deb

APT package can then be found in folder target. You can test installation using Docker, however SystemD (probably) won't work.

docker run -it --rm -v ./target:/app  jrei/systemd-ubuntu:latest bash
apt update && apt install -y /app/msu-manager_0.0.7_all.deb

You can however test, if everything is installed to the right place. If you want to test service use the following examples:

echo -n '{"command": "HEARTBEAT","version" : "0.0.3"}' | nc -4u -q1 localhost 5151
echo -n '{"command": "LOG", "key": "temperature", "value": "42.0"}' | nc -4u -q1 localhost 5151
echo -n '{"command": "SHUTDOWN"}' | nc -4u -q1 localhost 5151
echo -n '{"command": "RESUME"}' | nc -4u -q1 localhost 5151

About

A linux package providing a device agent with API for MSU (power control, network monitoring, etc.)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •