This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
rfid_access_system_door_lock_and_laser_cutter [2020/10/21 10:42] Tiago |
rfid_access_system_door_lock_and_laser_cutter [2020/11/12 13:58] (current) Tiago [RPi preparation] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | **DIY RFID system with RPi** | + | ====== |
If you're interested to know how this stared, [[rfid_access_system_door_lock_and_laser_cutter_inspiration|have a look here]]. This project was supposed to be a generic solution for giving EB members controlled access to lab resources. So far it's working for the laser cutter only, but has some potential to be extended! | If you're interested to know how this stared, [[rfid_access_system_door_lock_and_laser_cutter_inspiration|have a look here]]. This project was supposed to be a generic solution for giving EB members controlled access to lab resources. So far it's working for the laser cutter only, but has some potential to be extended! | ||
- | We tried hard to used a micro-controller for this. This one worked with an Arduino Nano without the Ethernet Shield. Once we connect the Ethernet shield it won't work via SPI. And via i2c it becomes very unstable. So we tried with a Raspberry Pi models 1 and 2. Didn't work either. Tried SPI, i2c and UART. Also, after many issues dealing with RFID reader MFRC522, we decided to move to PN532. So finally we got the PN532 working with a Raspberry Pi 3 via i2c. So far it's been consistent. Here is the current hardware parts for this project: | + | We tried hard to used a micro-controller for this. This one worked with an Arduino Nano without the Ethernet Shield. Once we connect the Ethernet shield it won't work via SPI. And via i2c it becomes very unstable. So we tried with a Raspberry Pi models 1 and 2. Didn't work either. Tried SPI, i2c and UART. Also, after many issues dealing with RFID reader MFRC522, we decided to move to PN532. So finally we got the PN532 working with a Raspberry Pi 3 via i2c. So far it's been consistent. |
+ | |||
+ | The source code is available on github: https:// | ||
+ | |||
+ | ===== Hardware parts ===== | ||
+ | |||
+ | Here is the current hardware parts for this project: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
The current solution includes a few Python scripts on a local Raspberry Pi and a simple Django application server side. | The current solution includes a few Python scripts on a local Raspberry Pi and a simple Django application server side. | ||
- | ====== Client side (Rpi/ | + | ===== RPi preparation ===== |
+ | |||
+ | **Hardware** | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | **WIP:** | ||
+ | |||
+ | {{ :: | ||
+ | |||
+ | **Software** | ||
+ | |||
+ | * Install Raspberry Pi OS (32-bit) with desktop. Instructions [[https:// | ||
+ | * Follow the instructions here on how to build& | ||
+ | * git clone https:// | ||
+ | * '' | ||
+ | * Install the remained needed Python3 libraries from the provided '' | ||
+ | * Setup the desktop to call '' | ||
+ | |||
+ | ===== Client side software | ||
+ | |||
+ | * '' | ||
+ | |||
+ | * '' | ||
+ | |||
+ | * '' | ||
+ | |||
+ | ===== Server side software (Django app) ===== | ||
+ | |||
+ | The django app provided along with the local scripts should be deployed as a regular django app, nothing special :-) The dependencies are listed in the '' | ||
+ | |||
+ | For authenticating the RPi requests, you need to create a user token and add it to script '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | On the client side, add the generated token to '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | **API** | ||
+ | |||
+ | For json responses, add '' | ||
+ | |||
+ | Resource usage examples: | ||
+ | |||
+ | * / | ||
+ | * / | ||
+ | |||
+ | Possible actions: | ||
+ | * LAS (laser start) | ||
+ | * LAE (laser end) | ||
+ | * LOI (logged in) | ||
+ | * LOO (logged out) | ||
+ | * NON (do nothing, used for authentication only) | ||
+ | |||
+ | Getting users information, | ||
+ | * / | ||
+ | * /people (get all users info) | ||
- | ====== Server side (Django app) ====== | + | Getting total resource usage from a given user from their rfid: |
+ | * / | ||
- | Here is a short documentation to get it working and integrated with Python3: | ||
- | - Follow the instructions here on how to build& | ||
- | - git clone https:// | ||
- | - sudo apt install python3-setuptools | ||
- | - cd py532lib; sudo python3 setup.py install | ||
- | - A sample code is available here: https:// |