mfdogalindo / pn532-hsu Goto Github PK
View Code? Open in Web Editor NEWPN532 HSU (UART) library for Python
License: MIT License
PN532 HSU (UART) library for Python
License: MIT License
I'd like to use it without recurring to polling
I'm using this library with PN532 and Raspberry Pi B+ but having trouble reading my cards. Here's the output I'm seeing when trying to scan.
Port:/dev/ttyAMA0
Found PN532 with firmware version: 1.6
Waiting for MiFare card...
Found card with UID: 0x23051749
Failed to authenticate block 0
The card is the one that came with the PN532 but I'm seeing the same with these cards as well.
I am using Python 3.6, when I trying to run the code, error below appear, please help. TQ
Traceback (most recent call last):
File "", line 1, in
runfile('E:/PN532-HSU-master/readmifare.py', wdir='E:/PN532-HSU-master')
File "C:\Users\Lam\Anaconda3\envs\tfgpu36v2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile
execfile(filename, namespace)
File "C:\Users\Lam\Anaconda3\envs\tfgpu36v2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "E:/PN532-HSU-master/readmifare.py", line 41, in
pn532.SAM_configuration()
File "E:\PN532-HSU-master\PN532.py", line 333, in SAM_configuration
self.call_function(PN532_COMMAND_SAMCONFIGURATION, params=[0x01, 0x14, 0x01])
File "E:\PN532-HSU-master\PN532.py", line 297, in call_function
if not self._write_frame(data):
File "E:\PN532-HSU-master\PN532.py", line 204, in _write_frame
ack = self._ack_wait(1000)
File "E:\PN532-HSU-master\PN532.py", line 216, in _ack_wait
rx_info += self.ser.read(self.ser.inWaiting())
TypeError: must be str, not bytes
Does this depend upon a particular pin configuration?
According to a diagram I found for the RasberryPi 3 I am using, it seems like the following would be right
GPIO 8 > Tx (SDA)
GPIO 10 > Rx (SCL)
Thanks!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.