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

'softReset()' fails to reduce power. #28

Open
Tristan-Day opened this issue Jan 31, 2024 · 3 comments · May be fixed by #29
Open

'softReset()' fails to reduce power. #28

Tristan-Day opened this issue Jan 31, 2024 · 3 comments · May be fixed by #29

Comments

@Tristan-Day
Copy link

  • Arduino board: ESP32 Lolin D32 Lite
  • Arduino IDE version (found in Arduino -> AbouE**t Arduino menu): N/A (PlatformIO Core, version 6.1.13)

Replication:

  1. Call 'begin()' with no parameters.
  2. Take a measurement.
  3. Call 'softReset()'

Outcome:

  • The method 'softReset()' returns false.
  • Power consumption does not change.
@Tristan-Day
Copy link
Author

Update:

By issuing a "general reset" not using BusIO, the command functions as expected. This requires a target address of 0x00, not the sensor address automatically added.

A solution would be to manually pass the Wire interface as an optional argument since a pointer to the interface is not exposed by i2c_dev.

boolean Adafruit_SGP30::softReset(TwoWire* theWire = &Wire) {
  theWire->beginTransmission(0x00);
  theWire->write(0x06);
  return theWire->endTransmission();
}

@Tristan-Day Tristan-Day linked a pull request Feb 2, 2024 that will close this issue
@caternuson
Copy link
Contributor

caternuson commented Feb 2, 2024

Bummer it doesn't just work with the address, even though it goes against the datasheet:

image

Sounds like you've verified it must done per datasheet.

Have you gone as far as verifying the sensor works OK again after an actual soft reset (using your modified code)?

image

@Tristan-Day
Copy link
Author

Yes, I have it restart every 5m and it seems to work fine after the first few readings.

It seems to read 400 for about 10s but after that I beleive it gives genuine readings.

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 a pull request may close this issue.

2 participants