BME680 / BME280 sensor under RPI3 I²C GPIO with HASSIO

hi all,

I’m trying to figure out on how to add an Bosch Sensortec BME680 using this help page …but it gives me this error under home-assistant log: “BME680 sensor not detected at 0x76
23:16 components/sensor/bme680.py (ERROR)”

but i know that my sensor gots i2c_address: 0x76!
…how can i use the RPI gpio readall command to make sure? does anyone knows a way to list gpio under hassio? thanks for the help

meanwhile ive rebooted hassio and reseted RPI with no changes!

my configuration.yaml entry:

sensor:

  • platform: bme680
    name: BME680 Sensor
    i2c_bus: 1
    i2c_address: 0x76
    monitored_conditions:
    • temperature
    • humidity
    • pressure
    • gas
    • airquality
      oversampling_temperature: 8
      oversampling_humidity: 2
      oversampling_pressure: 4
      filter_size: 3
      gas_heater_temperature: 320
      gas_heater_duration: 150
      aq_burn_in_time: 300
      aq_humidity_baseline: 40
      aq_humidity_bias: 25

Have you tried this? It’s nearly always where it is if it’s not 0x76

i2c_address: 0x77

Also, don’t forget to use the </> in the toolbar above so your code is formatted correctly, otherwise no one can tell if the indenting is causing a problem for you.

i only set i2c_address: 0x76 because my sensor says it haves that specific address! sorry, i should have quoted the .yaml paste
but i think the format is correct, because homeassistant loads but not finds the sensor

sensor:
  - platform: bme680
    name: BME680 Sensor
    i2c_bus: 1
    i2c_address: 0x76
    monitored_conditions:
      - temperature
      - humidity
      - pressure
      - gas
      - airquality
    oversampling_temperature: 8
    oversampling_humidity: 2
    oversampling_pressure: 4
    filter_size: 3
    gas_heater_temperature: 320
    gas_heater_duration: 150
    aq_burn_in_time: 300
    aq_humidity_baseline: 40
    aq_humidity_bias: 25

thats why the “gpio readall” command makes sense

Did you ever get the Bosch sensor working? I’m looking to do something similar.

It may be worth trying another SD card running raspbian in order to run the $ /usr/sbin/i2cdetect -y 1 command

try here: https://github.com/home-assistant/hassos/issues/142#issuecomment-425816257

i did manage to add the i2c device using hassio! but i then opted to use mysensors with the bme680

@fosi thanks so much, I added the values to my config.txt file and added the .conf file also.

After a reboot it detected it straight away, I can now see temps, pressure, etc. :slight_smile:

I have installed “SSH Server” and through “Putty” I access the console “Hass.io” as “root”.
In it appears “core-ssh:~#dir”.
From here, I don’t know how to get to “mv/etc/modules-load/” and add “rpi-i2c.conf”.
Can you help me? Thank you.

@El_Viejo do the following:
cd …
cd /etc/modules-load.d/

from here on i’m struggeling myself. i created the rpi-i2c.conf file at this spot, but it is empty and i don’t know what is supposed to go in there. Apparently one should copy another file here, but i didn’t understand which…

What is: " mv /etc/modules-load.d/* /etc/modules-load.d/rpi-i2c.conf" supposed to do?

Secondly, @brunofosi writes about editing “mnt/boot/config.txt” which doesn’t exist on my system…

I guess, this solution is based around using a so called configuration usb stick, wich i don’t use or know anything about.

To my own problem:

I try to connect a Bosch BME680 to my RaspberryPi 2B running the latest Hass.io OS
I added it to my config.yaml and checked the i2c Address of my Sensor in Raspbian. It is 0x76, wich i noted in my config.yaml It looks like this:

sensor:
  - platform: bme680
    name: BME680 Sensor
    i2c_bus: 1
    i2c_address: 0x76
    monitored_conditions:
      - temperature
      - humidity
      - pressure
      - gas
      - airquality

but my Sensor is not working. In my log file it says:

2019-02-01 02:41:01 ERROR (SyncWorker_7) [homeassistant.components.sensor.bme680] BME680 sensor not detected at 0x76

I don’t know what could possibly be the problem. as far as i understand, this is supposed to be working fine. Thanks in advance for any advice.

Here https://github.com/home-assistant/hassos/issues/142#issuecomment-425816257 a number of changes are proposed here that seem to be working.

Following your instructions, I have managed to modify the file "config.txt".

However, I don’t know everything about “rpi-i2c.conf”, so I asked for help.

In my opinion, there are unresolved problems with Hass.io and these devices. In addition, many different manufacturers use Bosch sensors. It seems certain that those manufactured by Adafruit, always use the address 0x77 and those of other manufacturers the address 0x76.

