THP-JOE / Python_SI1145

Python library for the SI1145.
MIT License
20 stars 13 forks source link

Can you please fix it for 2019 #12

Open kflmiami420 opened 5 years ago

kflmiami420 commented 5 years ago

Hello

I purchased a SI1145 and I am trying to use this repo on a raspberry pi zero W but it does not work

can anyone help me out ?

Thank you kflmiami420

Raspberry Pi Zero W installed latest Raspbian strech

sudo apt-get install python3-pip sudo pip3 install --upgrade setuptools sudo pip3 install RPI.GPIO sudo pip3 install adafruit-blinka sudo pip3 install smbus2

I get this error [code] pi@raspberrypizerowbread:~/Python_SI1145/examples $ python3 simpletest.py Traceback (most recent call last): File "simpletest.py", line 45, in sensor = SI1145.SI1145() File "/usr/local/lib/python3.5/dist-packages/SI1145-1.0.0-py3.5.egg/SI1145/SI1145.py", line 163, in init File "/usr/local/lib/python3.5/dist-packages/SI1145-1.0.0-py3.5.egg/SI1145/SI1145.py", line 170, in _reset File "/usr/local/lib/python3.5/dist-packages/Adafruit_GPIO-1.0.4-py3.5.egg/Adafruit_GPIO/I2C.py", line 116, in write8 File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 256, in write_byte_data self._device.write(data) OSError: [Errno 121] Remote I/O error [/code]

mms02 commented 4 years ago

Hi - just seen your comment. I have it working on the Rasp Pi Zero W but you need to call the library code from Python2.7. As Python2 is now 'sunsetted' I've been looking for an update which works with Python3, but without success so far. So, use Pythin2 and it will all work, it should be installed in your distro and you can run 'Python2.7 simpletest.py'. If I find a Python3 library, or if anyone can assist here, I'll let you know. Thanks