Giter Club home page Giter Club logo

anviz's Introduction

Anviz

.NET library to access and control Anviz devices.

Features

  • Clear records
  • Delete the designated user data
  • Enroll user fingerprint or card
  • Get advanced device information
  • Get basic device information
  • Get the date and time
  • Get device S/N
  • Get device ID
  • Get device type information
  • Download fingerprint template
  • Get record information
  • Download records
  • Download employees data
  • Get TCP/IP parameters
  • Reboot device
  • Recover to factory settings
  • Get and set facepass templates
  • Set advanced settings
  • Set basic settings
  • Set the date and time
  • Set device S/N
  • Set device ID
  • Upload fingerprint template
  • Upload staff information
  • Upload records
  • Set TCP/IP parameters
  • Send signal to open lock without verifying user
  • Receive device pings
  • Read packets asynchronously
  • RealTime support
  • Automatically answer ping requests
  • Get/set TimeZone information
  • Get/set Schedule Bells

Tested devices

  • VF Series
  • W1 Pro
  • P7
  • Facepass 7
  • WF30 Pro
  • A350C

anviz's People

Contributors

fludem avatar johnkiller avatar jtobia avatar manivela avatar mxlabs avatar robertogallea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anviz's Issues

Device Support

Which Anviz devices are supported? Maybe an update to the readme would be good :)

Problem device.GetEmployeesData();

Hi,
i have a problem with retrieve users information. I have tryed with vb and with c#, but i have same error: "system.indexoutofrangeexception 'index was outside the bounds of the array.', whe i call device.GetEmployeesData();

is there anyone who can help me?

This is the code:

With C#:
using (var device = await manager.Connect("192.168.1.217"))
{
var employees = await device.GetEmployeesData();
}

With VB:
Using device = Await manager.Connect("192.168.1.217")
Dim employees As List(Of Responses.UserInfo) = Await device.GetEmployeesData()
End Using

Thanks !

Connect Redis to AnvizSDK

@JohnKiller
I want to use another method for this problem
but for know I have another issue.
I'm new to c# and my main server is using nodejs.
for connecting to Anviz from nodejs I'm using redis pubsub and sending data through pubsub to c# and then get data and return to nodejs,But their is a problem that I can not connect to
Anviz device in the handler of pubsub and I have to put all my code containing new AnvizManager and manager.connect into handler and for every request it's taking a long time to connect.
do you know anyway to handler it ?
this is my code:

using ServiceStack.Redis;
...
...

static async Task createRedisHost()
{
    var redisConsumer = new RedisClient("localhost:6379");
    var subscription  = redisConsumer.CreateSubscription();
....
    var manager = new AnvizManager();
    manager.ConnectionUser = "admin";
    manager.ConnectionPassword = "12345";
    manager.AuthenticateConnection = true;
    var mdevice = await manager.Connect(DEVICE_HOST);
    mdevice.DevicePing += (s, e) => Console.WriteLine("Device Ping Received");
    mdevice.ReceivedPacket += (s, e) => Console.WriteLine("Received packet");
    mdevice.DeviceError += (s, e) => throw e;
...
    subscription.OnSubscribe = channel =>
    {
        Console.WriteLine(String.Format("Subscribed to '{0}'", channel));
    };
    subscription.OnUnSubscribe = channel =>
    {
        Console.WriteLine(String.Format("UnSubscribed from '{0}'", channel));           
    };
    subscription.OnMessage = async (channel, msg) =>
    {
       Console.WriteLine(String.Format("Received '{0}' from channel '{1}'", msg, channel));
       await connectToAnviz(mdevice);
    }
    subscription.SubscribeToChannels("myChannel");
....
}
static async Task connectToAnviz(AnvizDevice mdevice)
{
    var res = await mdevice.GetDateTime();
    Console.WriteLine(Convert.ToString(res.DAY));
}

