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

allsky_temp, too low humidity with BME280 #233

Open
Alex-developer opened this issue Jan 17, 2025 · 1 comment
Open

allsky_temp, too low humidity with BME280 #233

Alex-developer opened this issue Jan 17, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Alex-developer
Copy link
Collaborator

Discussed in #232

Originally posted by chvvkumar January 17, 2025

Scenario

I have a desiccant bag in my AllSky enclosure. This keeps the humidity quite low in addition to the pressure compensating vents I installed.

Issue

From what I can tell, the allsky_temp module considers any relative humidity value <1% as invalid. But my BME280 is reporting a relative humidity of 0.645%. This causes the module to fail to save this extra variable.

Relevant logs

pi@allskypi5:~ $ tail -f /var/log/allskyperiodic.log
.
.
25-01-17T14:55:05.385625-06:00 allskypi5 allskperiodic[5843]: INFO: --------------- Running Module allsky_temp ---------------
2025-01-17T14:55:05.385642-06:00 allskypi5 allskperiodic[5843]: INFO: Reading sensor 1, BME280-I2C
2025-01-17T14:55:05.385657-06:00 allskypi5 allskperiodic[5843]: ERROR: Module allsky_temp.py failed on line 209 - Incorrect value for humidity: "0.6450005825294641". Correct range 1-100.
.
.

Troubleshooting steps so far

  1. Checked I2C cabling which seems to be correct also corroborated by the fact that the other BME280 readings report sane values
  2. Run a python script outside of AllSky to read the sensor values and these readings match AllSky readings so far
import smbus2
import bme280

port = 1
address = 0x76
bus = smbus2.SMBus(port)

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)

# there is a handy string representation too
print(data)

Output:

(venv) pi@allskypi5:~/bme280 $ python bm.py
compensated_reading(id=b9823947-0f68-4a83-8f5d-09c38c873e47, timestamp=2025-01-17 21:02:40.408275UTC, temp=20.367 °C, pressure=983.62 hPa, humidity=0.46 % rH)

As can be seen from the values over this past week, Rh has been falling over time so I think the sensor itself is working:

image

@Alex-developer Alex-developer self-assigned this Jan 17, 2025
@Alex-developer Alex-developer added the bug Something isn't working label Jan 17, 2025
@Alex-developer
Copy link
Collaborator Author

I have found the issue with this and will release a fix in the next release. The sensor is 100% ok its one of the internal libraries that calculates the dew point, its only allowing a value between 1 and 100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant