GithubHelp home page GithubHelp logo

mmm-rfid's Introduction

MMM-RFID

This is a module for MagicMirror² to interact with other modules by RFID-RC522 via python and GPIO.

MFRC522-python is used for python part and wrapped in JavaScript.

Installation

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/hebestreit/MMM-RFID.git

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
    {
        module: 'MMM-RFID',
        config: {
            events: {
                daniel: [ // data on rfid tag as decimal block will be used as identifier [100, 97, 110, 105, 100, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                    {
                        CURRENT_PROFILE: "daniel" // i.e. "CURRENT_PROFILE" is used for notification identifier and "daniel" for notification payload
                    }
                ]
            }
        }
    }
]

Configuration options

The following properties can be configured:

Option Description
events With this property you can define multiple events / notifications which will be dispatched to other module. For this the data block on rfid tag will be used when has been successfully scanned.

Possible values: array
Default value: []

Usage with other modules

MMM-ProfileSwitcher by Brian Janssen

Basically I've developed this module to switch different profiles using rfid tags by authenticated user. This can be easily done with MMM-ProfileSwitcher.

Wiring

Please check this documentation to wire your reader.

Writing data

To write data to tag please run following code as sudo and enter your value. On block sector 8 it's saved as decimal values with a length of 16 which will be converted to ascii later. For example [100, 97, 110, 105, 100, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] will be converted to "daniel". You can check it online here.

Please let me know if you've got a smarter idea!

Careful Stop MagicMirror if MMM-RFID module is running before writing or reading tag via python!

sudo python modules/MMM-RFID/MFRC522-python/Write.py

Reading data

After you've write successfully your data to rfid tag you can run following command to check it's value.

sudo python modules/MMM-RFID/MFRC522-python/Read.py

mmm-rfid's People

Contributors

hebestreit avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

gmurry

mmm-rfid's Issues

No notification or event runs when scanning rfid while running MagicMirror

Hi. When I run the normal read.py everything is okay and it shows the UID and Sector 8 decimal values of the number. But when I run MagicMirror and scan the tag, nothing happens and when I check the console tab no new event shows up. There is no error shown when running it with python or MagicMirror.
Related images here:
code
sc

Update:
I really don't know what was wrong but clean reinstalled everything including this module and now it works. Sorry for any inconvinience

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.