I’m still waiting for a solution

Hi all!

when you list the directory using this command:

ls /etc/modules-load.d/

you will notice that there is a file named: * so, something is wrong! what i did was renaming that file to: rpi-i2c.conf using the mv command:

mv /etc/modules-load.d/* /etc/modules-load.d/rpi-i2c.conf

try it! if it still doesn’t works! create a usb drive named CONFIG and create a file named: config.txt under this directory: mnt/boot/ with the following contents:

dtparam=i2c1=on dtparam=i2c_arm=on dtoverlay=pi3-disable-bt

I have some bme680! but i think its values are 2º or even 3º higher than what i would expect! don’t know how to calibrate it

Thank you very much for your interest fosi. But, due to my limited knowledge of the Linux environment and my poor level of English, I have not been able to follow your instructions (I am a 78 year old Spaniard).
Extracting the microSD card, I modified the file “config.txt” in my PC, adding the three parameters “dt…”.
I’m running Hass.io (0.86.4).
From my PC, with Putty, I have accessed the Hassio console. The console displays “core-ssh:~#dir”. Here I typed the command ls /etc/modules-load.d/, but nothing happens.
Where should I write the commands?
Thanks again.

Hola! Hope this can help: How to enable I2C on hass.io / resin.io

Thank you very much for your interest.

I have made a first reading of the instructions and I will try to put them into practice.

But I will have to be very careful because it is a complex task and my knowledge of the English language is limited.

Now, I get down to the task and, despite my age (77), I am going to put all my efforts into it.

I have read your step-by-step instructions carefully and several times. To avoid mistakes, I am writing a document in Spanish.

My first question is about the autorized_keys file. Should it contain only the characters of the private_key?

If this is correct, what should I do with the public_key?

Probably more doubts will appear and I will be grateful for the patience and help of the experts of this forum.

I have done with the greatest care the first 5 steps of your guide. In step 6, I run Putty from a second computer (port 22222) and the following message appears: "Network error: Connection refused".( port 22 connects correctly)

My doubts and questions:

1.- In step 3, I copied and saved all the characters of the window using a plain text processor (EditPad Lite) in a file authorized_keys.txt. I saved it in the root directory of a USB drive, formatted with CONFIG.
Is that correct?

2.- In step 5, when you click on the HARDWARE button, the disk section appears the following: /dev/sda and /dev/sda.
Is it correct?

Where are my errors?

Thank you very much for your help.

Hi again,

The generated public key must be copied in a file called authorized_keys (without .txt or any other extension). Then copy the authorized_keys file to your USB flash root directory, after that connect this flash to the USB port of your Raspberry Pi and click Import from USB in your hassio WEB interface.
Once it is done, use your private key to ssh to your hassio’s port 22222.

If you use PuTTY, configuration should looke like this:

If it still doesn’t respond to 22222, then try to restart your hassio. Maybe after restart it will work. Good luck.

It is wonderful that in this forum there are people who dedicate their time to help and who have enough patience to attend the queries of newbies.
Following your instructions, I have corrected my mistakes and I have achieved a clear advance. Now I access the Hass.IO console, as you can see in the image.
My problem is that I don’t know how to navigate through the folders, to modify the config.txt file and add the rpi-i2c.conf file.
I’ve typed ‘help’, I’ve tested some commands, but I haven’t been able to find the solution. I resigned to avoid corrupting the whole system.
Do you still have the patience to keep helping?
In any case, thank you very much.
Captura_01

Nice! Now in this console you need to type the command login as it says in it and press the enter key.
After that change directory with:
cd /mnt/boot
Then follow the steps #8 and #9 from my solution.

Unfortunately, my lack of Linux knowledge keeps me from moving forward. I’ve gone as far as you can see in the picture.
Foro_HA_01
But, from here, I’m not able to modify the config.txt file or add the rpi-i2c.conf file. I typed help again, but I don’t know which commands to use.
Thank you very much for your patience and help.

Ok. Here’s how you do it

Check contents of the config.txt file:

cat /mnt/boot/config.txt

Append config.txt with 2 necessary lines:

echo “dtparam=i2c1=on” >>/mnt/boot/config.txt
echo “dtparam=i2c_arm=on” >>/mnt/boot/config.txt

Create rpi-i2c.conf and add necessary lines:

echo “i2c-dev” >>/etc/modules-load.d/rpi-i2c.conf
echo “i2c-bcm2708” >>/etc/modules-load.d/rpi-i2c.conf

Check again both modified files for changes you made:

cat /mnt/boot/config.txt
cat /etc/modules-load.d/rpi-i2c.conf

Restart your raspberry. After restart i2c should be enabled. Now just configure your sensor properly.