Socket connection refused (F7 fingerprint reader)

Socket connection refused (F7 fingerprint reader)

Postby AndresFelix » Fri Apr 25, 2014 7:44 am

Hello, I'm having some trouble with a school project. I'm trying to read whatever a device (F7 fingerprint reader) is sending and write it in a text document. The objective is to communicate with the F7 in a local network. I'm using a router as a switch. I configured the F7's Comm Settings (IP addr:, Mask:, Default Gateway: and I run a python code in my computer that it is supposed to retrieve the data sent by the F7 and write on the text document.
I know that the default port used by the F7 is port 4370, I'm trying to connect to it by creating a socket IP + Port, since I know both.

This is my code:
Code: Select all
    import socket
    import sys
    TCP_IP = ''
    TCP_PORT = 4370
    errormsg = 'No connection created'
    succmsg = 'Connection created'
        soc = socket.socket()
        soc.connect((TCP_IP, TCP_PORT))
    except socket.error:
        print (errormsg)
        input("Press ENTER to exit")
    print (succmsg)
    while True:
       msg = soc.recv(1024)
       msg = str(msg)
       print (msg)
       with open('BiometricID.txt','a') as f:
    input("Press ENTER to exit")

I thought that code could work but it throws an error "10061", that says that the machine actively refused the connection. It is quite possible that I have other mistakes, but first I want to connect to the device, after that I'll go on with whatever could fail too.
If you need more information just ask and I'll try to provide it.
Thank you very much!
Posts: 1
Joined: Fri Apr 25, 2014 7:38 am

Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest