alexellis / growlab

A global contest to grow and monitor your own food with Raspberry Pi
MIT License
443 stars 49 forks source link

Redefinition of get readings #18

Open rodneyosodo opened 3 years ago

rodneyosodo commented 3 years ago

These lines are redefined

  1. https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L15 is redefined here https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L20

  2. https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L16 is redefined here https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L21

  3. https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L17 is redefined here https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L22

alexellis commented 3 years ago

Hi not sure what you'd like me to do here? 🤔

rgee0 commented 3 years ago

@0x6f736f646f this line tries to explain: https://github.com/alexellis/growlab/blob/d1e65558d864b112bfd98871bae1c83bbdc7ff46/bme280-logger/sender/sensors.py#L14

Do you know of a different way to discard the first reading, or obtain reliable results through the first read?

rodneyosodo commented 3 years ago

Then it might be a library issue. This can be improved by using a filter. Yes, you would be trading the raw values but you would achieve better results.

rodneyosodo commented 3 years ago

This is from BME official docs.

calibration_params = bme280.load_calibration_params(bus, address)

# the sample method will take a single reading and return a compensated_reading object
data = bme280.sample(bus, address, calibration_params)

For a data-logger like application, periodically call bme2.sample(bus, address, calibration_params) to get time-based readings.

@alexellis are you currently sampling the readings? If not we can probably use this approach and see if clears the issue.

rgee0 commented 3 years ago

Work something up and let's have a look at how it might change the approach. I'm interested as I take the second reading over on rgee0/seeds2 too.