In my case, that’s the solution.
I have connected the BME280 to D3 and D4.
Here is more: https://github.com/arendst/Sonoff-Tasmota/wiki/Wemos-D1-Mini-and-BME280-Temperature,-Humidity-and-Pressure-Sensor
Thanks, will try this and report.
While you are helping, please also advise, how are you connecting Vcc of BME280 - is it to 3.3v or 5v?
I have connected it to 3.3v
Bme280 is different to bmp280, the BME one is often what you’ll pay for but they send you a bmp280.
Try using the bmp280 and bmp180/085 components.
@CountParadox Yes, I had already tried all the permutations combinations of bme, bmp variants. For me the sensor worked briefly as bme280 but never after that. So, I will try with the SDA SCL as D3 D4 instead of D0 D1. Maybe that works for me.
Tried today the BME280 and I’m having the same problem =/ Had the BMP280 and works fine… hope the solution is find, tried SDA and SCL on D3 and D4 and didn’t work…
For those who looking for solution: set oversampling: 1x for all values
I’ve finally managed to get it working. The key thing was GPIO nomenclature - as it is noted here:
“The NodeMCU’s pin numbering as seen on the board (the D0
etc pins) is different from the internal pin numbering.”
I’ve connected to “D1” & “D2”, but stated “1” and “2” in the config which are internal numbering scheme. As soon I’ve changed config to D1 & D2 the whole thing started to work. Also, the system recognized I’m not using BME280 but BMP280 and warned me about it. Still it worked. After I’ve changed the config to BMP280 and commented out the humidity, everything passed without warnings.
Here is the sensor part:
##############################################
# i2c
i2c:
sda: D1
scl: D2
scan: False
id: bus_a
##############################################
# Sensors
sensor:
- platform: bmp280
i2c_id: bus_a
temperature:
name: "BMP280 Temperature"
id: bmp280_temperature
oversampling: 16x
filters:
- offset: -1.6
pressure:
name: "BMP280 Pressure"
id: bmp280_pressure
oversampling: 16x
filters:
- offset: 14.3
address: 0x76
update_interval: 60s
I was also in trouble and I just confirmed that either the Chinese or me was wrong. Configure the BME280 but the Chinese sent BMP280.
went on to work when I switched to BMP280 and removes Humidity.
sensor:
## Sensor Wifi
- platform: wifi_signal
name: "Sinal WiFi"
update_interval: 60s
## Sensor Tensao da Bateria
- platform: adc
pin: GPIO33
name: "Tensão da Bateria"
update_interval: 60s
filters:
- multiply: 1.05
attenuation: 11db
## Sensor Pressao Atmosferica
- platform: bmp280
address: 0x76
update_interval: 60s
temperature:
name: "Temperatura"
oversampling: 16x
pressure:
name: "Pressão"
oversampling: 16x
#humidity:
#name: "Umidade Relativa"
#oversampling: 1x
i2c:
sda: GPIO21
scl: GPIO22
scan: false
id: bus_a
The other day some one in the esphome chat repeatedly failed to read from (in total 3 different) bme280 sensors while esphome was able to detected (scan) the devices on the i2c bus (calling out the right address from the sensor).
Long story short: Shitty cables.
So double/triple check your connection!
Ran into this issue. Not sure what is causing it. I have checked and rechecked the connections, there seems to be nothing wrong there. I have tried all the suggestions posted in this thread, but no cigar so far. Next I will try to change the chip to see if its faulty, and try using Arduino IDE
Working on D1 Mini. I just noticed that it’s (v3.1.0) labeled differently on the front and back.
When following @imbehind’s instructions on the D1 Mini, D1 & D2 labels on one side correspond to 4 and 5 labels on the other side. So you’re using internal pins 4 & 5, which correspond to D1 & D2 on one side, and in yaml.
After copy/pasting from their yml, it still didn’t work for me until I changed it to BME280 instead of BMP280. My sensor is labeled “BME/BMP280”, but only works in E mode.
Working yaml
# i2c
i2c:
sda: D1
scl: D2
scan: False
id: bus_a
sensor:
- platform: bme280
i2c_id: bus_a
temperature:
name: "BMP280 Temperature"
id: bmp280_temperature
oversampling: 16x
filters:
- offset: -1.6
pressure:
name: "BMP280 Pressure"
id: bmp280_pressure
oversampling: 16x
filters:
- offset: 14.3
humidity:
name: "BME280 Humidity"
oversampling: 16x
update_interval: 60s
address: 0x76
For what ever reason my BME stopped working after about 6 months of continuous operation. Original setup was as follows:-
i2c:
sda: D1
scl: D2
scan: True
id: bus_a
So me thinking the BME had failed I purchased another, but still had a problem, also programmed another Wemos D1 mini, but to no avail, whilst it done the initial scan and would find the BME, it would not log any data saying communication failed. How I fixed mine was to go back to the original D1 mini, change the pins to the following:
i2c:
sda: D3
scl: D4
scan: True
id: bus_a
and now everything is working fine again…crazy but it worked for me.
I was having the same issue with failure of the BME280. Reading this thread, I came up with the following. Besides what is prior (redacted) this is my NODEMCU setup and its working. You can change the name prior to temp and pressure to what ever you want.
i2c:
sda: GPIO14
scl: GPIO2
scan: true
sensor:
- platform: bme280
temperature:
name: “BMP280 Temperature”
oversampling: 16x
pressure:
name: “BMP280 Pressure”
address: 0x76
update_interval: 30s
I am also facing similar issue with Wemos mini D1 and BME/BMP280. My configuration includes:
light:
- platform: fastled_clockless
chipset: WS2812B
pin: D4
num_leds: 50
rgb_order: GRB
name: "Office SmartLED"
effects:
- random:
name: "Slow Random Effecr"
transition_length: 30s
update_interval: 30s
- random:
name: "Fast Random Effect"
transition_length: 4s
update_interval: 5s
- strobe:
- flicker:
- addressable_rainbow:
i2c:
sda: D2
scl: D1
scan: True
sensor:
- platform: bme280
temperature:
name: "BME280 Temperature"
oversampling: 16x
pressure:
name: "BME280 Pressure"
humidity:
name: "BME280 Humidity"
address: 0x76
update_interval: 60s
Any suggestio? Error log is showing below communication error for BME 280:
NFO Successfully connected to 192.168.0.235
[17:57:46][I][app:100]: ESPHome version 1.14.5 compiled on Aug 3 2020, 17:56:54
[17:57:46][C][wifi:415]: WiFi:
[17:57:46][C][wifi:283]: SSID: [redacted]
[17:57:46][C][wifi:284]: IP Address: 192.168.0.235
[17:57:46][C][wifi:286]: BSSID: [redacted]
[17:57:46][C][wifi:287]: Hostname: 'office_smart_led'
[17:57:46][C][wifi:291]: Signal strength: -44 dB ▂▄▆█
[17:57:46][C][wifi:295]: Channel: 1
[17:57:46][C][wifi:296]: Subnet: 255.255.255.0
[17:57:46][C][wifi:297]: Gateway: 192.168.0.1
[17:57:46][C][wifi:298]: DNS1: (IP unset)
[17:57:46][C][wifi:299]: DNS2: (IP unset)
[17:57:46][C][i2c:028]: I2C Bus:
[17:57:46][C][i2c:029]: SDA Pin: GPIO4
[17:57:46][C][i2c:030]: SCL Pin: GPIO5
[17:57:46][C][i2c:031]: Frequency: 50000 Hz
[17:57:46][I][i2c:033]: Scanning i2c bus for active devices...
[17:57:46][I][i2c:049]: Found no i2c devices!
[17:57:46][D][api.connection:583]: Client 'Home Assistant 0.112.4 (192.168.0.214)' connected successfully!
[17:57:46][C][fastled:019]: FastLED light:
[17:57:46][C][fastled:020]: Num LEDs: 50
[17:57:46][C][fastled:021]: Max refresh rate: 400
[17:57:46][D][api.connection:583]: Client 'Home Assistant 0.112.4 (192.168.0.202)' connected successfully!
[17:57:46][C][logger:175]: Logger:
[17:57:46][C][logger:176]: Level: DEBUG
[17:57:46][C][logger:177]: Log Baud Rate: 115200
[17:57:46][C][logger:178]: Hardware UART: UART0
[17:57:46][C][light:177]: Light 'Office SmartLED'
[17:57:46][C][light:179]: Default Transition Length: 1.0s
[17:57:46][C][light:180]: Gamma Correct: 2.80
[17:57:46][C][bme280.sensor:142]: BME280:
[17:57:46][C][bme280.sensor:143]: Address: 0x76
[17:57:46][E][bme280.sensor:146]: Communication with BME280 failed!
[17:57:46][C][bme280.sensor:155]: IIR Filter: OFF
[17:57:46][C][bme280.sensor:156]: Update Interval: 60.0s
[17:57:46][C][bme280.sensor:158]: Temperature 'BME280 Temperature'
[17:57:46][C][bme280.sensor:158]: Unit of Measurement: '°C'
[17:57:46][C][bme280.sensor:158]: Accuracy Decimals: 1
[17:57:46][C][bme280.sensor:158]: Icon: 'mdi:thermometer'
[17:57:46][C][bme280.sensor:159]: Oversampling: 16x
[17:57:46][C][bme280.sensor:160]: Pressure 'BME280 Pressure'
[17:57:46][C][bme280.sensor:160]: Unit of Measurement: 'hPa'
[17:57:46][C][bme280.sensor:160]: Accuracy Decimals: 1
[17:57:46][C][bme280.sensor:160]: Icon: 'mdi:gauge'
[17:57:46][C][bme280.sensor:161]: Oversampling: 16x
[17:57:46][C][bme280.sensor:162]: Humidity 'BME280 Humidity'
[17:57:46][C][bme280.sensor:162]: Unit of Measurement: '%'
[17:57:46][C][bme280.sensor:162]: Accuracy Decimals: 1
[17:57:46][C][bme280.sensor:162]: Icon: 'mdi:water-percent'
[17:57:46][C][bme280.sensor:163]: Oversampling: 16x
[17:57:46][C][captive_portal:169]: Captive Portal:
[17:57:47][C][ota:029]: Over-The-Air Updates:
[17:57:47][C][ota:030]: Address: 192.168.0.235:8266
[17:57:47][C][ota:032]: Using Password.
[17:57:47][C][api:095]: API Server:
[17:57:47][C][api:096]: Address: 192.168.0.235:6053
[17:59:37][I][ota:046]: Boot seems successful, resetting boot loop counter.
I ran into this issue because I have the BME280 on a 1.5M shielded cable.
Even with short cables, it’s very important to have a pull up resistor on the SDL and SCL to VCC of the sensor (+3.3v in my case). I though the internal pull up would be used, but it was clearly not or not enough.
I ended up reading on the attenuation and capacitance that can affect the way the I2C protocol works depending on cable length and shielding. Basically, and anyone more knowledgeable correct me please, I came to conclusion that 4.7K to 10K pull up resistor was needed. The longer the wire, the closer I got to 4.7K for the pull value.
Also, I made the mistake of connecting the shield to earth ground and introducing enough noise that I2C buss failed to work.
Thank you for your quick reply. The module that I got is " GY-BME280-5V Sensor SPI Humidity Temperature Barometric Pressure Sensor Module". The Vcc range is 1.8-5.0V but I used 3.3V to connect from Mini D1.
I can try two things:
- I can raise the voltage to 5V
- I can connect pull up resistors as you mentioned.
Let me try. Thanks again.
I just bought that same unit and I’m running it at 3.3v without problem.