Require guidance for ADS1115 4Ch 16bit PiHat: Communication issues via SMBus

Hi all,

I am new to Python programming and this my first time in any user forum, so please be kind :slight_smile:

I installed my ADS1115 board to RasPi as mentioned by SEEED itself. Everything worked as expected and still does.

So I tried to implement in Phyton3, for now, refering to this code up to line 66 which returned an error:

 File "/home/pi/Desktop/RasPi/ads1115_test.py", line 16, in <module>
       bus.write_i2c_block_data(0x48, 0x01, data)
 OSError: [Errno 16] Device or resource busy

Okay, as said, I am new to this business, but while my research what this means I found out that i2cdetect can be used to figure out the correct adress. I don’t exactly know how to interpret “UU”.

:~ $ sudo i2cdetect -y -r 1
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 00:                         -- -- -- -- -- -- -- --
 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 70: -- -- -- -- -- -- -- --

So, here are my questions:

  1. This UU does mean that the device is somehow busy? Correct value would be 0x48?

  2. If my ADS1115 is busy (doing whatever), why can I communicate via terminal? Isn’t it I2C as well?

  3. How do I fix this?

Please let me know if any further information required. Thanks a lot in advance for your support!

So, in between I found out what went wrong:

As per advice of Seeed, I initialized the Hat during boot sequence. This was causing the device to be busy as waiting for terminal command. Therefore it could not be accessed by smbus from Python.

Solution was to remove initialization of ADS1115 via boot_config.txt. Now no more UU when i2cdetect -y 1 and Python script is working as intended.