ok, this makes some sense. I unplugged everything else off the pHat 2.0. I wasn’t sure I could use the suggested python library since it appeared to be directed at the pimoroni thermocouple under the same name.
I get errors attempting to use this MCP9600 driver however. Indicating that it cannot find the device at 0x66
pi@raspberrypi:~/mcp9600-python/examples $ python alerts.py
Traceback (most recent call last):
File “/home/pi/.local/lib/python3.7/site-packages/mcp9600/init.py”, line 194, in init
chip = self._mcp9600.get(‘CHIP_ID’)
File “/home/pi/.local/lib/python3.7/site-packages/i2cdevice/init.py”, line 230, in get
self.read_register(register)
File “/home/pi/.local/lib/python3.7/site-packages/i2cdevice/init.py”, line 183, in read_register
self.values[register.name] = self._i2c_read(register.address, register.bit_width)
File “/home/pi/.local/lib/python3.7/site-packages/i2cdevice/init.py”, line 288, in _i2c_read
for x in self._i2c.read_i2c_block_data(self._i2c_address, register, bit_width // self._bit_width):
OSError: [Errno 121] Remote I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “alerts.py”, line 5, in
m = mcp9600.MCP9600()
File “/home/pi/.local/lib/python3.7/site-packages/mcp9600/init.py”, line 198, in init
raise RuntimeError(“Unable to find mcp9600 on 0x{:02x}, IOError”.format(self._i2c_addr))
RuntimeError: Unable to find mcp9600 on 0x66, IOError
I dug into the “driver” file init.py of this library and can see some discrepancies between the address assigning in the sparkfun arduino library vs this one. I’m not sure if I am looking at this apples to apples.
from https://github.com/sparkfun/SparkFun_MC … _MCP9600.h
#define DEV_ADDR 0x60 //device address of the MCP9600
#define DEV_ID_UPPER 0x40 //value of the upper half of the device ID register. lower half is used for device revision
#define DEV_RESOLUTION 0.0625 //device resolution (temperature in C that the LSB represents)
#define retryAttempts 3 //how many times to attempt to read a register from the thermocouple before giving up
from https://github.com/pimoroni/mcp9600-pyt … init_.py
CHIP_ID = 0x40
I2C_ADDRESSES = list(range(0x60, 0x68))
I2C_ADDRESS_DEFAULT = 0x66
I2C_ADDRESS_ALTERNATE = 0x67
the way these files are using 0x40 is not the same is that correct? I corrected the init.py file to a CHIP_ID =0x40 but i get the same error.
I am also not sure if this is related but if I run gpio i2cd i see the mcp9600 at 0x60 however if I run it a second time the address is empty. I have two of the so I swapped it out, cables too. Same issue. I dug a bit online and found this can be caused by overloading the i2c bus? Is there something wrong with using gpio i2cd like this?
Also If this is just terrible noobie questions please feel free to tell me so. I just haven’t found much of a solution searching so rather than keep pulling out my hair I’m here.