lthiery / SPI-Py

Hardware SPI as a C Extension for Python
286 stars 150 forks source link

Warning on Run sudo python setup.py install #8

Open rey1024 opened 9 years ago

rey1024 commented 9 years ago

I Follow this instruction http://geraintw.blogspot.com/2014/01/rfid-and-raspberry-pi.html.

i run this script on Raspberry Pi B+ (raspbian). when i run :+1: sudo python setup.py install running install running build running build_ext building 'spi' extension creating build creating build/temp.linux-armv6l-2.7 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c spi.c -o build/temp.linux-armv6l-2.7/spi.o spi.c:197:2: warning: initialization from incompatible pointer type [enabled by default] spi.c:197:2: warning: (near initialization for âSpiMethods[0].ml_methâ) [enabled by default] creating build/lib.linux-armv6l-2.7 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-armv6l-2.7/spi.o -o build/lib.linux-armv6l-2.7/spi.so running install_lib copying build/lib.linux-armv6l-2.7/spi.so -> /usr/local/lib/python2.7/dist-packages running install_egg_info Removing /usr/local/lib/python2.7/dist-packages/SPI_Py-1.0.egg-info Writing /usr/local/lib/python2.7/dist-packages/SPI_Py-1.0.egg-info

but when i run sudo python setup.py install again : running install running build running build_ext running install_lib copying build/lib.linux-armv6l-2.7/spi.so -> /usr/local/lib/python2.7/dist-packages running install_egg_info Removing /usr/local/lib/python2.7/dist-packages/SPI_Py-1.0.egg-info Writing /usr/local/lib/python2.7/dist-packages/SPI_Py-1.0.egg-info

but when i test with python MFRC522-python/Read.py, cannot detect tag

Grahamrich1 commented 7 years ago

So think I had the same but after restart it worked like your second attempt.

I just cant get it to run the Read.py

pi@raspberrypi:~/gr_programs/RFID/SPI-Py/MFRC522-python $ sudo python read.py can't open device: No such file or directory pi@raspberrypi:~/gr_programs/RFID/SPI-Py/MFRC522-python $ sudo python Read.py python: can't open file 'Read.py': [Errno 2] No such file or directory

Looks like a shortfall in my Python understanding but I cant see what Im doing wrong

Grahamrich1 commented 7 years ago

rey1024, Do we not need to use the Sudo command to allow us supervisory access to the GOIP pins to be able to read the RFID content?

ncoshea commented 6 years ago

I have the same issue, any fix guys?