Code Monkey home page Code Monkey logo

python-r305's Introduction

python-R305

python api for R305 Fingerprint module over UART.

Alt R305 fingerprint module

installation

using pip

$ pip install R305

For Fedora and centos

$ dnf copr enable girish946/R305
$ dnf install python-R305

Usage

To store the fingerprint in to the module

from r305 import R305
import sys

device   = sys.argv[1]
baudrate = sys.argv[2] # the default baudrate for this module is 57600

dev = R305(device, baudrate)

def callback(data):
    x = raw_input(data)

result = dev.StoreFingerPrint(IgnoreChecksum=True, callback=callback)
print(result)

To search fingerprint in the module

from r305 import R305
import sys

device   = sys.argv[1]
baudrate = sys.argv[2] # the default baudrate for this module is 57600

dev = R305(device, baudrate)

result = dev.SearchFingerPrint()
print(result)

Documentation

the documentation for Python-R305 package can be found at rtfd.org

python-r305's People

Contributors

gabrielkrell avatar girish946 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-r305's Issues

Need some sample code as wiki

Hello,

I had hardware & debian operating system.

Can you provide sameple code and steps so we can utilize this lib.

Thanks in advance.

Missing Functionality for real use cases

Thanks for the good / efficient code for the R305 library.

I think this is a library with partial functionality with efficient code. For example, uploading / downloading templates from the host system is missing. As per the documentation, there is a restriction on packet length in certain commands/operations. The templates and character files are longer than limit and need to split into multiple packets. "EOP" (end of data packet) identifier has been used the in the package identifiers list in R305.py but not used. This will be required for actual usage.

Further, I am skeptical about the code in DownChar function. As per the documentation, it will only need 1 parameter of BufferId. You have made provision for PageIds as well. The examples sited have not used the DownChar function. Correct me, if this is not the case and there is some code which I have missed in DownChar. Has it been tested?

Using with Raspberry UART

I am trying to use with raspberry pi 2 and any command the reader light turns on and it immediately shuts off. Can you tell me why?

Error trying examples

I have a error during store_finger_print.py executing:
./store_finger_print.py /dev/ttyUSB0 57600
Traceback (most recent call last):
File "./store_finger_print.py", line 12, in <module>
result = dev.SearchFingerPrint()
File "/home/super_pypsik/work/projects/imx/python-R305-master/device.py", line 473, in SearchFingerPrint
finger_on_sensor = self.GenImg()
File "/home/super_pypsik/work/projects/imx/python-R305-master/device.py", line 185, in GenImg
data = getHeader('GenImg')
File "/home/super_pypsik/work/projects/imx/python-R305-master/device.py", line 19, in getHeader
if command in instruction:
NameError: name 'instruction' is not defined

ImportError: No module named 'device'

Dear Girish,

while running the example program on windows 8.1 I get this error

Traceback (most recent call last):
  File "C:\Users\Elcot\Desktop\R305\python-R305-master\examples\store_finger_print.py", line 4, in <module>
    from r305 import R305
  File "C:\Python34\lib\site-packages\r305\__init__.py", line 4, in <module>
    from device import *
ImportError: No module named 'device'

even through I connect with R305 by using UART to USB converter

Thanks for nice work, I found error please update error in code.

def getChecksum(data):

"""
calculates the checksum of the packet.
:param data: the datapacket
Returns the list containing two bytes which are the checksum of the given
packet.
"""

frame = data[6:]
csum = sum(getIntList(frame))
_csum1 = int(csum / 256)
csum2 = csum % 256_
#print(hex(csum1), hex(csum2))
return [csum1, csum2]

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.