# BalenaSense sensor is not working

**URL:** <https://forums.balena.io/t/balenasense-sensor-is-not-working/94127>\
**Category:** Product support\
**Created:** [April 15, 2020, 3:08pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127 "2020-04-15T15:08:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drarox](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Drarox](https://forums.balena.io/u/Drarox)\
**Post date:** [April 15, 2020, 3:08pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/1 "2020-04-15T15:08:27Z")

</div>

Hi, I just installed BalenaSense on my pi and I’m getting this error with sensor :

15.04.20 16:03:30 (+0200) ----------------------------------------  
15.04.20 16:03:31 (+0200) user\_i2c\_write: Remote I/O error  
15.04.20 16:03:33 (+0200) Capture thread exited; restarting  
15.04.20 16:03:38 (+0200) user\_i2c\_write: Remote I/O error  
15.04.20 16:03:40 (+0200) 172.17.0.6 - - [15/Apr/2020 14:03:40] “GET / HTTP/1.1” 200 -  
15.04.20 16:03:40 (+0200) ----------------------------------------  
15.04.20 16:03:40 (+0200) Exception happened during processing of request from (‘172.17.0.6’, 44406)  
15.04.20 16:03:40 (+0200) Traceback (most recent call last):  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/socketserver.py”, line 313, in \_handle\_request\_noblock  
15.04.20 16:03:40 (+0200) self.process\_request(request, client\_address)  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/socketserver.py”, line 341, in process\_request  
15.04.20 16:03:40 (+0200) self.finish\_request(request, client\_address)  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/socketserver.py”, line 354, in finish\_request  
15.04.20 16:03:40 (+0200) self.RequestHandlerClass(request, client\_address, self)  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/socketserver.py”, line 681, in **init**  
15.04.20 16:03:40 (+0200) self.handle()  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/http/server.py”, line 422, in handle  
15.04.20 16:03:40 (+0200) self.handle\_one\_request()  
15.04.20 16:03:40 (+0200) File “/usr/local/lib/python3.5/http/server.py”, line 410, in handle\_one\_request  
15.04.20 16:03:40 (+0200) method()  
15.04.20 16:03:40 (+0200) File “/usr/src/app/scripts/sensor.py”, line 123, in do\_GET  
15.04.20 16:03:40 (+0200) measurements = balenasense.sample()  
15.04.20 16:03:40 (+0200) File “/usr/src/app/scripts/sensor.py”, line 95, in sample  
15.04.20 16:03:40 (+0200) return self.apply\_offsets(self.sensor.get\_readings(self.sensor))  
15.04.20 16:03:40 (+0200) File “/usr/src/app/scripts/bme680.py”, line 45, in get\_readings  
15.04.20 16:03:40 (+0200) ‘temperature’: float(self.data[‘temperature’]),  
15.04.20 16:03:40 (+0200) TypeError: ‘NoneType’ object is not subscriptable

How can I fix it please?

---

<div class="post-metadata">

**Author:** ![JSReds](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jsreds/32/2929_2.png) [@JSReds](https://forums.balena.io/u/JSReds)\
**Post date:** [April 15, 2020, 3:22pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/2 "2020-04-15T15:22:26Z")

</div>

Hi there,  
could you give us more information about the hardware used ?

---

<div class="post-metadata">

**Author:** ![Drarox](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Drarox](https://forums.balena.io/u/Drarox)\
**Post date:** [April 15, 2020, 4:34pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/5 "2020-04-15T16:34:52Z")

</div>

Hi,  
I’m using a Raspberry pi 4 and a BME680 sensor.  
The sensor is working when I get the data via the pythom3 bme680 library.  
Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![jimsynz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jimsynz/32/4663_2.png) [@jimsynz](https://forums.balena.io/u/jimsynz)\
**Post date:** [April 15, 2020, 8:40pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/6 "2020-04-15T20:40:34Z")

</div>

Hi there.

I have a couple of follow up questions:

1. Is the `i2c_arm=on` DT parameter set in the device or fleet configuration? (this is the default so I would expect so).
2. Did you modify the project at all before deploying it?
3. When you say that you can access the BME680 via the python3 library - are you using Raspbian or a balenaOS container?

Thanks,  
James.

---

<div class="post-metadata">

**Author:** ![Drarox](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Drarox](https://forums.balena.io/u/Drarox)\
**Post date:** [April 16, 2020, 8:27am UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/8 "2020-04-16T08:27:56Z")

</div>

Hi

I didn’t modify the project at all, so `i2c_arm=on` is set, I didn’t touched anything.  
I used raspbian to read the data with the python3 Adafruit BME680 Library.

Thanks for the help 🙂

---

<div class="post-metadata">

**Author:** ![roman-mazur](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/roman-mazur/32/2194_2.png) [@roman-mazur](https://forums.balena.io/u/roman-mazur)\
**Post date:** [April 16, 2020, 9:48am UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/9 "2020-04-16T09:48:16Z")

</div>

Hi,  
From the logs you presented the following line points to problems in communication between the app and the sensor hardware over I2C:

```auto
user_i2c_write: Remote I/O error

```

This is the reason why James asked about `i2c_arm` setting. It’s not a parameter that is set by the application, but rather a part of the device configuration. So we suggest you double-check if it’s actually set (going to the device configuration page and looking at “DT parameters” in the table there).

If it’s set, I would also suggest checking a similar issue open on github earlier:

> <https://github.com/balenalabs/balena-sense/issues/33>
>
> Hi all,
> Has anyone has found this problem with sensor reading?
> user\_i2c\_write: Remote I/O error
> It starts to happen randomly after some time with...

  
In that case, it was a hardware problem (physical connection to the sensor).

Keep us posted, thanks!

---

<div class="post-metadata">

**Author:** ![Drarox](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Drarox](https://forums.balena.io/u/Drarox)\
**Post date:** [April 16, 2020, 1:06pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/11 "2020-04-16T13:06:03Z")

</div>

Hi,

DT parameters are set to ![image](https://global.discourse-cdn.com/balena/original/2X/b/b03b5885f44985c5afe6012fd1f1e2851e1b4cc7.png)

I tried the solution from the issue on github but nothing changed, I don’t think that it’s a hardware problem because the sensor is working on raspbian as I said.

Thank you

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [April 16, 2020, 3:14pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/12 "2020-04-16T15:14:34Z")

</div>

Hi there, there is a discussion [here](https://github.com/fivdi/i2c-bus/issues/36#issuecomment-332285312) around this being a potentially a hardware bug related to clock stretching. If the error is intermittent, it may be worth investigating this venue further, potentially switching to software [mode](https://github.com/fivdi/i2c-bus/blob/master/doc/raspberry-pi-software-i2c.md). Also, if the error is intermittent, it may be worth putting in some retry logic in the code.

---

<div class="post-metadata">

**Author:** ![salemanager](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@salemanager](https://forums.balena.io/u/salemanager)\
**Post date:** [April 30, 2020, 2:11pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/14 "2020-04-30T14:11:20Z")

</div>

Hi Guys,

Any news or solution with this issue ? I have the same error with Balena Sense.

I’am using B3+ with Environmental Sensor (Qwiic) - BME680 (sparkfun) and i’am getting the same errors. Identical!

Tks,  
Sami

---

<div class="post-metadata">

**Author:** ![salemanager](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@salemanager](https://forums.balena.io/u/salemanager)\
**Post date:** [April 30, 2020, 3:50pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/15 "2020-04-30T15:50:36Z")

</div>

So, the solution was downgrading from Balena Sense v1.9.2 to v1.8.3.  
After downgrading the sensor started to work

hope this solution will help others and the developers to find what is wrong with the new version

Tks,  
Sami

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [April 30, 2020, 6:39pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/16 "2020-04-30T18:39:42Z")

</div>

Thanks for the update on this one Sami, glad to hear it’s working for you.

---

<div class="post-metadata">

**Author:** ![Drarox](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Drarox](https://forums.balena.io/u/Drarox)\
**Post date:** [May 1, 2020, 8:31am UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/18 "2020-05-01T08:31:57Z")

</div>

I can confirm, it’s working on Balena Sense v1.8.3. Thank you!

---

<div class="post-metadata">

**Author:** ![mdcraver](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mdcraver](https://forums.balena.io/u/mdcraver)\
**Post date:** [August 28, 2020, 2:03pm UTC](https://forums.balena.io/t/balenasense-sensor-is-not-working/94127/19 "2020-08-28T14:03:55Z")

</div>

I am experiencing the same problem with v1.9.7.

```
28.08.20 09:50:36 (-0400) sensor ================ Starting Balena Sense ================
28.08.20 09:50:37 (-0400) sensor Enviro Plus hat not found
28.08.20 09:50:37 (-0400) sensor BME680 not found on 0x76, trying 0x77
28.08.20 09:50:37 (-0400) sensor BME680 found on 0x77
28.08.20 09:50:37 (-0400) sensor user_i2c_write: Remote I/O error
28.08.20 09:50:37 (-0400) sensor Sensor HTTP server running
28.08.20 09:50:39 (-0400) sensor Capture thread exited; restarting

```

I am using a Raspberry Pi 3 B+ and the [Environclick BME680 board](https://www.mikroe.com/environment-click)

I tried the solution in **user\_i2c\_write: Remote I/O error #33** to no affect.

However, downgrading to v1.8.3 worked.
