0

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.
Please be positive and constructive with your questions and comments.

Adafruit IO Environmental Monitor by Brent Rubell

by Tom_Henry on Mon Jul 26, 2021 6:49 pm

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'

>>>
Attachments
environmental_monitor.py
(4.2 KiB) Downloaded 4 times

Tom_Henry
 
Posts: 100
Joined: Wed Aug 26, 2020 8:19 pm

Re: Adafruit IO Environmental Monitor by Brent Rubell

by mikeysklar on Tue Jul 27, 2021 6:41 pm

The line that it is erroring out on looks correct. I do see in our example code we are importing the library differently.

Code: Select all | TOGGLE FULL SIZE
from adafruit_bme280 import basic as adafruit_bme280


https://learn.adafruit.com/adafruit-bme ... 2995300-27

mikeysklar
 
Posts: 5486
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit IO Environmental Monitor by Brent Rubell

by Tom_Henry on Tue Jul 27, 2021 7:31 pm

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

Tom_Henry
 
Posts: 100
Joined: Wed Aug 26, 2020 8:19 pm

Re: Adafruit IO Environmental Monitor by Brent Rubell

by Tom_Henry on Tue Jul 27, 2021 11:24 pm

Here is what my Dashboard looks like coming from Brent Rubell's Adafruit IO Environmental Monitor for Raspberry PI.
Attachments
Environmental Monitor.png
Environmental Monitor.png (190.71 KiB) Viewed 80 times

Tom_Henry
 
Posts: 100
Joined: Wed Aug 26, 2020 8:19 pm

Re: Adafruit IO Environmental Monitor by Brent Rubell

by mikeysklar on Wed Jul 28, 2021 5:22 pm

Thanks for sharing the screenshot that looks great.

mikeysklar
 
Posts: 5486
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.