ARTICLE AD BOX
I'm trying to automate face enrollment using ESSL SDK with an AI FaceMars attendance device, but the SDK isn't triggering the device's camera for face capture.
What I'm Trying to Achieve:
Programmatically add an employee and capture their face template using C# and ESSL SDK.
Current Code:
using System; using zkemkeeper; namespace FaceTMPConsoleApp { internal class Program { static void Main(string[] args) { IZKEM device = new CZKEMClass(); string ip = "xxx.xxx.x.xxx"; int port = 4370; Console.WriteLine($"Connecting to {ip}..."); bool connected = device.Connect_Net(ip, port); if (!connected) { Console.WriteLine("Connection failed!"); return; } Console.WriteLine("Connected!\n"); string empID = "1111"; string name = "testing"; bool userAdded = device.SSR_SetUserInfo(1, empID, name, "", 0, true); if (userAdded) { Console.WriteLine($"Employee {empID} added."); Console.WriteLine("\nLook at the device camera..."); // This returns true but doesn't activate camera bool enrollStarted = device.StartEnrollEx(empID, 1, 0); if (enrollStarted) { Console.WriteLine("Enrollment started on device."); System.Threading.Thread.Sleep(10000); byte[] faceData = new byte[20480]; int faceLength = 0; bool faceSaved = device.GetUserFace(1, empID, 1, ref faceData[0], ref faceLength); if (faceSaved && faceLength > 0) { Console.WriteLine($"Face registered! Data size: {faceLength} bytes"); } else { Console.WriteLine("Face not detected. Try again."); } } } device.Disconnect(); } } }Problem Description:
Connect_Net(): ✅ Success
SSR_SetUserInfo(): ✅ Employee added successfully
StartEnrollEx(): ✅ Returns true (no error)
But: Device screen doesn't show camera preview, no face capture happens
What I've Tried:
Different parameters for StartEnrollEx():
device.StartEnrollEx(empID, 6, 0) - Mode 0
device.StartEnrollEx(empID, 6, 1) - Mode 1
device.StartEnrollEx(empID, 6, 2) - Mode 2 (documented for face)
device.StartEnrollEx(empID, 13, 1) - Alternative mode
Device Details:
Model: essl AI FaceMars (specific model not listed) Communication: TCP/IP port 4370 Manual process works: User Management → Select User → Face → Add Face Face enrollment works perfectly when done manually on device screen