0

I have a HID Edge ER40 network contact-less reader, connected to the same network as the PC i am working with. When a card is scanned by the reader i want to capture the data from the reader using Python program.
I have no experience in network programming, so would like to have tips and ideas to get connected with that device.
I know the IP and Host IP address of the device and IP addr of PC.

  • How can i know the socket number of that device.
  • What modules of python will be apt for this procedure?

I am able to view all the device status within the network, using HID VertX Discovery GUI.
Please do guide with samples and documentation.

Prasanth
  • 339
  • 1
  • 6
  • 19

1 Answers1

0

First, your concept of knowing "socket number" is invalid. Knowing the value of a descriptor on some machine x does not allow you to read data from it. You have to do it on an interface level using a standard library.

Secondly, there would be quite a few options of libraries such as libpcap, pypcap, scapy etc.

Take a look at python packet sniffing

However, the important concept to understand here is, you have a limited control over sniffing some other machine's traffic. All of the above libraries either sniff traffic reliably from the same machine OR they sniff in promiscuous mode where for instance if they are a router/switch on LAN, then traffic of all client machines going through this machine running sniffer can be seen. All others which do not go through you, won't be visible.

Here is some scapy code sample that i wrote while doing some packet sniffing from my local machine. You have to install the package and import in python for this to work.

Community
  • 1
  • 1
fkl
  • 5,412
  • 4
  • 28
  • 68