if you publish a single message (not important what's the message) on channel myChannel the method connectToAnviz will be fired but here u don't get any data.
if you transfer all following section to connectToAnviz method:

    var mdevice = await manager.Connect(DEVICE_HOST);
    mdevice.DevicePing += (s, e) => Console.WriteLine("Device Ping Received");
    mdevice.ReceivedPacket += (s, e) => Console.WriteLine("Received packet");
    mdevice.DeviceError += (s, e) => throw e;

then it will work.
I don't know what's the reason but I guess this is something related to TCP connection but I don't know why it's happening.
Thanks in advanced

ClearNewRecords() not removing?

The ClearNewRecords() is not clearing the records on my W1 (non pro). Using 2.0.1.
Can you confirm the difference between clearing and deleting?

var records = await device.DownloadRecords(true); //true to get only new records
foreach (var rec in records)
{
	Console.WriteLine($"Employee {dict[rec.UserCode]} at {rec.DateTime.ToLongDateString()} {rec.DateTime.ToLongTimeString()}");
}
await device.ClearNewRecords();
var stats = await device.GetDownloadInformation();
Console.WriteLine($"TotalUsers {stats.UserAmount} TotalRecords {stats.AllRecordAmount}");

Output:

TotalUsers 1 TotalRecords 2

Get data from device when new enter or exit happened (attendance)

Hi and thanks for your great library for Anviz
I'm using this library for Anviz P7
do you know a method or command to get data from device when attendance happened to device ?
(I'm getting this data for my own software and I'm not using Anviz crosschex at all.So I need to know when someone enter or exit)
The problem is that checking the device on interval and getting new records is not a good way because it's so time and resource wasting. if you know another way to handle this please tell me.
Thanks in advance

Setting WorkTypes

Hi everyone and thanks in advance for taking the time to read my question.

I have a VB .NET program that is connected to an ANVIZ VF30 Pro, and it is working perfectly thanks to this DLL.

My client now has a new request: she needs to differentiate between various "types" of work, so all the employees can make registers on the device, but being able to "tell" the system if they are starting their day, going out to the doctor or whatever type of register they decide to configure. There is a section in CrossChex where I can create different tasks with its code, but I would like to do it from my VB .NET program.

I have been looking into methods and properties on the DLL, and there is a a WorkType property inside the Record when downloading them. However, I haven't been able to find any methods that would allow me to create WorkTypes or anything else related to them.

Is there any way to create WorkTypes from this DLL so employees could type the Id before checking-in and that register would get "identified" with that WorkType?

Thanks in advance!

Set User Attendance Status Info

I am using your sdk for my anviz and it is perfect. It works very well. but I have a doubt, is there any possibility to add to the device different attendance status? For example, when I do a record, I have several options, a normal record, or for example i do a record when I go to the doctor. I would like to be able to register all attendances status so that when the user do the record, he can choose the type of the record. would it be possible?
In the original SDK, the event is CChex_SetUserAttendanceStatusInfo

Partial Packet Fail

Hi, been using this SDK to communicate with 4 timeclocks, it works really well except when someone is clocking in at the same time the program tries to communicate with the clock (Either record download or user upload). It then locks up the program. If run in Visuals Studio it errors on Partial packet fail.
I converted and modified the sample program to Vb.net to fit in with an existing program. Not that familiar with C#.
Is there any way to detect the clocks are busy or handle the error?

Implement most device commands

Basic device info

  • Get device type code
  • Get device SN
  • Set device SN
  • Get device ID
  • Set device ID
  • Get network info
  • Set network info
  • Get date/time
  • Set date/time

Device actions

  • Device reset
  • Device reboot
  • Unlock door

Device settings

  • Get basic settings
  • Set basic settings
  • Get advanced settings
  • Set advanced settings

Staff information

  • Get staff info
  • Set staff info
  • Delete staff info
  • Get fingerprint
  • Set fingerprint
  • Enroll fingerprint online

Record information

  • Get record info
  • Get records
  • Set records
  • Delete records

Maintenance, making library async and better OOP

Hi,
First of all, thanks for taking the time to make this library and making it publicly available.
I've bought an Anviz W1 and got it to work with your code, but I had to do some fixes (like employee records not being the same length).
I've also started rewriting it in .net core and made it async, so the ugly Thread.Sleep(400); is gone.
I would like to know if W1 is a supported device so I can push my edits and also I want to know if you are interested in my async implementation.
So ping me back if this library is still maintained, I would like to help :)

Basic Usage

Can someone explain to me the basics to run this library, take into account i do not know anything about C#.

I would really appreciate it.

C2Pro

Hello,

I'm trying to connect to an anviz C2Pro and I'm getting connection fail. In the Response class it throws me the "Invalid response" exception, the value of the RET field = RET_FAIL.

I installed the crosschex and it detects the machine without any problem.

Can you help me?

Errors with the new firmware of Anviz facepass7

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.

Record.cs offset

Hi, I'm not sure if it is a bug because I am not using C# but just in case, in Record.cs, shouldn't the indexes be:

           BackupCode = data[offset + 9];
            RecordType = data[offset + 10];
            WorkType = (uint)Bytes.Read(Bytes.Split(data, offset + 11, 3));

