An open API service indexing awesome lists of open source software.

https://github.com/dfirebaugh/mqtt_rfid

a simple access control system that supports updating access over mqtt
https://github.com/dfirebaugh/mqtt_rfid

Last synced: 8 months ago
JSON representation

a simple access control system that supports updating access over mqtt

Awesome Lists containing this project

README

          

# MQTT-RFID
A simple access control system using the Raspberry Pi Pico W and the RFID-RC522 module.

## Overview
This project allows you to control access using RFID fobs and MQTT. You can add fobs using MQTT or manually write them to the Raspberry Pi Pico. The device is designed to remain operational even without network access or when unable to connect to the MQTT broker. It will continuously attempt to reconnect without interrupting its main functionality (controlling access to the door).

The device keeps an ACL in internal memory. It receives updates from the MQTT broker. It can publish a hash of the current ACL so that the server can verify that the ACL matches what the server expects it to have.

## Wiring
The Raspberry Pi Pico connects to the RC522 module via the SPI interface. The default pinouts are provided below:

| RFID Signal | Pico Pin |
|-------------|:--------:|
| SCK | GP2 |
| MOSI | GP3 |
| MISO | GP4 |
| RST | GP0 |
| SDA | GP1 |

## Dependencies
- MicroPython
- umqtt.simple (version: 1.3.4; installed to /lib/umqtt on the Raspberry Pi Pico)

> note: [Thonny](https://thonny.org/) can be a useful IDE for working with the Raspberry Pi Pico.

## MQTT Events
The device uses MQTT for communication. Here are the supported MQTT events:

### Subscriptions

| Topic | Payload | Notes |
|-------|---------|-------|
| `/acl` | n/a | The device will publish a `/acl_response` message. |
| `/adduser` | `uid of the RFID fob to add` | Adds the specified fob to the device's Access Control List (ACL). |
| `/removeuser` | `uid of the RFID fob to remove` | Removes the specified fob from the device's ACL. |
| `/open` | n/a | Opens the door. |

### Publish

| Topic | Payload | Notes |
|-------|---------|-------|
| `/acl_response` | `{'acl': ''}` | Allows the server to verify if the device has the correct ACL. |
| `/heartbeat` | `OK` | Allows the server to verify the device's network connection. |
| `/access_granted` | `uid of the fob that is granted access` | Used for logging purposes. |
| `/access_denied` | `uid of the fob that is denied access` | Used for logging purposes. |