User Tools

Site Tools


rfid_access_system_door_lock_and_laser_cutter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfid_access_system_door_lock_and_laser_cutter [2020/10/29 12:47]
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 ====== ====== 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!
Line 15: Line 14:
   * [[https://abra-electronics.com/sensors/sensors-id-en/high-frequency/sens-26-mfrc522-nfc-rfid-controller-breakout-board.html |MFRC522 NFC/RFID Controller Breakout Board]]    * [[https://abra-electronics.com/sensors/sensors-id-en/high-frequency/sens-26-mfrc522-nfc-rfid-controller-breakout-board.html |MFRC522 NFC/RFID Controller Breakout Board]] 
   * [[https://abra-electronics.com/robotics-embedded-electronics/raspberry-pi-en-3/displays/wave-15811-3.5inch-rpi-lcd-c-480x320-125mhz-high-speed-spi.html|3.5inch RPi LCD (C), 480x320, 125MHz High-Speed SPI]]   * [[https://abra-electronics.com/robotics-embedded-electronics/raspberry-pi-en-3/displays/wave-15811-3.5inch-rpi-lcd-c-480x320-125mhz-high-speed-spi.html|3.5inch RPi LCD (C), 480x320, 125MHz High-Speed SPI]]
 +  * [[http://www.datasheetcafe.com/srd-05vdc-sl-c-datasheet-pdf/|5V Relay SRD-05VDC-SL-C or similar]]
  
 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.
Line 21: Line 21:
  
 **Hardware** **Hardware**
 +
 +{{ :signal-2020-11-12-135551_002.jpeg?nolink&400 |}}
 +
 +**WIP:**
 +
 +{{ ::eblab_rfid_bb.png?nolink&400 |}}
  
 **Software** **Software**
Line 42: Line 48:
  
 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 ''requirements_server.txt'' and can be installed via pip3. This should be deployed under HTTPS using any webserver. The URL should be set on the local scripts accordingly. 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 ''requirements_server.txt'' and can be installed via pip3. This should be deployed under HTTPS using any webserver. The URL should be set on the local scripts accordingly.
 +
 +For authenticating the RPi requests, you need to create a user token and add it to script ''eblaser_gui.py''. On the server side, do the following:
 +
 +''python3 manage.py drf_create_token eb''
 +
 +On the client side, add the generated token to ''self.headers'' CardReader attribute:
 +
 +''self.headers = {'Authorization': 'Token MYSECRETTOKENGENERATEDONTHESERVER'}''
 +
 +**API**
 +
 +For json responses, add ''format=json'' to the URL.
 +
 +Resource usage examples:
 +
 +  * /rfid/?uid=XXXXXX&resource=laser_cutter&action=LAS (starting laser usage)
 +  * /rfid/?uid=XXXXXX&resource=laser_cutter&action=LAE&usage_time=120 (ending laser usage and recording cut time)
 +
 +Possible actions:
 +  * LAS (laser start)
 +  * LAE (laser end)
 +  * LOI (logged in)
 +  * LOO (logged out)
 +  * NON (do nothing, used for authentication only)
 +
 +Getting users information, mostly used for the RPi screen messages:
 +  * /person/XXXXXX (get person name from a given rfid)
 +  * /people (get all users info)
 +
 +Getting total resource usage from a given user from their rfid:
 +  * /daily_usage/XXXXXX
 +
  
rfid_access_system_door_lock_and_laser_cutter.1604000822.txt.gz ยท Last modified: 2020/10/29 12:47 by Tiago