Skip to content

No I2C device at address #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PersephoneKarnstein opened this issue Dec 8, 2024 · 2 comments
Open

No I2C device at address #14

PersephoneKarnstein opened this issue Dec 8, 2024 · 2 comments

Comments

@PersephoneKarnstein
Copy link

tried the example exactly as shown on https://learn.adafruit.com/adafruit-max17048-lipoly-liion-fuel-gauge-and-battery-monitor/python-circuitpython using a Adafruit MAX17048 LiPoly / LiIon Fuel Gauge and Battery Monitor and Raspberry Pi 4B. Everything was correctly connected; LEDs were lit, etc. Got the following error on the second line of the example.

>>> import time
>>> import board
>>> import adafruit_max1704x
>>> 
>>> i2c = board.I2C()  # uses board.SCL and board.SDA
>>> 
>>> i2c
<busio.I2C object at 0x7f819b6490>
>>> max17 = adafruit_max1704x.MAX17048(i2c)
Traceback (most recent call last):
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 175, in __probe_for_device
    self.i2c.writeto(self.device_address, b"")
  File "/home/persephone/env/lib/python3.11/site-packages/busio.py", line 215, in writeto
    return self._i2c.writeto(address, buffer, stop=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 60, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/home/persephone/env/lib/python3.11/site-packages/Adafruit_PureIO/smbus.py", line 303, in write_bytes
    self._device.write(buf)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 181, in __probe_for_device
    self.i2c.readfrom_into(self.device_address, result)
  File "/home/persephone/env/lib/python3.11/site-packages/busio.py", line 205, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 67, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end - start)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/persephone/env/lib/python3.11/site-packages/Adafruit_PureIO/smbus.py", line 170, in read_bytes
    return self._device.read(number)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_max1704x.py", line 110, in __init__
    self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 62, in __init__
    self.__probe_for_device()
  File "/home/persephone/env/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 184, in __probe_for_device
    raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x36

i2cdetect results are below

(env) persephone@raspberrypi:~ $ ls /dev/i2c*
/dev/i2c-1  /dev/i2c-20  /dev/i2c-21
(env) persephone@raspberrypi:~ $ 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: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
(env) persephone@raspberrypi:~ $ sudo i2cdetect -y 20
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 09 0a 0b 0c 0d 0e 0f 
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f 
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 
70: 70 71 72 73 74 75 76 77                         
(env) persephone@raspberrypi:~ $ sudo i2cdetect -y 21
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 09 0a 0b 0c 0d 0e 0f 
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f 
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 
70: 70 71 72 73 74 75 76 77    
@caternuson
Copy link

Please post in the forums with photos of your setup showing how everything is connected:
https://forums.adafruit.com/

@Thynix
Copy link

Thynix commented Feb 25, 2025

I had this problem using CircuitPython from an ESP32-S2. When I plugged a battery into the MAX17048 board, it started appearing on I2C. Strange, I'd expect it to read 0V instead?

The corresponding Adafruit Forum post is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants