๐ฅ 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.
ย