Skip to main content

A small software for receiving notification of a Raspberry Pi (RPi) pin and optionally run a command everytime.

Project description

Pinotify

License pypi.org

This is a small software for receiving notification of a Raspberry Pi (RPi) pin change through libgpiod. This software monitor the voltage fall of pin 17. Optionally, this software may run another application through the --command flag.

Initially this was written for hooking a wireless doorbell receiver to an RPi and then trying to capture electirc signal when the doorbell button is triggered.

The software make use of the new libgpiod interface with the official Python binding library.

Installation

Clone the repository. Then install the requirements:

pip install pinotify

Usage

usage: python3 -m pinotify [-h] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--exec COMMAND] [--pin PIN]

Set logging level for the application.

options:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  --exec COMMAND        Command to run when edge event is triggered. In JSON array format.
                        Example: '["echo", "bell rang!"]'.
  --pin PIN             Integer. Set the GPIO pin number to monitor. Default: 17.

Example

Say you want to run "/usr/local/bin/mycommand", with some parameter "param1" and "param2", whenever a pin 12 voltage drops:

python3 -m pinotify --pin 12 --exec '["/usr/local/bin/mycommand", "param1", "param2"]'

Development

Build as .deb Package

podman run --volume=".:/opt/pinotify:Z" --workdir="/opt/pinotify" -it docker.io/library/debian:"bookworm" /bin/bash

In the docker environment

apt update
apt install -y build-essential git python3 python3-build python3-setuptools python3-venv python3-all debhelper dh-python
make clean
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
make deb

License

This software is licensed under the MIT License. A copy of the license can be obtained in the repository at LICENSE.md.

Project details


Download files

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

Source Distribution

pinotify-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinotify-1.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pinotify-1.0.0.tar.gz.

File metadata

  • Download URL: pinotify-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pinotify-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b574c36232b4acf9bd00ce429f76b722068f361b79b99b0f3908b3d280eb6704
MD5 f88e428407acb279836c27bb4b749236
BLAKE2b-256 92ca4344b290751852f846e61e14b75baa58f64b6389f09b96dd581a7296e9fc

See more details on using hashes here.

File details

Details for the file pinotify-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pinotify-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pinotify-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7076e0123c84eca16d34e9fe7174da6023945b3dbb68febe1ef58a41a4ac67ac
MD5 edb997a3e577b191fec82ee9ad0b8874
BLAKE2b-256 03d8beeb25c3695599e2223a5dc8c18f77af07352923b097434fff85e2a15579

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page