I am working on the Adafruit IO Environmental Monitor for Feather or Raspberry Pi project by Brent Rubell.
I have set up my Raspberry Pi 4 with CircuitPython and have connected the 3 sensors in this project.
I am running the Project Bundle code from that project. I just added one print statement for trouble shooting. See attached.
I am getting an i2C error for the bme280 sensor.
Here is the running code using Thonny.
I don’t know how to fix the Attribute Error.
Tom Henry
>>> %Run environmental_monitor.py
Tom Henry
Traceback (most recent call last):
File "/home/pi/environmental_monitor.py", line 83, in <module>
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
AttributeError: module 'adafruit_bme280' has no attribute 'Adafruit_BME280_I2C'
>>>
Adafruit IO Environmental Monitor by Brent Rubell
Moderators: adafruit_support_bill, adafruit
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
- Tom_Henry
- Posts: 350
- Joined: Wed Aug 26, 2020 8:19 pm
Adafruit IO Environmental Monitor by Brent Rubell
- Attachments
-
- environmental_monitor.py
- (4.2 KiB) Downloaded 6 times
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit IO Environmental Monitor by Brent Rubell
The line that it is erroring out on looks correct. I do see in our example code we are importing the library differently.
https://learn.adafruit.com/adafruit-bme ... 2995300-27
Code: Select all
from adafruit_bme280 import basic as adafruit_bme280
- Tom_Henry
- Posts: 350
- Joined: Wed Aug 26, 2020 8:19 pm
Re: Adafruit IO Environmental Monitor by Brent Rubell
mikeskyler
I changed the import of the bme280 sensor from: import adafruit_bme280
to: from adafruit_bme280 import basic as adafruit_bme280
and that fixed it.
Thank you,
Tom Henry
I changed the import of the bme280 sensor from: import adafruit_bme280
to: from adafruit_bme280 import basic as adafruit_bme280
and that fixed it.
Thank you,
Tom Henry
- Tom_Henry
- Posts: 350
- Joined: Wed Aug 26, 2020 8:19 pm
Re: Adafruit IO Environmental Monitor by Brent Rubell
Here is what my Dashboard looks like coming from Brent Rubell's Adafruit IO Environmental Monitor for Raspberry PI.
- Attachments
-
- Environmental Monitor.png (190.71 KiB) Viewed 156 times
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit IO Environmental Monitor by Brent Rubell
Thanks for sharing the screenshot that looks great.
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.