I am a python noob, but inside the PiicoDev_Unified.py code, shouldn’t this class be using the same logic the i2c_setup.sh is doing in regards to working out the config file location? In bookworm, it should be boot/firmware/config.txt
class I2CUnifiedLinux(I2CBase):
def __init__(self, bus=None, suppress_warnings=True):
if suppress_warnings == False:
with open('/boot/config.txt') as config_file:
if 'dtparam=i2c_arm=on' in config_file.read():
pass
else:
print('I2C is not enabled. To enable' + setupi2c_str)
config_file.close()
with open('/boot/config.txt') as config_file:
if 'dtparam=i2c_arm_baudrate=400000' in config_file.read():
pass
else:
print('Slow baudrate detected. If glitching occurs' + setupi2c_str)
config_file.close()
if bus is None:
bus = 1
self.i2c = SMBus(bus)