{"id":18538971,"url":"https://github.com/simonthorell/access-control-system","last_synced_at":"2026-04-10T20:52:19.454Z","repository":{"id":210921928,"uuid":"713798348","full_name":"simonthorell/access-control-system","owner":"simonthorell","description":" IoT application in C for Linux server (f.e. RaspberryPi) with Docker, featuring Atmega328p for RFID/NFC tag reading and ESP8266 for wireless door control, using standard C libraries.","archived":false,"fork":false,"pushed_at":"2023-12-18T22:48:29.000Z","size":249,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T02:13:18.565Z","etag":null,"topics":["atmega","c","docker","esp8266","iot-application"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonthorell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-03T09:00:49.000Z","updated_at":"2024-02-05T21:31:33.000Z","dependencies_parsed_at":"2023-12-19T02:10:30.603Z","dependency_job_id":null,"html_url":"https://github.com/simonthorell/access-control-system","commit_stats":null,"previous_names":["simonthorell/access-control-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonthorell/access-control-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Faccess-control-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Faccess-control-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Faccess-control-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Faccess-control-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonthorell","download_url":"https://codeload.github.com/simonthorell/access-control-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Faccess-control-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31658964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atmega","c","docker","esp8266","iot-application"],"created_at":"2024-11-06T19:45:41.586Z","updated_at":"2026-04-10T20:52:19.437Z","avatar_url":"https://github.com/simonthorell.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project purpose\nThe purpose of this project is to explore how an IoT project could be developed using only the C standard libraries.  \n\n# System Architecture Overview\nThis document outlines the core architecture and functionalities of the RFID-based access control system, structured into distinct components.  \nThe system will use a microcontroller (Arduino or ESP32) to read and write to RFID cards via serial port and a separate wireless MCU (ESP8266EX)  \nto control the door mechanism (green/red LED pins can be replaces with wires to a relay controlling a lock).\n\n## Admin Menu\nThe Admin Menu is the central hub for system administrators to manage access control and system settings. Implemented in `admin_menu.c`.   \nAdmin menu provides the following options:\n\n- **Remote Open Door**: Allows the administrator to remotely unlock the door. This function can be found in `door_control.c`.\n- **List All Cards**: Displays a list of all RFID cards that are registered in the system, handled by `card_management.c`.\n- **Add/Remove Access**: Enables the administrator to grant or revoke access privileges for individual RFID cards. This functionality is also part of `card_management.c`.\n- **Change Password**: Allows the admin to change and store a new encrypted password. `encrypt_decrypt.c`\n- **Exit**: Safely terminates the admin session and closes the application.\n- **FAKE TEST SCAN CARD**: A testing function that simulates the scanning of an RFID card. It's used for testing purposes in `card_reader.c`.\n\n## Door Control\nHandles the mechanics of locking and unlocking the door, interfacing directly with the Arduino-controlled locking mechanism.\n\n- **Lock/Unlock Mechanism**: Engages or disengages the door lock via commands sent to the Arduino in `door_control.c`.\n\n## Card Management\nManages the database of RFID cards that are authorized to access the facility. \n\n- **Card Database Operations**: Adding, removing, and querying card details within the system's persistent storage, managed by `card_management.c`.\n\n## Data Persistence\nEnsures all configuration settings and authorized card lists are maintained between system reboots.\n\n- **Storage Operations**: Saves and retrieves data from a file or database system, ensuring the integrity and availability of card and system data in `data_storage.c`.\n\n## Card Reader Interface\nResponsible for the direct interaction with the RFID hardware, providing the means to read RFID cards and authenticate them against the system.\n\n- **RFID Reading**: Actively listens for RFID cards presented to the reader and reads their data in `card_reader.c`.\n- **Card Authentication**: Validates the scanned RFID cards against the list of authorized cards maintained by the system.\n- **Test Scanning**: Facilitates testing and debugging of the RFID reading process through simulated card scans.\n\n## Run in docker\n- **Build**: `docker build -t access_control_system` .\n- **RUN**: `docker run -it  --name access-control-app access_control_system` (-it allows you to interact with a Docker container via the command line)\n\n- **ACCESS TERMINAL FROM RUNNING CONTAINER**: `docker attach access-control-app`\n\n- **START**: `docker start -i access-control-app` (-i activates STDIN for interactive mode)\n- **STOP**: `docker stop access-control-app`    (NOTE! run -it flag to add command line access for container app.)\n\n- **SHARE IMAGE BY FILE**:  \n● `docker save -o \u003cpath for generated tarball\u003e \u003cimage name\u003e` // Saving image to share  \n● `docker load -i \u003cpath to tarball\u003e` // Loding shared image  \n\n## Autorun docker container on remote Linux Server\n- **PUSH IMAGE TO DOCKER HUB**: Use your Docker Hub username. Tag could be f.e. version_1.0  \n● `docker tag access_control_system:latest USERNAME/access-control-app:TAG`  \n● `docker push USERNAME/access-control-app:TAG`\n\n- **PULL IMAGE FROM DOCKER HUB**:   \n● `docker login --username USERNAME`  \n● `docker pull USERNAME/access-control-app:TAG`  \n\n- **RUN IMAGE ON SERVER**: (Use your Dockerhub Username. Tag could be f.e. version_1.0. Also change the USB device to your RFID reader -  \nbelow usually work in Linux).  \n● `docker run -it --device=/dev/ttyUSB0:/dev/ttyUSB0 --name access-control-app USERNAME/access-control-app:TAG`  \n● `docker update --restart always access-control-app`  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Faccess-control-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonthorell%2Faccess-control-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Faccess-control-system/lists"}