Instead of:

           BackupCode = data[offset + 10];
            RecordType = data[offset + 11];
            WorkType = (uint)Bytes.Read(Bytes.Split(data, offset + 12, 3));

Facepass7 firmware 03.20.78 new template

Strucuture of package to upload face to device:

char peer0_2[] = { /* Packet 58 */
0xa5, 0x00, 0x00, 0x00, 0x01, 0x45, 0x08, 0x0e,
0x00, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x07, 0x0c,
0x63, 0x5b, 0x08, 0x08, 0x04, 0xb1, 0x00, 0x00,
0x01, 0xe1, 0xb9, 0xfa, 0xfd, 0x03, 0x31, 0x2e,
0x30, 0x00, 0x80, 0xa6, 0xfc, 0x03, 0x00, 0x00,
0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x20, 0x8a,
0xfc, 0x03, 0x90, 0x12, 0xfe, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0xa8, 0xe3,
0xd8, 0x03, 0xa8, 0xe3, 0xd8, 0x03, 0x48, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xb0, 0xe4,
0xd8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00,
0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x98, 0x13,
0xfe, 0x03, 0x00, 0x00, 0x48, 0xb5, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xf0, 0xe3,
0xd8, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x81, 0x06,
0x03, 0x04, 0x20, 0x12, 0xfe, 0x03, 0x00, 0x00,
0x00, 0x80, 0xc8, 0xde, 0xd8, 0x03, 0x00, 0x00,
0x00, 0x00, 0x51, 0x09, 0x00, 0x00, 0xd0, 0x0e,
0xfe, 0x03, 0x18, 0xe4, 0xd8, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xd8,
0xd8, 0x03, 0xe8, 0x8e, 0xfc, 0x03, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x29, 0x09, 0x00, 0x00, 0xd0, 0x0e,
0xfe, 0x03, 0x28, 0x18, 0x48, 0xb5, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xd8,
0xd8, 0x03, 0x48, 0x99, 0xfc, 0x03, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc9, 0x04, 0x00, 0x00, 0xf0, 0xd8,
0xd8, 0x03, 0x40, 0xe4, 0xd8, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xb0, 0x8e, 0xfc, 0x03, 0x00, 0x00,
0x00, 0x00, 0xa9, 0x04, 0x00, 0x00, 0x50, 0xda,
0x46, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xad, 0xd0, 0xb0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x31, 0x32, 0x33, 0x33, 0x32, 0x31,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x83, 0x0c, 0xa8, 0xbd, 0x43, 0x6e,
0x35, 0xbd, 0x89, 0x68, 0x2b, 0xbe, 0x6d, 0x52,
0x62, 0xbd, 0x74, 0x45, 0xf7, 0xbc, 0x9d, 0x42,
0x46, 0x3c, 0x40, 0xca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c, 0x3d, 0xba, 0x11, 0x26, 0x3d, 0x8c, 0x2f,
0x09, 0xbc, 0xa6, 0x54, 0xc0, 0xbc, 0x56, 0xac,
0x23, 0xbd, 0x9a, 0xb1, 0xf3, 0x3c, 0xa5, 0x58,
0x81, 0x3d, 0xd6, 0x2d, 0x47, 0xbd, 0xb9, 0x9b,
0x58, 0xbd, 0x7a, 0xa6, 0xa0, 0x3d, 0x19, 0x7e,
0x17, 0xbc, 0xce, 0x79, 0x5d, 0xbb, 0x90, 0x93,
0xa6, 0x3b, 0xb8, 0x72, 0xbe, 0x3b, 0x53, 0x2f,
0xf5, 0xbd, 0xa0, 0xd2, 0x8f, 0xbd, 0xb8, 0x69,
0xf2, 0x3c, 0x5b, 0x88, 0x07, 0x3d, 0xa0, 0xfe,
0x82, 0xbd, 0x95, 0x22, 0x63, 0x3d, 0x20, 0xb1,
0x4b, 0xbd, 0x7a, 0x55, 0xa1, 0xbc, 0xb1, 0x64,
0x95, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xb1, 0x00, 0x00, 0x00, 0xa8, 0xd9,
0xd8, 0x03, 0xc0, 0xfd, 0xfd, 0x03, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x3a, 0xc0, 0x02, 0x58, 0x00,
0xfe, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0xe8, 0x4c, 0x46, 0x00, 0x40, 0x00,
0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf6,
0xfd, 0x03, 0x98, 0x00, 0xfe, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00,
0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0xfc,
0xfd, 0x03, 0x01, 0x0c, 0x00, 0x00, 0x01, 0x08,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x3a, 0xc0, 0x02, 0x30, 0xfd,
0xfd, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x80, 0xe8, 0x4c, 0x46, 0x00, 0x18, 0xfd,
0xfd, 0x03, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfc,
0xfd, 0x03, 0xb0, 0xd9, 0xd8, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xc8, 0xe3,
0xd8, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00,
0x00, 0x00, 0x78, 0x0a, 0xfe, 0x03, 0x11, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x85,
0xc0, 0x02, 0x29, 0x00, 0x00, 0x00, 0x68, 0xa7,
0xfc, 0x03, 0x18, 0xc6, 0xfd, 0x03, 0x17, 0x91 };

