Skip to content
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

Retry Calibration with AHT20 command on failure #19

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

DemiVis
Copy link
Contributor

@DemiVis DemiVis commented Dec 15, 2023

If try-except around legacy calibrate command fails, try to send new one instead afterwards.

Addressing #17 and possibly #18 as well
Moved try-except from PR #16 doesn't work with the latest AHT20s (at least the ones I have) but instead gives very cryptic OS error implying the device is not present. Found different first-byte to write for newer AHT20's and tried that (details in #17 ). Made updates that I think will work with AHT10 still as the execution path remains unchanged from before, but retries if that fails.

Tested on my setup (details in #17) and works great (takes the calibration_failed path, then calibrates and succeeds).

If try-except around legacy calibrate command fails, try to send new one instead afterwards
Switch from generic Exception to RuntimeError or OSError (the two I got while debugging this issue) to pass the pylint process checking
@mikeysklar
Copy link

Confirmed. This update works for me. Requesting forum user also try.

@ladyada ladyada merged commit d6e60ad into adafruit:main Dec 18, 2023
1 check passed
@ladyada
Copy link
Member

ladyada commented Dec 18, 2023

thanks!

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 19, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_ACeP7In to 0.8.6 from 0.8.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_ACeP7In#6 from prcutler/root-group-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_AHTx0 to 1.0.21 from 1.0.20:
  > Merge pull request adafruit/Adafruit_CircuitPython_AHTx0#19 from DemiVis/aht20_retry_calibration

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1106 to 1.3.2 from 1.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1106#15 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_IL0398 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_IL0398#16 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_ILI9341 to 1.4.2 from 1.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_ILI9341#35 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 6.3.2 from 6.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#131 from FoamyGuy/update_secrets_use

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1325 to 1.5.2 from 1.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1325#19 from adafruit/fourwire-i2c

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#24 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1681 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1681#14 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7735R to 1.6.2 from 1.6.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7735R#33 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_UC8151D to 1.3.2 from 1.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_UC8151D#12 from dhalbert/fourwire

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wii_Classic#4 from dhalbert/displayio

Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.8.0 from 5.7.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#112 from kavinaidoo/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipC to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_FlipC#12 from adafruit/fix_build_yml

Updating https://github.com/adafruit/Adafruit_CircuitPython_Qualia to 1.2.0 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Qualia#3 from makermelissa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

3 participants