Skip to main content
Back to projects

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

Birendra Jung Rai

Case study

๐Ÿ”ฅ 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.


ย 

From the blog

Recent articles

Writing on Laravel, backend systems, and practical engineering.

Browse all articles

Need a system like this?

I build reliable Laravel applications for businesses, startups, and growing teams.

Letโ€™s work together