David-Enst / WeeWX-BCRobotics

A WeeWX driver for the BC Robotics and SparkFun weather station Raspberry Pi based hardware.
1 stars 1 forks source link

Issue with BME280 sensor "Adafruit_BME280_Example.py", line 5, in <module> #2

Closed gunnarh79 closed 4 years ago

gunnarh79 commented 4 years ago

HIHI I did buy board from BCRobotics and was going to use that with Weewx but get error when i try to run Adafruit_BME280_Example.py

pi@raspberrypi:~/Adafruit_Python_BME280 $ sudo python Adafruit_BME280_Example.py Traceback (most recent call last): File "Adafruit_BME280_Example.py", line 5, in degrees = sensor.read_temperature() File "/home/pi/Adafruit_Python_BME280/Adafruit_BME280.py", line 215, in read_temperature UT = float(self.read_raw_temp()) File "/home/pi/Adafruit_Python_BME280/Adafruit_BME280.py", line 194, in read_raw_temp self.BME280Data = self._device.readList(BME280_REGISTER_DATA, 8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 255, in read_i2c_block_data TypeError: one character string expected

I have Raspberry2 and use raspian.

David-Enst commented 4 years ago

Ran into this too ... it is a Python V2 vs. Python V3 issue. Make sure your using Python V2. A Python V3 driver coming soon.