py532 with i2c - Raspberry Pi Forums


hi

connecting adafruit pn532 nfc reader raspberry pi. want read tag data using python script. using example http://hubcitylabs.org/nfc-on-raspberry ... b-and-i2c/

have enabled i2c on pi , sudo i2cdetect -y 1 giving:

0 1 2 3 4 5 6 7 8 9 b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- uu -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


have installed pn532lib, python3 when executing sudo python reader.py, giving following error:
file "reader.py", line 5, in <module>
py532lib.i2c import *
importerror: no module named i2c

can me this?

regards
nancy

you have set pythonpath environment variable.

example,
1. add pythonpath in ~/.bashrc file

code: select all

pythonpath="${pythonpath}:/path/to/pn532lib"
2. add pythonpath in code

code: select all

import sys sys.path.append("/path/to/py532lib")
luck project : )


raspberrypi



Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62