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.
To run the application manually you can use Poetry:
poetry install
poetry run fastapi run msu_manager/main.pyService is shipped as APT package, see release page to download latest package. How to configure and use service see manual.
Here are all necessarey information for developers, to build and run service.
Things you need to build package.
- Python
- Poetry
- build-essentials
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-debAPT 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.debYou 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