Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Builds upon the IQT Labs Edgetech-Core functionality to instantiate an MQTT client that publishes telemetry from the PinePhone.

License

Notifications You must be signed in to change notification settings

IQTLabs/edgetech-telemetry-pinephone

Contributors Forks Stargazers Issues MIT License


Logo

EdgeTech-Telemetry-Pinephone

This repo builds upon the IQT Labs EdgeTech-Core functionality to instantiate an MQTT client that publishes telemetry information to the MQTT bus from the PinePhone running mobian. Telemetry data is read from sensor files that are mapped to the Docker container in docker-compose.yml via volumes and published to on the telemetry MQTT topic.

Make Contribution · Report Bug · Request Feature

Current telemetry data being utilized:

battery capacity    :   /sys/class/power_supply/rk818-battery/capacity
uptime              :   /proc/uptime
cpu temperature     :   /sys/class/thermal/thermal_zone0/temp
memory free         :   /proc/meminfo

Built With

Python Poetry Docker

Getting Started

To run this repo, simply run:

docker-compose up

The telemetry module is containerized and dependencies are managed using poetry.

Prerequisites

Running this repo requires that you have Docker installed.

Usage

Spinning up this system requires an MQTT server and this container to be included in your docker-compose.yml. You can find an example of this workflow in this repository's docker-compose.yml. Additionally, some editing of relevant environment variables will be required based upon your system's configuration of topics to subscribe to and MQTT configuration. Examples of these environment variables can be found in this repository's .env file.

Copying the telemetry docker-compose statements into a master docker-compose.yml and .env files with your entire system of containers is the preferred workflow. Find an application architecture diagram example of how the usage of this module was envisioned below.

flowchart TD
    telemetry(Telemetry) -- Telemetry Topic --> mqtt{MQTT}
    mqtt{MQTT} -- Subscribed to Telemetry Topic --> filesaver(Filesaver)
    mqtt{MQTT} -- Subscribed to Telemetry Topic -->  couchdbsaver(CouchDB Saver)

style mqtt fill:#0072bc,color:#ffffff
style telemetry fill:#80c342,color:#ffffff
style couchdbsaver fill:#F9D308,color:#ffffff
style filesaver fill:#F9D308,color:#ffffff

Loading

Environment Variables

EdgeTech-Telemetry-Pinephone relies on two main environmenbt variables to function -

  • TELEMETRY_VARIABLES provides a comma-separated list of variables names to report on the MQTT bus.
  • TELEMETRY_FILE_LOCATIONS provides a one-to-one mapping to the names in TELEMETRY_VARIABLES detailing the filepaths where the named variables can be found internally to the container. These must be mounted in the docker-compose.yml file, as demonstrated.

Roadmap

  • TBA

See the open issues for a full list of proposed features (and known issues).

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b dev)
  3. Commit your Changes (git commit -m 'adding some feature')
  4. Run (and make sure they pass):
black --diff --check *.py

pylint --disable=all --enable=unused-import *.py

mypy --allow-untyped-decorators --ignore-missing-imports --no-warn-return-any --strict --allow-subclassing-any *.py

If you do not have them installed, you can install them with pip install "black<23" pylint==v3.0.0a3 mypy==v0.991.

  1. Push to the Branch (git push origin dev)
  2. Open a Pull Request

See CONTRIBUTING.md for more information.

License

Distributed under the Apache 2.0. See LICENSE for more information.

Contact IQTLabs

See our other projects: https://github.com/IQTLabs/

(back to top)

About

Builds upon the IQT Labs Edgetech-Core functionality to instantiate an MQTT client that publishes telemetry from the PinePhone.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 7