No I2C device at address: 48 then busy

Traceback (most recent call last):
File “”, line 1, in
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)?


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. Why no plug like KNACRO? Plenty of room.

Also tried shorting pins 2 & 4 to fnd to try and reset to unblock. Did not work

More confusing. Removing items from Pi

With Seed ADC removed

i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
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: – -- – -- – -- – --


With Waveshare Stepper Motor Hat Removed

i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
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: – -- – -- – -- – --


With USB Stick removed

i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
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: – -- – -- – -- – --


And bare RB Pi with only ethernet connected

i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
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: – -- – -- – -- – --

What could be at 0x48?? and how to find out?

Thanks

Robert

Do you have any other hardware on your raspberry pi?If not, it must be a piece of software occupying the address. Try a new mirror system.

Here I was running under 2.7

ic2detect 1 showed nothing at 0x48

Plugged my ADC (w 0x48 address selected) back in.

i2cdetect 1 showed 0x48 loaded uu (onto kernel)

Ran program simpletest.py in Geany showed 0x48 busy.

Removed ADC board.

i2cdetect 1 showed 0x48 still attached to kernel

pi2@FarmPI:~ $ sudo rmmod ads1015
no error showed it was loaded
pi2@FarmPI:~ $ sudo rmmod ads1115
rmmod: ERROR: Module ads1115 is not currently loaded

I am not importing ads1015

simpletest.py under 3.7
imports

import adafruit_ads1x15.ads1115 as ADS

Create an ADS1115 ADC (16-bit) instance.

adc = Adafruit_ADS1x15.ADS1115(address=0x48, busnum=1)

pi2@FarmPI:~ $ i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

simpletest.py failed

Relogged on but in 3.7

pi3@FarmPI:~ $ sudo rmmod ads1015
pi3@FarmPI:~ $ sudo rmmod ads1115
rmmod: ERROR: Module ads1115 is not currently loaded
pi3@FarmPI:~ $ i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
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: – -- – -- – -- – --
pi3@FarmPI:~ $ i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
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: – -- – -- – -- – --
pi3@FarmPI:~ $

Now with
sudo rmmod ads1015

i2cdetect 1 shows 48 not uu indicating not attached to kernel.

Now when I run simpletest.py under 3.7 it returns values from ADC board.

Strange indeed

Will it be the same in the new system?

Still problems with Seeed board under 3.7

Detailed investigation: Seeed Studio 4 channel 16 bit ADC

With ADC board unplugged, halt/reboot i2cdetect 1 shows blank at 0x48

Hot plug ADC board and i2cdetect 1 shows 48 at 0x48 and app works.

Reboot with ADC plugged in and i2cdetect 1 shows uu at 0x48

rmmod ads1015 and ads1115 show neither installed

So the plugged in adc is now producing the uu at 0x48

Running the app to access the adc at 0x48 says
no i2c device at address 48.

So simply plugging in the ADC and booting causes “something” at address 48 to be bound to the kernel.

This is incomprehensible.

Incomprehensible in my small mind:
config.txt
[all]
#dtoverlay=vc4-fkms-v3d
gpu_mem=76
enable_uart=0
#dtoverlay=ads1115