adafruit / Adafruit_SGP30

Arduino library for SGP30
Other
56 stars 38 forks source link

Deep Sleep ESP #14

Closed cliedelt closed 4 years ago

cliedelt commented 4 years ago

Hi,

I have Issues with the SGP30 after the ESP goes to deep sleep. The sensor is only getting the same value every time. Even after hours of running.

If I remove the deep sleep and add a simple delay the sensor is working just fine.

My assumption is the sgp.begin() is resetting the sensor.

Is there a way to fix this?

ladyada commented 4 years ago

not without re-writing the library to not initialize on reset - you would have to figure out how to determine if it was a deep sleep vs reset, in your user code.

cliedelt commented 4 years ago

To detect if there was a deep sleep or not is simple.

But if I don’t call sgp.begin() the Programm crashes when I try to read the sensor.

Could you give me a hint to prevent the resetting ? On which line is the library resetting the sensor?

Thank you very much!

ladyada commented 4 years ago

you'd have to read and adjust the C++ code - we dont have a tutorial on how to do so - please fork the library and make your changes :)