MuaazH / ZKTeco_PULLSDK_Wrapper

A wrapper for ZKTeco's pullsdk & ZKFinger
51 stars 31 forks source link

Unable to Connect #3

Closed valeryan closed 8 months ago

valeryan commented 9 months ago

I wanted to try your wrapper but I can't get it to connect to my access cards. I put up an example repo of how I am attempting to use it at https://github.com/valeryan/zk-access-control

I have 2 US-C3-400-PROs on my local network at 192.168.1.100 and 101. I can ping the cards but when I try to connect to them using your wrapper I can't get a connection. I have the zkaccess software installed and I can connect to the devices with the software. I have confirmed in the software that the cards are configured for port 4370 and have no password set.

I believe the C3 cards are compatible with PullSDK.

Do you have any suggestions?

Thanks

MuaazH commented 9 months ago

What's the error? do you get an exception? or does the method simply return false?

Check the native dlls from the lib folder. They need to be on PATH.

My guess is your are running the project from your ide without copying the dlls to the debug folder.

Try a very simple console program like the one on the example and share the error.

valeryan commented 9 months ago

I have the sln copy the dlls to the debug folder for me when the project is run from vs ide. I get the 0x0 pointer from the connect attempt and the if check returns false. I don't get any exceptions.

MuaazH commented 9 months ago

Let's go back to the basics. try to open a simple tcp socket to 192.168.1.100:4370

The only thing I could think of is network issue, like firewall or something silly like that, since you said it supports pullSDK, and everything else seems to be working just fine.

Also, maybe you could try shutting down the other applications connecting to the device? I got to see the internals of the firmware, it's equal to Math.Abs("BS"). It could be running on a single thread and can only accept one connection at a time.

valeryan commented 9 months ago

I was not able to make a TCP connection to port 4370. I tried using socket.io and websocket from postman as well. I can make a telnet connection to 192.168.1.100 and I get a linux login prompt like:

Welcome to Linux (ZEM510) for MIPS
Kernel 2.4.20 Treckle on an MIPS
ZEM510 login:

If its helpful, here is the settings from zkaccess for the card.

Screenshot 2023-11-03 202021

Thanks.

valeryan commented 9 months ago

I didn't notice this part:

Also, maybe you could try shutting down the other applications connecting to the device? I got to see the internals of the firmware, it's equal to Math.Abs("BS"). It could be running on a single thread and can only accept one connection at a time.

I will try shutting off the zkaccess stuff tomorrow and see if I can connect. If the hardware only supports one connection at a time that might be it.

MuaazH commented 9 months ago

I wrote this wrapper by taking hints from ZKAccess, maybe you can use some packet sniffer to see how the other software is connecting to the device? By looking at this line I think it could be UDP instead of TCP probably?

ZEM510 is a very old version by the way. I think newer versions use ARM instead of MIPS. They could've started using UDP then later switched to TCP?

The telnet password is well known. Any one in the network can gain access to your device. ` admin:admin

root:root

admin:1234

root:colorkey

root:solokey

root:swsbzkgn

admin:admin

888:manage

manage:888

manage:888

asp:test

888:asp

zkteco:90OPL;" // ssh new devices

root:colorkeyL; // ssh root new devices

root:solokeyL; // ssh root new devices `

valeryan commented 8 months ago

I never got it to connect nor did any of those user/pass combos work so I gave up for now. I will get curious again someday. Thanks.