changeset 21:1ae7bd2566ef

Add a sleep immediately after opening the i2c bus.
author Paul Fisher <paul@pfish.zone>
date Sat, 29 Jul 2023 20:33:41 -0400
parents 92367b644e29
children 36ab505bc0a6
files weatherlog/reader.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/weatherlog/reader.py	Sat Dec 25 00:02:03 2021 +0000
+++ b/weatherlog/reader.py	Sat Jul 29 20:33:41 2023 -0400
@@ -27,6 +27,9 @@
 
     def __init__(self, bus_id: int = 1, address: int = 0x77):
         self.bus = smbus2.SMBus(bus_id)
+        # Maybe this will prevent some hangs?
+        # I saw it somewhere but don't remember where...
+        time.sleep(1)
         self.address = address
         self.calibration = bme280.load_calibration_params(self.bus, address)