Giter Club home page Giter Club logo

mopidy-pummeluff's Introduction

Fork Modifications

GPIO Button Handling Removed

Support of handling GPIO Buttons has been removed as the used pins weren`t configurable and there are other mopidy extensions like https://pypi.org/project/mopidy-raspberry-gpio/ (configureable pins) for that purpose.

RFID Library replaced

The originally used RFID Library was pi-rc522. This is abandoned and it is not working with a recent raspberry os. I replaced it with the mfrc522 library. This one is also abandoned but it still handles the simple read task which is required here properly.

Mopidy Pummeluff

Pummeluff is a Mopidy extension which allows you to control Mopidy via RFID tags. It is as simple as that:

  • Register an action to an RFID tag
  • Touch that tag on the RFID reader and the action will be executed

Thus, the Mopidy Pummeluff extension adds the following features to Mopidy:

  • A radically simple web UI which can be used to manage the RFID tags
  • A daemon which continuously reads RFID tags in the background and executes the assigned actions

There are several actions included, such as replacing the tracklist with a desired URI, setting the volume to a specific level or controlling the playback state.

Hardware

Requirements

To get the whole thing working, you need at least the following hardware:

Pummeluff also supports a status LED, which lights up when Pummeluff (i.e. Mopidy) is running. You can go with a separate LED, just make sure it can handle 3.3V or add a resistor. There are also push buttons with integrated LED's available, for example these 5V momentary push buttons on AliExpress.

Note

The project will probably run on other RPi models, but I've only tested it on the 3B. The RPi 3B+ should also work fine, as the GPIO pins are identical. I don't know about RPi 1 or 2, but you can give it a shot.

Connecting the RC522 module

Please connect the RC522 RFID module to the RPi as follows:

  • RC522 pin 1 [SDA ] ––– RPi pin 24 [SPI0 CE0 ]
  • RC522 pin 2 [SCK ] ––– RPi pin 23 [SPI0 SCLK]
  • RC522 pin 3 [MOSI] ––– RPi pin 19 [SPI0 MOSI]
  • RC522 pin 4 [MISO] ––– RPi pin 21 [SPI0 MISO]
  • RC522 pin 5 [IRQ ] ––– not used
  • RC522 pin 6 [GND ] ––– RPi pin 20 [ GND ]
  • RC522 pin 7 [RST ] ––– RPi pin 22 [ GPIO 25 ]
  • RC522 pin 8 [3.3V] ––– RPi pin 17 [3.3V PWR ]

Please have a look at the Raspberry Pi SPI pinout if you want to have a graphical view of the RPi GPIO pins.

Note

This connections are only valid for the RPi model 3B and 3B+. If you want to use another RPI model, make sure you're using the correct pins.

Connecting the status LED (optional)

If you want to have a status LED which is turned on when the RPi is running, you can connect an LED to a GND pin (e.g. pin 6) & to pin 8.

Installation

Prepare Raspberry Pi

Before you can install and use Mopidy Pummeluff, you need to configure your Raspberry Pi properly.

We want to enable the SPI interface and give the mopidy user access to it. This is required for the communication to the RFID module. Enter this command:

sudo raspi-config

In the configuraton utility, Enable the SPI under 5 Interfacing Options – P4 SPI.

After that, add your mopidy user to the spi and gpio group:

sudo usermod -a -G spi,gpio mopidy

Install via pip

The recommended way to install Mopidy Pummeluff by using pip and thus by executing the following command:

sudo pip install mopidy-pummeluff

Hint

If you get an error that spidev could not be found, run pip install spidev first.

Install from source

Alternatively, you can also install Mopidy Pummeluff from source, by running this command:

sudo su -
cd /usr/src
git clone https://github.com/confirm/mopidy-pummeluff.git
cd mopidy-pummeluff
python setup.py install

Hint

If you get an error that spidev could not be found, run pip install spidev first.

Configuration

Activate and configure the Mopidy HTTP extension and make sure you can connect to the Web UI. The minimal config looks like this:

[http]
enabled = true
hostname = 0.0.0.0

Usage

Open the Mopidy Web UI (i.e. http://{MOPIDY_IP}:6680/). You should see a pummeluff web client which can be used to regsiter new RFID tags.

Contribution

Please follow these development guidelines when contributing to this project.

mopidy-pummeluff's People

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.