π₯ 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.