Anviz A350C Card Reader

Hey,

I've used the library for a few years to communicate with a few hundred A350C's without problem.

I would have just made a PR for the Read me change, but I haven't tested alarms.

I also didn't know if you'd like it to be listed as supported, as it's also a card scanner. So, a lot of the face functionality will, of course, not work.

VB.NET - How to specify connection Comm Pwd for connecting device from AnvizManager object ?

Hi All !!

How can I specify connection Comm Pwd for connecting device from AnvizManager object ? I'm searching about it but I haven't found any sample code or info about it.

I am trying to connect to 3 devices through a Public IP and ports (5010, 5011 and 5012) which is linked to the router in other distinct LAN to the LAN which I am connected.

I can connect the 3 devices through Crosschex Standard application without problem, but I need to access the devices to get the records from another application developed in vb.net. And that's where the problem is.
I think that the problem is located in the Comm PWD because I haven't found any property, parameter or method in the SDK to specify it when I run the AnvizManager.Connect method. I only can specify the IP and the port as parameters, but I can't specify the Comm PWD. So, the connection result is FAIL.

Could you help me with this issue, please?.

Thanks so much All in advance.

Enrique.

Realtime function

Hi,
how does realtime work?
I did not understand if it is possible to receive realtime recordings when this function is enabled
does anyone use it?

Vb.Net

Do you have vb.Net sample how to use this? How to download new records.

How to Connect from Device through VB.net program?

How do i connect to the device through program? it seem's the Await Operator doesn't working I'm really new into this language sorry for disturbance.

Sample Error

EDIT: I tried removing the Await operator and it works but I can't see the Device Ping and Receive Packet

More examples

I feel like the current state of the sample project is a bit messy. It just throws at you every possible method, but you can't just run it and play with it, you must first change various pieces.

I would like to create a new sample project with a GUI so one can just run it an test every function.

It could be done in WinForms, but it would run only on Windows and I feel like it may be more useful in an ASP.NET scenario, so I'm going to write it in Blazor (Server Mode, not wasm since we need networking).

I will track the progress using this issue, so feel free to ask any questions or suggestions.

Everything will be placed on the GUI branch until I feel it's feature complete.

Server mode

  • Implement TcpListener
  • Decide what to do with DeviceID
  • Find a way to pass a CancellationToken to the TcpListener instance
  • Make class event-based for incoming connections
  • Ensure multi-thread safety
  • Handle devices by serial

Connect to t5\w2 pro

