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

Add mask for feature set check. #20

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

caternuson
Copy link
Contributor

Potential fix for #19. Adds mask to only check partial feature set value result.

@caternuson
Copy link
Contributor Author

@ladyada for review. UNTESTED (don't have any newer variant boards)

@Cardenas-Synth
Copy link

thank you for trying to address this. you have the .mpy update for this? i tried using an init.py version on my esp32 and i'm getting this error after that line of the feature passes (BTW, thank you for looking into this):

File "", line 1, in
File "/lib/adafruit_sgp40/init.py", line 123, in init
File "/lib/adafruit_sgp40/init.py", line 146, in initialize
File "/lib/adafruit_sgp40/init.py", line 293, in _read_word_from_command
OSError: [Errno 116] ETIMEDOUT

@caternuson
Copy link
Contributor Author

Using the .py version is OK. The .mpy is just a "compiled" version that helps for memory constrained boards. If the .py imported without errors, then it's working. You'd want to remove the .mpy version from the CIRCUITPY lib folder though, since .mpy has import precedence over .py.

The ETIMEDOUT issue may be indicating there is more going on. :(

@Cardenas-Synth
Copy link

Great to know! Thank you for responding so quickly.

In case this helps, my team has ordered from digikey/adafruit about a couple months back and all spg40s (~10) operated smoothly. We recently ordered from mouser/digikey and all of the boards (16 boards) all failed. Currently, the older ones we still have still work, the newer ones do not. Possibly a bad PCB print? we're returning the ones that didnt work. The position we're at is time sensitive, so we plan on attempting to order some more from a source capable of overnighting to see if we have better luck

Thanks!

Damon

@ladyada
Copy link
Member

ladyada commented Jun 23, 2023

@caternuson can merge this to at least resolve the feature change. do you wanna pick up an SGP40 from the shop to try and repro the timeout

@caternuson
Copy link
Contributor Author

@ladyada yep. will do. will wanna check arduino also.

@caternuson caternuson merged commit 980cc47 into adafruit:main Jun 23, 2023
1 check passed
@Cardenas-Synth
Copy link

Cardenas-Synth commented Jun 24, 2023

I believe i resolved the issue (for at least the code for circuitpython bundle for esp32...maybe similar for RPI)! Please double check, though. I have not verified compatibility with older chipset nor have i fully vetted impact on readings (i assume there will be none, so far it looks good).

With the new chipset, the timeout : self_test = self._read_word_from_command(delay_ms=250)
needed to be extended to 500ms. This was changed with a note in the arduino code (see link below) but not in the circuitpython init.py script. I made the update and my code works now! (*Note, you also have to broaden the acceptable chipsets in another line)

I changed lines 140, 146, and 207 to the following:
{{
140| if featureset[0] & 0xFF00 != 0x3200:
146| self_test = self._read_word_from_command(delay_ms=500)
207| read_value = self._read_word_from_command(delay_ms=500)
}}

I changed the time instance in two locations, although i dont know if both are necessary.

Arduino Change notes
adafruit/Adafruit_SGP40@14449d7

@ladyada
Copy link
Member

ladyada commented Jun 24, 2023

oh yeah that does sound familar! ok new PR made, please take a look!
#21

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 28, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP40 to 1.3.14 from 1.3.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP40#20 from caternuson/iss19

Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6070 to 3.1.17 from 3.1.16:
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#24 from adafruit/stemma_i2c

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 3.0.0 from 2.5.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#119 from BiffoBear/add_w6100

Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 3.1.0 from 3.0.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#90 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#89 from makermelissa/master

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.

None yet

3 participants