Skip to content

shub39/RpiAttendance

Repository files navigation

RpiAttendance

Kotlin/Native server to manage attendance on a raspberry pi 4B from a python server managing biometric sensors and camera.

Pic

Pic

Screenshots of Client App

1 2
3 4

Also made a Youtube Video talking about this project

Requirements

  • Raspberry pi (Used in this project is 4B 8gb variant)
  • R307 fingerprint scanner with UART to USB Converter
  • ssd1305 OLED Display
  • Raspberry pi camera
  • 4x4 matrix membrane keypad
  • Jumper cables and power adapter

Setup

Required OS for Raspberry pi: Debian GNU/Linux 12 (bookworm) aarch64

Setup Sensor Server

  • Clone the repo at the home directory
git clone https://github.com/shub39/RpiAttendance
# Setup
cd RpiAttandance/sensor_server/
uv venv
uv pip install

sudo apt update
sudo apt upgrade
sudo apt install pip python3-opencv python3-numpy cmake
sudo apt install libkms++-dev libfmt-dev libdrm-dev # might require more...

uv pip install rpi-libcamera -C setup-args="-Dversion=unknown"
uv pip install -r requirements.txt
  • Setup the cronjob to run server on reboot, file cronjob.sh

Setup Server Binary

  • Download the binary from releases to the home directory
  • Setup cronjob
  • Install android app on a device in the same network as the Raspberry Pi

Building from Source

To build the project from source, you can use the following Gradle commands:

  • Build the native server: ./gradlew :server:linkReleaseExecutableLinuxArm64
  • Build the Android app: ./gradlew :androidApp:assembleRelease
  • Run the Desktop app: ./gradlew :desktopApp:run

Project Structure

  • sensor_server : throughly tested python server to manage the sensors using fastapi
  • core : shared kotlin models and interfaces throughout the project
  • server : Kotlin/Native server, the main server to connect with the client app. Manages connection to the sensor_server and database. Processes business logic
  • client : UI and logic for the client app
  • androidApp : Build module for the Android App
  • desktopApp : Build Module for the Desktop App, Also for hot reload

Architecture

graph TD
    subgraph "Client Apps"
        androidApp[Android App]
        desktopApp[Desktop App]
    end
    subgraph "Shared Code"
        client[client module]
        core[core module]
    end
    subgraph "Server Side"
        server[server module]
        sensor_server[sensor_server]
        db[(Database)]
    end
    androidApp --> client
    desktopApp --> client
    client --> core
    client -- Ktor RPC --> server
    server --> core
    server -- FastAPI HTTP --> sensor_server
    server --> db
Loading

Tech stack

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

About

📹️ Kotlin/Native + Python servers to manage attendance on a raspberry pi 4B, With client android and desktop apps

Resources

License

Stars

Watchers

Forks

Contributors