Black Lives Matter - Action and Equality.
0

I2C device at address
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

I2C device at address

by tultalk on Thu May 14, 2020 7:08 pm

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/adafruit_ads1x15/ads1x15.py", line 83, in __init__
self.i2c_device = I2CDevice(i2c, address)
File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 69, in __init__
self.__probe_for_device()
File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 192, in __probe_for_device
raise ValueError("No I2C device at address: %x" % self.device_address)
ValueError: No I2C device at address: 48
>>>

The device address is hard at 48!!!!!


pi@FarmPI:~ $ sudo i2cdetect -y 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: -- -- -- -- -- -- -- --
pi@FarmPI:~ $

INet search suggested not connecting correct bus (0 or 1)

My device is busnumber 1

Old module allowed setting default busnumber

Don't see that in circuit python code.

How/where to set busnumber?

2nd item:

Traceback (most recent call last):

File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 190, in __probe_for_device
self.i2c.readfrom_into(self.device_address, result)
File "/usr/local/lib/python3.7/dist-packages/busio.py", line 84, in readfrom_into
return self._i2c.readfrom_into(address, buffer, stop=stop)
File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 53, in readfrom_into
readin = self._i2c_bus.read_bytes(address, end - start)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 178, in read_bytes
self._select_device(addr)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 163, in _select_device
ioctl(self._device.fileno(), I2C_SLAVE, addr & 0x7F)
OSError: [Errno 16] Device or resource busy

What causes device/resource busy (If it can't find device)?

Thanks

Best regards

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by tultalk on Fri May 15, 2020 11:38 am

Using KNACRO 4-Channel 16Bit ADC with PGA for RPI Raspberry PI 16 Bits I2C ADS1115 Module ADC 4 Channel for Raspberry Pi 3/2 Model B/B+ under 2.7 simpletest.py worked. Changed to SeeedStudio 4-Channel 16-Bit ADC for Raspberry Pi (ADS1115) and get same resource not found under 2.7. At least with Knacro I could easily switch address. With SeeedStrudio, it seem a need to unsolder one bridge and solder another. Pretty stupid.

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Mon May 18, 2020 11:34 am

How/where to set busnumber?

See here:
https://github.com/adafruit/Adafruit_Bl ... -622096854
https://github.com/adafruit/Adafruit_Py ... tended_Bus

What causes device/resource busy (If it can't find device)?

What is the device in question?

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Mon May 18, 2020 12:15 pm

A SeedStudio 4 channel 16 bit ADC. But as I stated, 0x48 is "busy" even with the ADC removed.

I saw on another device the 0x48 was a temp sensor and I take not that the RP Pi/Python reports bcm chip temp.

How is that chip temp accessed? Is the sensor on the ic2 bus 1 at 0x48?

I am looking for some tool that reports what (in detail) is at 0x48 on i2c 1

Thanks

Robert

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Mon May 18, 2020 1:33 pm

Please contact SeedStudio for support with using their ADC.

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 1:58 pm

Not seeed studio. I am using adafruit software.

Every time I shutdown and restart the TB Pi I fund i2cdetect 1 showing uu at 0x48 and the ADC says busy.

If I run sudo rmmod ADS1015 , the uu is cleared and the address 48 shows and the ADC is accessible.

How do I block the ADS1015 form latching onto the kernel?

ps: Fif not like the adafruit 1115 board.

Thanks

Robert

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Tue May 26, 2020 2:23 pm

Please link to the product page for the specific ADC you are using.

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 2:36 pm


tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Tue May 26, 2020 2:48 pm

That is not our hardware. The Adafruit libraries are written for these ADS1x15 breakouts:
https://www.adafruit.com/product/1085
https://www.adafruit.com/product/1083

You'll need to contact Seeed for support with their product.

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 4:08 pm

I ralize that what I am using is not your product. The adafruit library works with 1015 & 1115 boards. I don't like the little breakout boards.
I want something stacked and compact.

I had tried earlier with a Knacro ADC (Same config as the Seeed) and had the same problem. Knacro said to use adafruit library

(KNACRO 4-Channel 16Bit ADC with PGA for RPI Raspberry PI 16 Bits I2C ADS1115 Module ADC 4 Channel for Raspberry Pi 3/2 Model B/B+)

So if I spend $15 on your breakout board and the software exhibits the same problem, will you answer the question:

"Why is this binding to the kerne"l?

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 4:30 pm

So I guess I have to blacklist ads1015.

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Tue May 26, 2020 4:35 pm

Yes. We will support our software with our hardware.

Maybe check for any overlays that have been activated in /boot/config.txt? Not sure why the kernel would bind to the ADS on the I2C bus without some prior doing. The basic library shouldn't cause that behavior.

Here's an ADS1115 breakout on a Pi 0 W with Raspbian Lite. It sees the ADS as expected:
Code: Select all | TOGGLE FULL SIZE
pi@pi0:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- 

and indicates it has not been taken, i.e. no UU return.

pi0_ads.jpg
pi0_ads.jpg (321.42 KiB) Viewed 35 times

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 5:08 pm

Hi:

boot/overlays contains ads1015.dtbo and ads1115.dtbo both dated 2/1620 which is when I installed adafruit software. (git)

Can I just delete these two files?

Thanks

The original install was from the archive for Python 2.7. I am currently using the new install on 3.7

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by adafruit_support_carter on Tue May 26, 2020 6:11 pm

Those overlays may be part of the Raspberry Pi firmware:
https://github.com/raspberrypi/firmware ... t/overlays

Where you following a guide for installing the libraries? If so, which one? If not, can you elaborate on what you did here:
I installed adafruit software. (git)

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 6:37 pm

I installed the library from git:

First: https://wiki.52pi.com/index.php/RPI-ADS ... KU:EP-0076

Then

sudo apt-get install git build-essential python-dev
cd ~
git clone https://github.com/adafruit/Adafruit_Python_ADS1x15.git
cd Adafruit_Python_ADS1x15
sudo python setup.py install

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Please be positive and constructive with your questions and comments.