Skip to main content

Robot Management Daemon

Project description

pepper2

CircleCI Test Coverage Maintainability MIT license Bees

Robot Management Daemon

Dependencies

Some of the dependencies for pepper2 are not available on PyPI.

  • D-Bus
    • Tested on 1.12.16+
  • GLib 2.46+
  • girepository 1.46+
  • Python 3.6+
  • UDisks2
    • Tested on 2.8.1+
  • udiskie or similar automounting daemon that uses udisks2.
    • Tested on 1.7.7

These packages can usually be found on systems with a desktop interface anyway.

Instructions for setting up a Debian 10 system are included in this repo.

Running

There are two programs in this repo, with shared code between them.

  • pepperctl
    • CLI tool that talks to pepperd over D-Bus.
  • pepperd
    • Daemon that sits on the System Bus
    • Listens for mount and cleanup events from UDisks
    • Registers the USBs.
    • Triggers run and stop events for USBs, based on a set of conditions.

In order to run pepperd, we need to tell D-Bus that we have permission to create a service on the System Bus. This can be done by placing a config file in /etc/dbus-1/uk.org.j5.pepper2.conf. An example config file is included in this repository: uk.org.j5.pepper2.conf.

Usage

pepperd should be run in the background as a daemon using systemd.

USB drives should be automounted, and pepper2 will detect the new drive via Udisks.

Usercode main.py on the drive will begin execution, stdout and stderr will be logged to log.txt.

  • View daemon status: pepperctl status
  • View usercode status: pepperctl usercode status
  • Kill usercode: pepperctl usercode kill
  • Start usercode on already inserted drive: pepperctl usercode start
  • View live log of usercode: journalctl -ft pepper2-usercode

Future Development

pepper2 Entity Diagram

The above diagram shows how a typical system using pepper2 would work.

Core Components

Core Components are essential to use pepper2. They are all included in this repo.

  • pepper2
    • Python library to interact with pepper2-daemon
    • Abstracts D-Bus from the user.
  • pepper2-daemon
    • Daemon that listens for events from UDisks2.
    • Performs actions based on conditions defined in a config.
      • Manages a usercode process
    • Provides "metadata" that can be accessed.
      • e.g USERCODE_DIR, ARENA, START_TRIGGER_STATE
  • pepper2-cli
    • Simple wrapper around pepper2
    • Allows control of daemon from CLI for debugging and bash scripts.

Additional Components

  • pepper2-usercode
    • Common components that may be useful for usercode processes to interact with pepper2
    • For example, wait for start.
  • pepper2-leds
    • Listens to signal events from pepper2-daemon and manipulates GPIO pins according to a config.
  • pepper2-servohack
    • Listens to signal events from pepper2-daemon and resets the USB bus. Workaround for bug in SR SBv4

Development Resources

This program makes heavy use of D-Bus, which is not the simplest thing in the world to understand.

Contributions

This project is released under the MIT Licence. For more information, please see LICENSE.

The CONTRIBUTORS file can be generated by executing CONTRIBUTORS.gen. This generated file contains a list of people who have contributed to Pepper2.

Etymology

No, it's not version 2.

Spelling is pepper2, much like j5. No capitals necessary.

Wouldn't you like to be a pepper too?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pepper2, version 0.1.0a2
Filename, size File type Python version Upload date Hashes
Filename, size pepper2-0.1.0a2-py3-none-any.whl (25.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pepper2-0.1.0a2.tar.gz (18.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page