Feather 0x0b for LC70903F shows in scan but can't be used

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jonjlaw
 
Posts: 3
Joined: Sat Aug 06, 2022 4:44 pm

Feather 0x0b for LC70903F shows in scan but can't be used

Post by jonjlaw »

I'm trying to get battery reporting working on my Adafruit ESP32-S3 Feather with 4MB Flash 2MB PSRAM - STEMMA QT / Qwiic - https://www.adafruit.com/product/5477
I was following the code in the example found here: https://learn.adafruit.com/adafruit-esp ... ry-3122383
But have added some code from the i2c page to prove that the address is listed in a scan: https://learn.adafruit.com/scanning-i2c ... cuitpython

The code I am currently running:

Code: Select all

import time
import board
from adafruit_lc709203f import LC709203F

i2c = board.I2C()
while not i2c.try_lock():
    pass

try:
    print(
        "I2C addresses found:",
        [hex(device_address) for device_address in i2c.scan()],
    )

finally:  # unlock the i2c bus when ctrl-c'ing out of the loop
    i2c.unlock()

time.sleep(1)

sensor = LC709203F(board.I2C())

print("IC version:", hex(sensor.ic_version))
while True:
    print(
        "Battery: %0.3f Volts / %0.1f %%" % (sensor.cell_voltage, sensor.cell_percent)
    )
    time.sleep(1)
I am getting the output below:

Code: Select all

I2C addresses found: ['0xb']
Traceback (most recent call last):
  File "code.py", line 20, in <module>
  File "adafruit_lc709203f.py", line 117, in __init__
ValueError: No I2C device at address: 0xb

Code done running.
I have also seen this message:

Code: Select all

Traceback (most recent call last):
  File "code.py", line 20, in <module>
  File "adafruit_lc709203f.py", line 122, in __init__
  File "adafruit_lc709203f.py", line 126, in init_RSOC
  File "adafruit_lc709203f.py", line 247, in _write_word
OSError: [Errno 116] ETIMEDOUT

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by dastels »

Have you tried it without the scan code?

Dave

User avatar
jonjlaw
 
Posts: 3
Joined: Sat Aug 06, 2022 4:44 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by jonjlaw »

Yes, I only added the scan code after it failed without it. I wanted to see if 0xb was listed.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by dastels »

How do you have the LC70903F connected to the Feather?

Dave

User avatar
jonjlaw
 
Posts: 3
Joined: Sat Aug 06, 2022 4:44 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by jonjlaw »

It is part of the board.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by dastels »

Doah. I'm used to the breakout.

Have you tried the C++ example? If that fails as well then it's most likely the LC70903F that's at fault.

Dave

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Feather 0x0b for LC70903F shows in scan but can't be use

Post by adafruit2 »

S3 has a bug right now in i2c in ESP-DIF
https://github.com/adafruit/circuitpython/issues/6311
its in progress! you can subscribe to be notified when its fixed 'upstream'

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”