Skip to content

Errors with the new firmware of Anviz facepass7 #48

@ivigo91

Description

@ivigo91

I am testing with a new Anviz Facepass7 device. The firmware has been updated to version 03.20.69.

I'm trying to enroll a user with the following code (modified from the 'FacepassExample' method):
if (!dict.ContainsValue("TEST"))
{
ulong employee_id = 5;
var fp = await device.EnrollFingerprint(employee_id, 1);
var employee = new Anviz.SDK.Responses.UserInfo(employee_id, "name");
await device.SetEmployeesData(employee);
await device.SetFaceTemplate(employee.Id, fp);

            //var employee = new Anviz.SDK.Responses.UserInfo(stats.UserAmount + 1, "TEST");
            //await device.SetEmployeesData(employee);
            //Console.WriteLine("Created test user, begin fp enroll");
            //var fp = await device.EnrollFingerprint(employee.Id);
            //await device.SetFingerprintTemplate(employee.Id, Anviz.SDK.Utils.Finger.RightIndex, fp);
        }

I get the registration to be enabled on the anviz device and it picks up my face but I find an error in 'await device.SetFaceTemplate(employee.Id, fp);'

The excepcion is:

System.Exception: 'Device connection lost.'

This error is controlled in :
'AnvizStream.cs':

public async Task SendCommand(Command cmd)
{
if (!DeviceSocket.Connected)
{
throw new Exception("Device is not connected.");
}
ResponseCode = cmd.ResponseCode;
await cmd.Send(DeviceStream);
taskEmitter = new TaskCompletionSource();
var result = await taskEmitter.Task;
if (result == null)
{
throw new Exception("Device connection lost.");
}
return result;
}

Despite de error, the user is on registration to the device but without face register
I've tried to change the order of the methods (as made for the fingerprint registration) but it appears the same error. The code for this test is :

   if (!dict.ContainsValue("TEST"))
            {
                //ulong employee_id = 5;
                //var fp = await device.EnrollFingerprint(employee_id, 1);
                //var employee = new Anviz.SDK.Responses.UserInfo(employee_id, "name");
                //await device.SetEmployeesData(employee);
                //await device.SetFaceTemplate(employee.Id, fp);

                var employee = new Anviz.SDK.Responses.UserInfo(stats.UserAmount + 1, "TEST");
                await device.SetEmployeesData(employee);
            //    Console.WriteLine("Created test user, begin fp enroll");
                var fp = await device.EnrollFingerprint(employee.Id,1);
                await device.SetFaceTemplate(employee.Id, fp);
            }

On this test doesn't even save the user on anviz device.

Any idea what may be happening? thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions