Skip to main content

Biometric Attendance Device Integration in CodeIgniter 3 (ADMS Case Study)

Real-world case study on integrating a biometric attendance device with CodeIgniter 3 using ADMS. Learn how IP-only devices, shared hosting limitations, and ngrok testing impact implementation.

Overview

Real-world case study on integrating a biometric attendance device with CodeIgniter 3 using ADMS. Learn how IP-only devices, shared hosting limitations, and ngrok testing impact implementation.

The Problem

The client needed a scalable and maintainable system but faced performance and structural issues.

The Solution

  • Clean Laravel architecture (SOLID principles)
  • Optimized database and queries
  • Responsive UI with Tailwind
  • SEO + performance optimization

The Result

+60%
Performance
SEO Ready
Optimized
Scalable
Future-proof

Detailed Breakdown

πŸ”₯ Case Study: Biometric Attendance Device Integration in CodeIgniter 3 (ADMS, Shared Hosting & Real-World Constraints)

Building biometric integrations sounds straightforward…
until real-world limitations hit you hard.

This case study walks through how I integrated a biometric attendance device into a CodeIgniter 3 (CI3) system — despite multiple constraints like:

  • ❌ No VPS (shared hosting only)

  • ❌ Device supports only IP (no domain)

  • ❌ Limited knowledge about ADMS initially

  • ❌ No direct access to device

Let’s break it down.


⚠️ The Initial Roadblock

At first, I was completely stuck.

The device wasn’t communicating.
No logs. No data. No clear direction.

πŸ‘‰ The real issue?

I didn’t know the device had an ADMS (Automatic Data Master Server) feature.

Once that clicked — everything changed.


🧠 Understanding the Core Problem

Here’s what made this integration tricky:

  • The biometric device only accepts IP addresses

  • It does NOT support domain URLs like:

    https://ksrjuk.com
    
  • Client requirement:

    Use existing shared hosting only (no VPS upgrade)

πŸ‘‰ This created a fundamental limitation:

Shared hosting ≠ Dedicated IP


βš™οΈ Backend Setup (CodeIgniter 3)

πŸ“Œ Step 1: Routes Configuration

In:

application/config/routes.php

$route['iclock/cdata'] = 'adms/cdata';
$route['iclock/(:any)'] = 'adms/$1'; // future endpoints

πŸ“Œ Step 2: Controller Setup

Create:

application/controllers/Adms.php

This controller handles incoming data from the biometric device.


πŸ“Œ Step 3: Database Table

CREATE TABLE attendance_logs (
    id INT AUTO_INCREMENT PRIMARY KEY,
    employee_id VARCHAR(50),
    datetime DATETIME,
    status TINYINT DEFAULT 0,
    verify TINYINT DEFAULT 0,
    device_sn VARCHAR(100),
    created_at DATETIME
);

πŸ“Œ Step 4: Disable CSRF (Important)

In:

application/config/config.php

$config['csrf_protection'] = FALSE;

πŸ‘‰ Why?

Biometric devices cannot send CSRF tokens, so requests will fail otherwise.


πŸ§ͺ Testing Strategy (Critical Breakthrough)

Since I didn’t have direct access to the device:

βœ… Used ngrok for local testing

Example:

curl -X POST "https://your-ngrok-url/iclock/cdata?SN=TEST123&table=ATTLOG" \
--data-binary $'101\t2026-04-12 09:00:00\t0\t1'

βœ” Result: Data successfully inserted into database.


βœ… Testing on Production Domain

curl -X POST "https://ksrjuk.com/iclock/cdata?SN=TEST123&table=ATTLOG" \
--data-binary $'103\t2026-04-12 09:00:00\t0\t1'

βœ” Worked perfectly.


❌ Testing via Server IP (FAIL)

curl -X POST "http://168.119.138.253/iclock/cdata?SN=TEST123&table=ATTLOG" \
--data-binary $'103\t2026-04-12 09:00:00\t0\t1'

❌ Failed.


πŸ“© Hosting Support Response

I contacted hosting support with a workaround request:

Map server IP to my document root OR assign a dedicated IP.

Their Response:

Shared hosting does not support IP-based access.
You need a VPS for a dedicated IP.

πŸ‘‰ This confirmed the limitation officially.


🚨 Final Insight (The Real Problem)

This wasn’t a coding issue.

This was an infrastructure mismatch:

Component Requirement Reality
Device IP only βœ…
Hosting Domain-based ❌
VPS Needed ❌ (client constraint)

πŸ‘‰ Result:

Direct integration using IP is not possible on shared hosting


🧠 Key Learnings

  • Always check device capabilities (ADMS, protocol, limitations) first

  • Shared hosting has hard limitations — not just performance

  • Real-world development is 80% environment, 20% code

  • Testing tools like ngrok + curl can save hours

  • Communicating constraints to clients is part of engineering


πŸ’‘ Recommended Solution (Production-Grade)

πŸ‘‰ Use a VPS with dedicated IP

This allows:

  • Direct IP-based communication from device

  • Stable integration

  • Full control over endpoints


πŸš€ Final Thoughts

This project wasn’t about writing complex code.

It was about:

  • Debugging unknown systems

  • Understanding hardware limitations

  • Working within strict client constraints

  • Finding practical workarounds

πŸ‘‰ That’s what real-world engineering looks like.


πŸ“© Need Help with Similar Integrations?

If you're working with:

  • Biometric devices (ZKTeco, ADMS)

  • Laravel / CodeIgniter systems

  • API integrations with hardware

  • Debugging production issues

I can help you implement it properly from day one.


 

Want a similar system?

I build scalable Laravel applications for startups and businesses.

Let’s Work Together β†’