I am trying to connect a particle sensor to RPi via I2C.
I have added dtparam=i2c_arm=on
to the config.txt file and I have also un-blacklisted I2C.
Using the Serial Python module, I have a script that defines a connection with /dev/i2c-0
and when I try and run this script in the Linux terminal, I get this message:
Traceback (most recent call last):
File "fly_modt.py", line 23, in <module>
ser2 = serial.Serial('/dev/i2c-0')
File "/home/pi/OPC/serial/serialutil.py", line 282, in __init__
self.open()
File "/home/pi/OPC/serial/serialposix.py", line 296, in open
self._reconfigurePort()
File "/home/pi/OPC/serial/serialposix.py", line 325, in _reconfigurePort
raise SerialException("Could not configure port: %s" % msg)
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')
I am wondering what is going on and what I need to do in order to get this I2C connection to work.
Also, to add more information to the question, when I use the cat command for i2c-0, I get an Input/ouput error:
cat i2c-0
cat: i2c-0: Input/output error
Thanks