Code Monkey home page Code Monkey logo

mopidy-raspberry-gpio's Introduction

Mopidy-Raspberry-GPIO

Latest PyPI version CircleCI build status Test coverage

Mopidy extension for GPIO input on a Raspberry Pi

DEV

install ext (once to link): sudo python3 -m pip3 install -e .

restart (to load code): systemctl restart mopidy.service

see logs: journalctl -u mopidy -f

Allow shutdown: sudo visudo

add line: mopidy ALL=NOPASSWD: /usr/sbin/shutdown

Installation

Ensure Mopidy has access to GPIO:

sudo usermod -a -G gpio mopidy

Install by running:

python3 -m pip install Mopidy-Raspberry-GPIO

Or, if available, install the Debian/Ubuntu package from apt.mopidy.com.

Configuration

Before starting Mopidy, you must add configuration for Mopidy-Raspberry-GPIO to your Mopidy configuration file:

[raspberry-gpio]
enabled = true
bcm5 = play_pause,active_low,250
bcm6 = volume_down,active_low,250
bcm16 = next,active_low,250
bcm20 = volume_up,active_low,250

Each bcmN entry corresponds to the BCM pin of that number.

You must assign an event, mode and bouncetime (ms) to your desired pins.

Supported events:

  • play_pause
  • volume_up
  • volume_down
  • next
  • prev

Supported modes:

  • active_low - configures the pin with a pull-up and triggers when it reads 0/low (RECOMMENDED)
  • active_high - configures the pin as a pull-down and triggers when it reads 1/high

Events volume_up and volume_down both support an (optional) "step" option, which controls the amount (in percent) that the volume is adjusted with each button press.

Eg:

[raspberry-gpio]
enabled = true
bcm5 = play_pause,active_low,250
bcm6 = volume_down,active_low,250,step=1
bcm16 = next,active_low,250
bcm20 = volume_up,active_low,250,step=1

Project resources

Credits

mopidy-raspberry-gpio's People

Contributors

gadgetoid avatar wildestpixel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.