Seamless Biometric Attendance Integration with ERPNext using Ubuntu Subsystem (WSL) – Tested & Working Method
Connect your biometric device to ERPNext using Ubuntu Subsystem (WSL) on Windows. Automatically sync attendance data and run it without manual effort.
This guide explains how to set up the Biometric Attendance Sync Tool inside Ubuntu Subsystem (WSL) on Windows, configure it for ERPNext, and automate it using Windows Task Scheduler.
This method is tested and working in real client setups.
1. Prerequisites
Before starting, make sure you have:
- Windows 10/11 with Windows Subsystem for Linux (WSL) enabled
- Ubuntu 20.04 LTS installed from the Microsoft Store
- A biometric device connected to the same network as your Windows machine
- ERPNext API Key & Secret (user must have HR permissions)
- Python 3.8 installed in the Ubuntu Subsystem
2. Install Ubuntu Subsystem & Python
Refer to the following to install the Ubuntu subsystem:
Open Ubuntu and run:
sudo apt updatesudo apt install software-properties-commonsudo apt install python3.8sudo apt install python3-pippython -m pip install pip
3. Install the Biometric Attendance Sync Tool
cd ~git clone https://github.com/frappe/biometric-attendance-sync-toolcd biometric-attendance-sync-toolpip install -r requirements.txtpip install pickledb pyzk PyQt5
4. Configure local_config.py
Inside the biometric-attendance-sync-tool
folder:
Copy the template config file:
cp local_config.template.py local_config.py
Edit the file:
nano local_config.py
Update with your ERPNext and device details:
# =============================# ERPNext related configs# =============================ERPNEXT_API_KEY = '<YOUR_ERP_NEXT_API_KEY>' # e.g. from My Profile → API AccessERPNEXT_API_SECRET = '<YOUR_ERP_NEXT_API_SECRET>' # Keep this secure!ERPNEXT_URL = 'http://erp.yourdomain.com' # Public or LAN URL to ERPNextERPNEXT_VERSION = 15 # 14 or 15 based on your ERPNext version# =============================# Operational configs# =============================PULL_FREQUENCY = 60 # in minutes (adjust as per requirement)LOGS_DIRECTORY = 'logs' # Folder where logs will be storedIMPORT_START_DATE = None # format: 'YYYYMMDD' — leave None for current date# =============================# Device configurations# =============================devices = [{'device_id': 'office_main','ip': '192.168.1.50', # Replace with actual device IP'punch_direction': None, # Optional: 'IN' / 'OUT' / None'clear_from_device_on_fetch': False,'latitude': 12.9716, # Optional GPS latitude'longitude': 77.5946 # Optional GPS longitude},{'device_id': 'factory_gate','ip': '192.168.1.51', # Replace with actual device IP'punch_direction': None,'clear_from_device_on_fetch': False,'latitude': 12.9716, # Optional GPS latitude'longitude': 77.5946 # Optional GPS longitude}]# =============================# Mapping devices to ERPNext Shift Types# =============================shift_type_device_mapping = [{'shift_type_name': ['Morning Shift', 'Night Shift'], #Add your shift types'related_device_id': ['office_main', 'factory_gate'] #Add your device ID}]
Save → CTRL+O
, Exit → CTRL+X
5. Create the .sh
Script
nano hello.sh
Add:
#!/bin/shcd /home/administrator/biometric-attendance-sync-toolpython3 erpnext_sync.py
Make it executable:
chmod +x hello.sh
6. Test Manually
Run:
sh hello.sh
If successful, a logs
A folder will be created automatically with:
FilePurpose | |
dump_data.log | Raw punch data from biometric device |
success.log | Successfully synced entries to ERPNext Checkins |
error.log | Errors during sync (API/device/network issues) |
7. Automate with Windows Task Scheduler
Follow these steps to add a schedular :
- Open Task Scheduler → Create Basic Task
- Name:
Biometric Sync
- Trigger: Every 5 minutes (or at startup)
- Action: Start a program
- Program/script:
C:\Windows\System32\wsl.exe
- Add arguments:
sh /home/administrator/biometric-attendance-sync-tool/hello.sh
- Properties: Enable:
- Run whether logged in or not
- Run with the highest privileges
- Save the task.
8. Troubleshooting
Common issues & solutions:
ProblemSolution | |
No check-ins in ERPNext | Verify API Key & Secret, check Shift Type mapping, ensure device time is accurate |
Scheduler not running | Run .sh manually first, restart scheduled task |
Device unreachable | ping DEVICE_IP from Ubuntu, check firewall/network |
Permission denied | chmod +x hello.sh |
9. Lessons Learned
I first tried setting this up remotely via AnyDesk, but faced:
- Client’s availability issues
- Device offline during remote session
- Missed testing windows
Solution: On-site visit, local connectivity testing, and immediate automation setup.
10. Conclusion
Using Ubuntu Subsystem + Task Scheduler is a stable and reliable method for syncing biometric attendance into ERPNext.
Once set up, it:
- Runs automatically on schedule
- Logs all activities for review
- Eliminates manual punch imports
If you want, I can add a flow diagram showing:
Biometric Device → WSL Python Script → ERPNext API → Checkins
…so the client immediately understands the data flow without reading all the text.
@k naveen kumar - Inside the log folder, there is a file named error_log. Check the traceback back Also, can you check the success log and failure logs file? In the failure log, what was the cause of creating the check-in? Possible to share those screenshots here. - Change the last sync of the checking date . in the local config.py file - or else delete the log folder and run again new data dump will happen again at that time, the log folder will be created. in that you can check the error log and success logs.
Issue with Biometric Attendance Sync Tool – Missing Data from Last 3 Months
We have recently encountered an issue while using the Biometric Attendance Sync Tool for integrating attendance data from biometric devices into our ERPNext system.
🔧 Setup Details:
Tool Used: Biometric Attendance Sync Tool by Frappe
Number of Devices: 3 biometric machines
ERP System: ERPNext
Environment: Self-hosted
Tool Installed: On all machines
Last Working Sync: Up to May 2025
🚨 The Issue:
We noticed that attendance data from June, July, and August 2025 is missing in ERPNext. The tool successfully fetched data until the end of May, but no new data has been pulled since then.
🧪 What We Tried:
Reinstalled the sync tool on all devices
Verified that the biometric machines are operational and logging data correctly
Checked the configuration files (config.json) and device connection logs
Manually tested device connection and data fetching — no errors shown, but old data is fetched, recent data is skipped
❓ What We Need Help With:
We’re looking for insights on:
How to debug or force a full sync including past data
Any known issues with date ranges or device compatibility
Whether the tool supports historical data re-fetching from biometric machines
How to verify if the biometric device stores or deletes older logs
If anyone has faced a similar issue or has suggestions to resolve it, your help would be greatly appreciated!