# Issues getting an Adafruit BME280 to init with Raspi Zero, Dietpi node-red-contrib-bme280

**URL:** <https://discourse.nodered.org/t/issues-getting-an-adafruit-bme280-to-init-with-raspi-zero-dietpi-node-red-contrib-bme280/18252>\
**Category:** Hardware\
**Created:** [21 November 2019 22:30 UTC](https://discourse.nodered.org/t/issues-getting-an-adafruit-bme280-to-init-with-raspi-zero-dietpi-node-red-contrib-bme280/18252 "2019-11-21T22:30:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NastySpill](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@NastySpill](https://discourse.nodered.org/u/NastySpill)\
**Post date:** [21 November 2019 22:30 UTC](https://discourse.nodered.org/t/issues-getting-an-adafruit-bme280-to-init-with-raspi-zero-dietpi-node-red-contrib-bme280/18252/1 "2019-11-21T22:30:33Z")

</div>

Hi All,  
I'm a newbie in node red and the linux environment. I am persisting through a few configuration issues to learn this world as its blown me away with the possibilities and level of development.  
After 4 days on and off this is where I am up to..

So.. I am trying to get a BME280 sensor working in Node-Red on Raspi W Zero. But have what appears to be a user permission error in node red debug terminal;

`'Sensor Init failed ->Error: EACCES: permission denied, open '/dev/i2c-1'`

My i2c device appears on bus 1 0x077 when viewed with i2ctools.

`'root@DietPi:~# root@DietPi:~# 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  
root@DietPi:~#'`

But after numerous restarts I still get this error in node red.  
`''Sensor Init failed ->Error: EACCES: permission denied, open '/dev/i2c-1''`

I have read through a few forums that have got me very close but I think my issue is a permission.. The [node-red-contrib-bme280 page](https://www.npmjs.com/package/node-red-contrib-bme280) suggests I look at [i2c bus](https://github.com/fivdi/i2c-bus) page to configure i2c access, but I can't see any information, at least it's not near the surface..  
This is the contents of my rules file;

`sudo nano /lib/udev/rules.d/60-i2c-tools.rules`

` SUBSYSTEM=="i2c-dev", KERNEL=='i2c-0" , GROUP="i2c", MODE='0666" KERNEL=='i2c-[1-9]*" , GROUP="i2c", MODE='0666"`

Is 666 even correct?

Running  
`ls -l /dev/i2c*`

returns

`root@DietPi:~# ls -l /dev/i2c* crw-rw---- 1 root i2c 89, 1 Nov 21 06:00 /dev/i2c-1`

I'm unsure where to look next. Any ideas would be appreciated.

---

<div class="post-metadata">

**Author:** ![DeterminedLife](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/determinedlife/32/56055_2.png) [@DeterminedLife](https://discourse.nodered.org/u/DeterminedLife)\
**Post date:** [8 February 2022 14:28 UTC](https://discourse.nodered.org/t/issues-getting-an-adafruit-bme280-to-init-with-raspi-zero-dietpi-node-red-contrib-bme280/18252/3 "2022-02-08T14:28:12Z")

</div>

Hello, I am looking into adding this sensor to Node Red as well. Were you able to access the sensor from the command line?

---

<div class="post-metadata">

**Author:** ![pompopom](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pompopom/32/55853_2.png) [@pompopom](https://discourse.nodered.org/u/pompopom)\
**Post date:** [8 February 2022 19:37 UTC](https://discourse.nodered.org/t/issues-getting-an-adafruit-bme280-to-init-with-raspi-zero-dietpi-node-red-contrib-bme280/18252/4 "2022-02-08T19:37:40Z")

</div>

You need to first activate i2c on your raspberry  
$ sudo raspi-config  
And activate in the peripherals

Next add the user running the script in the i2c group  
$ usermod -a i2c username
