GithubHelp home page GithubHelp logo

low-power-rfid-attendance-recorder-for-odoo's Introduction

Low-Power-RFID-Attendance-Recorder-for-Odoo

Setup Raspberry PI

  1. Format your sd card. (FAT32)

  2. Flash raspberry OS to microSD card using https://www.raspberrypi.com/software/

  3. Go on Advanced Settings and activate ssh

  4. Also choose a username and a password

  5. Tick the box for setting up the WiFi and configure your WiFi settings

  6. Configure your Timezone

  7. Insert microSD card into the raspberri PI and power it up using USB-C cable

  8. Scan the IPs in your network for the raspberri PI

  9. Connect to the raspberry using ssh pi@IP-ADDRESS and your password

  10. Run sudo raspi-config and enable interface SPI

Setup display and RFID

  1. Run the following commands
sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo apt-get install python3-venv
sudo apt-get install python3-rpi.gpio python-pil python-smbus python-dev libopenjp2-7
sudo pip3 install RPi.GPIO
sudo pip3 install gpiozero netifaces spidev rpi.gpio pillow
sudo pip3 install mfrc522
pip install -U numpy
pip3 install opencv-python 
sudo apt-get install libcblas-dev
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev 
sudo apt-get install libqtgui4 
sudo apt-get install libqt4-test
  1. Clone our project
git clone https://github.com/Abilium-GmbH/Low-Power-RFID-Attendance-Recorder-for-Odoo.git

Connect with Odoo

There are two ways to connect the project with the odoo server:

  1. Enter the directory for enviroment variables
sudo nano etc/environment
  1. Add the following lines with the information of the relevant odoo server. This is possible with API keys or hardcoded letters
ODOO_URL="YOUR-URL"
ODOO_USERNAME="YOUR-USERNAME"
ODOO_DB="DATABASE_NAME"
ODOO_PASSWORD="YOUR_PASSWORD"
  1. Save the file and test with the commands below
echo $ODOO_URL
echo $ODOO_USERNAME
echo $ODOO_DB
echo $ODOO_PASSWORD

The second variant works by hardcoding the information into the responsible file

  1. Run the following commands
cd Low-Power-RFID-Attendance-Recorder-for-Odoo/src/odoo
sudo nano interpreter.py
  1. Write the information from the server into the init method instead of the enviroment variables. They are marked with the comments.
    def __init__(self) -> None:
        url = environ['ODOO_URL'] #"YOUR-URL"
        user = environ['ODOO_USERNAME'] #"YOUR-USERNAME"
        self.db = environ['ODOO_DB'] #"DATABASE_NAME"
        self.password = environ['ODOO_PASSWORD'] #"YOUR_PASSWORD"
        self.common = xmlrpc.client.ServerProxy(
            '{}/xmlrpc/2/common'.format(url), allow_none=True)
        self.uid = self.common.authenticate(self.db, user, self.password, {})
        self.models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url),
                                                allow_none=True) 
  1. Save the file and quit it

FOR BOTH VARIANTS IMPORTANT!

Save the number of the card of an employee into odoo as the Badge ID

Test Hardware

  1. Run commands
cd Low-Power-RFID-Attendance-Recorder-for-Odoo/src
python integration_test.py
  1. Follow the instructions written on the display to see if the hardware works

How to use the attendance recorder

  1. Hold the Badge or Token near to the scanner to Check-In or to Check-Out. Just to state the obvious: If an employee is Checked-Out this will Check-In the employee and vice versa. It is still possible to manually Check-In or Out by connecting to odoo.

  2. Holding a Badge or Token near the RFID-Reader, after you pressed one of the four buttons left to the display, will lead to the following results: (They are labeled from top to bottom.)

    1\. By pressing the first button one can see whether the employee is currently Checked-In or Out.
    
    2\. By pressing the second button one can see the IP-Address of the device.
    

References

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.