Skip to content

Conversation

ilikecake
Copy link

I am having issues with read errors on

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

See here for more details.

I added try/except and retry to the _read_word and _write_word functions. I also added a check to the cell_voltage, cell_percent, and cell_temperature functions that will catch an error in a read during those functions and return none if the read fails. It will be up to the user to decide what they want to do when that happens, but it won't crash user code. (probably)

My experiences with these errors:

  • The errors happen more often the more quickly you read data from the device. (as in how fast you call the cell_voltage function.)
  • Most of these error are cleared up with a single retry.
  • It will occasionally fail 10 times in a row, so the added try/except in the read functions is necessary.

Possible Improvements:

  • Allow the user to set the number of retries.
  • Add try/except to other functions.

@tekktrik
Copy link
Member

I caught up on the linked discussion, and I'll take a look at this shortly!

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

Successfully merging this pull request may close these issues.

2 participants