#ESP32-S2 forgetting its LC709203 battery monitor

1 messages · Page 1 of 1 (latest)

jolly willow
#

I’ve been having very troublesome errors with the ESP32-S2 feather (with included BME280 sensor). I am trying to use the learn guide example code for sensor readings & sending the data to Adafruit IO. I have it set to do a 60-second deep sleep (whereas Kattni’s code has 10 minutes)

The frustrating part is that the code works perfectly when I am connected to my serial monitor, and it works for while after I connect the battery and reboot. However, after after a brief amount of time, and presumably a few sleep cycles, I start getting the double red-blink indicating a failed code.py.

When I connect to the terminal, and re-run the code, I’ll get the following message

  File "<stdin>", line 52, in <module>
  File "adafruit_lc709203f.py", line 117, in __init__
ValueError: No I2C device at address: 0xb```

It is like it has forgotten the battery monitor chip is there.  I’ll note that an i2c address scan still shows the BME280 at 0x77.  The only way I know how to fix it is to disconnect and reconnect the battery (a simple reset button press doesn’t fix it).

I’ve had this same problem on at least two ESP32-S2 feathers with the BME280.  The problem exists on the most recent stable release (with updated .mpys), and the 8.0 alpha (with updated .mpys).  

Any ideas?
zealous crest
#

The LC709203F goes to sleep when not accessed in a while. Also, make sure that board.I2C_POWER is high: maybe it is getting reset to low by accident.
You could catch the ValueError and try again a few times if the LC709203F doesn't respond immediately. The library I think may have some code to do that, but you could try for longer.

vale venture
#

Does board.I2C_POWER affect the LC709203F? IIRC the chip is powered directly by the battery it monitors, there is no power delivered to it from the MCU.

zealous crest
jolly willow
#

I don't know if it is i2c_power, but it can't hurt to turn it on. I moved the battery reading into its own function with a try: now, and it seems stable for the moment. Thanks everyone for your help!