how to connect acb-004 controller using python

currently I'm trying to receive data every time someone swipes a card at my magnetic card reader. acb-004 image My system includes a magnetic card reader (idteck ip10), I connect the magnetic card reader to the acb-004 access control controller. Then I connected the controller to my computers using a LAN cable. Now I try to write a code in python language to receive the signal (I use socket library), but it always hangs at connection time. If anyone has worked with controllers or has information about this, please help me. Thank you.

import socket
   4 
   5 
   6 TCP_IP = '192.168.0.25'
   7 TCP_PORT = 60000
   8 BUFFER_SIZE = 20  # Normally 1024, but we want fast response
   9 
  10 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  11 s.bind((TCP_IP, TCP_PORT))
  12 s.listen(1)
  13 
  14 conn, addr = s.accept()
  15 print 'Connection address:', addr
  16 while 1:
  17     data = conn.recv(BUFFER_SIZE)
  18     if not data: break
  19     print "received data:", data
  20     conn.send(data)  # echo
  21 conn.close()

I have been looking for solutions but haven't found one yet

Upvotes: 0

Views: 29

Answers (0)

Related Questions