Hi,
Please help me figure it out.
I trying to connect to two devices (t5 PRO and W2 PRO), as in example.
In case t5 pro, visual studio throws me an exception - "Device connection lost", and in case w2 pro, visual studio throws me an exception - "Device timeout waiting response.".
I trying connect with code:

    private const string DEVICE_HOST = "10.10.3.3";
    private const int DEVICE_PORT = 5010;
    static async Task Main(string[] args)
    {
        var manager = new AnvizManager();

#if true //authenticate with device password
manager.ConnectionUser = "admin";
manager.ConnectionPassword = "12345";
manager.AuthenticateConnection = true;

#endif
#if false //false for client mode
manager.Listen();
Console.WriteLine($"Listening on port 5010");
using (var device = await manager.Accept())

#else
using (var device = await manager.Connect(DEVICE_HOST))

#endif
{
device.DevicePing += (s, e) => Console.WriteLine("Device Ping Received");
}

Sorry if my question seems stupid.

SetFaceTemplate not working

Hello,

I'm trying to use the 'SetFaceTemplate' function but i'm always getting the following error: Payload too big

I'm always sending a byte[2056], which was returned when i called the function 'GetFaceTemplate' with a specific user.

Can you help me?

RealTime support

Hello and thank you for the code, it works great!.

In the official SDK, there is a "CKT_ReadRealtimeClocking" with return all clocking records of real-time enabled devices. This method doesn't use the device ID, it for all connected devices.

I've not found that method in the Communication Protocol document, do you know how that method works? and how can it be implemented?.

Thank you.

AppVeyor build is broken :(

Hi @MxLabs,
How are you? :)
Sorry to bother you, but I think that the nuget build process is broken, and I don't have access to anything to fix this.
Maybe we could switch to GitHub actions?

Some Doubts

I have some doubts regarding some functions of the SDK.

  1. To retrieve the record types of a clock I am using the CChex_GetUserAttendanceStatusInfo function that if I don't understand the documentation wrong, it returns a structure of the type CCHEX_SET_USER_ATTENDANCE_STATUS_STRU. The variables fp_len and atten_status_number always arrive empty but it seems that those values ​​come in the variable data_info in positions 4 and 8, is it correct?
    If this is so, is the data_info size 168 instead of 160? If they are 160 and the first 8 positions are to return the values ​​of fp_len and atten_status_number, it would be losing characters of the last type of record.

  2. I have three different watches (A300, W1 and Facepass). When retrieving the record types of all of them to convert the byte array to a string we do it with Encoding.Default.GetString (result.data_info) .Replace ("\ 0", ""). In the case of the A300 it does well, but in the other two clocks characters appear after each type of registration. Is there any way to avoid it?

  3. I need to dump the record types to clocks. For this I use the CChex_SetUserAttendanceStatusInfo function, but I have the same problem as before. If I encode the record types in the 160 positions of the data_info variable of the structure in the clocks strange characters appear. And if I do it from position 8 on the clocks, the record types do not appear.

  4. When retrieving the users of the clocks with the CChex_ListPersonInfo function, in the structure that returns, how is the fp_status field interpreted? As I interpret in the documentation from 0 to 9 it would identify each fingerprint and 10 for faces, but when I am retrieving facepass users it comes as 1024, not 10. And I don't know how to interpret it when there are two fingerprints for the same user.

  5. After dumping faces to the Facepass clock, the clock recognizes me but the fp_status field when recovering the users returns me to 0 and if I enter through the clock configuration to see the user does not seem to have registered any face and when calling the Cchex_DownloadFingerPrint function does not return anything. How do I have to dump faces to Facepass?

Thank you very much.

Device Timeout Waiting Response

Hi everyone and thanks in advance for taking the time to read my issue.

I am developing a little VB.NET program that connects to an ANVIZ VF30 Pro in order to save all the user record data and integrate it with an ERP.
I have been doing many tests: saving users, deleting them, enroling finger prints, getting data, etc. Everything was going perfectly until today, that suddenly, the Connect function is giving me the "Device timeout waiting response" error.

The device is correctly configured in the LAN and there is a succesfull Ping from my PC's command window.

I am a little bit frustrated since there is nothing that I have changed since the last time I made some tests and everything was working correctly.

I will leave my piece of code, but it is so simple that I doubt it makes any difference:

        Dim L_Manager As AnvizManager
        L_Manager = New AnvizManager
        '-------------------------------------------------------------------------------------------
        L_Manager.ConnectionUser = "0"
        L_Manager.ConnectionPassword = "12345"
        '-------------------------------------------------------------------------------------------
        Dim L_Device As AnvizDevice
        '-------------------------------------------------------------------------------------------
        Try
            L_Device = Await L_Manager.Connect("192.168.8.62")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Any help will be appreciated, thank you.

Fix for A300 (possibly EP300 too)

Hi,

With an anviz A300 the GetDeviceID method does not retrieve the correct value, and since the codebase expects GetDeviceID to get a correct device ID this cascades into the rest of the code making it unusable for these projects.

However the current code base is already able to get the correct DeviceID, since this can be found in the field response.DeviceID, but currently the code uses the field response.DATA, I do not know if making this change:

DeviceId = Bytes.Read(response.DATA);
to
DeviceId = response.DeviceID;

Would break compatibility with other anviz models, but it does fix the issue with the A300, which went from essentially not being able to do anything, to being able to do at least most of the things (haven't tested it all).

Assuming this does not break compatibility, and that there isn't a better way of doing this, would it be possible to have this changed committed to a new release?

Thank you.

Continuous integration

So if I got this right, currently the continuous integration publishes a new nuget version for every pushed commit?

If so, I suggest creating another branch called "development" and merging when we are ready to ship a new version.

We should also use something like SemVer for version numbers and maybe a changelog.

What do you think?

Sample

Hi, I have an Anviz W2 device,

Could you please show me an example of how to use your library?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.