MxLabs / Anviz

.NET library to access and control Anviz devices.
MIT License
33 stars 17 forks source link

Errors with the new firmware of Anviz facepass7 #48

Open ivigo91 opened 4 years ago

ivigo91 commented 4 years ago

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.

Meswy commented 4 years ago

Hi, i think the new sdk (31/07/20) has been changed. I have requested it from anviz recently. As soon as they send it to me I will do tests.

Does anyone have it?

Thx.

xiltoos commented 4 years ago

Hello, i confirme that method SetFaceTemplate not work in the last firmware version 03.20.78.

Error message: "RET: FAIL"

SDK v45 https://drive.google.com/file/d/14HThV8qT7aOlLN8Q6cotHTY6pnk5r_Sk/view

Can help?

Thanks Gildo

Jones9854 commented 2 years ago

Hi @xiltoos, I have access to a Face Deep 5 clock but would need some guidance how to fix this issue using WireShark. Are there any resources or suggestions on how to approach this? Thanks, Christian

palanikumar32 commented 2 years ago

I faced the same error "Device connection lost." in Face Deep 3 device. This was resolved by enabling AuthenticateConnection to true.

var manager = new AnvizManager();
manager.AuthenticateConnection = true;