samourai47
Posts: 2
Joined: Wed Dec 05, 2018 8:16 am

bme280 on i2c problem

Wed Dec 05, 2018 9:15 am

Hello everybody. I m a newbie and i have a big problem....
I install domoticz on my raspi 2b with a relay card gpio and a temperture sensor on 1wire. Ok for that
I want to install a bme280 a i have many problem. https://www.amazon.fr/gp/product/B01GQ3 ... UTF8&psc=1
It's not recognise in domoticz and i think perhaps not in raspberry in fist.
I found some command line on the net . Here the results. What i have forgoten?

I also install python-smbus

pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

In /etc/modules i have

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev
i2c-bcm2835
i2c-bcm2708

pi@raspberrypi:~ $ lsmod | grep i2c_
i2c_bcm2708 16384 0
i2c_bcm2835 16384 0
i2c_dev 16384 0

pi@raspberrypi:~ $ dmesg|grep i2c
[ 4.034352] i2c /dev entries driver

pi@raspberrypi:~ $ ls /dev/i2c*
/dev/i2c-1

pi@raspberrypi:~ $ ls /dev/i2c-1
ls: impossible d'accéder à '/dev/i2c-': No files or directory

I don't understand and i don't now what to do...
Can you help me... Thank's

rhubarbdog
Posts: 64
Joined: Mon Dec 11, 2017 9:58 pm

Re: bme280 on i2c problem

Sat Dec 08, 2018 1:31 am

if you want 1 wire then it's dht11 or similar
Your BME280 is being detected at i2c address 0x77
There should be code for this sensor but *ONLY* use code that has a BOSCH license.
BOSCH are totally on top over license for BME280/BMP280 and there is no way anyone could develop a CLASS driver for these devices without reading their copyright code.
Try my code on https://github.com/rhubarbdog/bme280 @ GitHub

This gives a reduced python example for sampling the weather every 2 seconds which is quite often enough

rhubarbdog
Posts: 64
Joined: Mon Dec 11, 2017 9:58 pm

Re: bme280 on i2c problem

Sat Dec 08, 2018 1:41 am

if it has to be 1 wire the AM2320 has a larger range than the dht11(0-50C)
https://github.com/rhubarbdog/AM2320_1wire @ GithHub

User avatar
bensimmo
Posts: 3970
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: bme280 on i2c problem

Sat Dec 08, 2018 11:27 am

It is seeing it, it's showing on 0x77 which is the default address for most of these.
It might be best to ask the domoticz people as they know what they are using.
It says it has support
forum search https://www.domoticz.com/forum/search.p ... rds=BME280

If you can put a normal Raspbian OS card in for testing, you can see if it is the device (but double check you have good wire connections)
(another python module you can use here https://github.com/rm-hull/bme280 or https://github.com/adafruit/Adafruit_Python_BME280 )

rhubarbdog
Posts: 64
Joined: Mon Dec 11, 2017 9:58 pm

Re: bme280 on i2c problem

Sat Dec 08, 2018 11:32 am

Down load my driver class from github and just run it. You will need to specify an address as i think my sensor is on the other default address 0x76

Return to “Interfacing (DSI, CSI, I2C, etc.)”