# Belena Cloud + Balena sense + RPi3 is Sense Hat Supported?

**URL:** <https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891>\
**Category:** Product support\
**Created:** [January 12, 2022, 7:13am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891 "2022-01-12T07:13:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 12, 2022, 7:13am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/1 "2022-01-12T07:13:50Z")

</div>

Followed instructions on [balenaSense v2: Updated temperature, pressure, and humidity monitoring for Raspberry Pi](https://www.balena.io/blog/balenasense-v2-updated-temperature-pressure-and-humidity-monitoring-for-raspberry-pi/#home-assistant)

I have RPi3 sense hat [https://www.raspberrypi.com/products/sense-hat/](https://www.raspberrypi.com/products/sense-hat/)

From the logs to me the Sense hat it is not supported?

sensor OKStarting mqtt client, publishing to mqtt:1883  
sensor Using MQTT publish interval: 8.0 sec(s)  
sensor Initializing sensors…  
sensor ======== Searching i2c bus for devices… ========  
sensor Found device at 0x1c  
sensor Found (busy) device at 0x46  
sensor Found device at 0x5c  
sensor Found device at 0x5f  
sensor Found device at 0x6a  
sensor ======== Removing existing devices from the i2c bus… ========  
sensor Deleting device found at 0x1c.  
sensor sh: 1: echo: echo: I/O error  
sensor Delete device 0x1c exit code: 256  
sensor Deleting device found at 0x46.  
sensor sh: 1: echo: echo: I/O error  
sensor Delete device 0x46 exit code: 256  
sensor Deleting device found at 0x5c.  
sensor sh: 1: echo: echo: I/O error  
sensor Delete device 0x5c exit code: 256  
sensor Deleting device found at 0x5f.  
sensor sh: 1: echo: echo: I/O error  
sensor Delete device 0x5f exit code: 256  
sensor Deleting device found at 0x6a.  
sensor sh: 1: echo: echo: I/O error  
sensor Delete device 0x6a exit code: 256  
sensor ======== Unloading any existing modules… ========  
sensor Device at 0x1c not in known supported drivers.  
sensor Device at 0x46 not in known supported drivers.  
sensor Device at 0x5c not in known supported drivers.  
sensor Device at 0x5f not in known supported drivers.  
sensor New active: [106]  
sensor ======== Loading devices found… ========  
sensor Loading device mcp3422 on address 0x6a.  
sensor sh: 1: echo: echo: I/O error  
sensor New device 0x6a exit code: 256  
sensor Loaded 1 of 5 device(s) found  
sensor initializing reading  
sensor IIO context created: local  
sensor Backend version: 0.16 (git tag: v0.16)  
sensor Backend description string: Linux 07a08cd5b068 5.10.31-v7 #1 SMP Fri Apr 23 15:16:49 UTC 2021 armv7l  
sensor IIO context has 1 attributes:  
sensor local,kernel: 5.10.31-v7  
sensor IIO context has 0 devices:

Plus when I open Grafana there is no dashboards?  
dashboard Interim dashboard sync skipped: No schema found.

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 12, 2022, 8:54am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/2 "2022-01-12T08:54:09Z")

</div>

Hi,

I am not sure whether the project you are referring to supports the Sense Hat. It would not surprise me if not, since it took a bit of fiddling to get it to work (at least for me). Here is a project I am using to interact with the Sense Hat - [GitHub - hferentschik/balena-sense: balenaCloud project with Raspberry Pi 4 and Sense Hat](https://github.com/hferentschik/balena-sense). I use it mainly to display messages on the display which I post via a REST API. However, the temperature sensor is wired up as well.

The tricky bit was to prepare the container to be able to install the sense-hat Python library to interact with the Sense Hat. See [balena-sense/Dockerfile at master · hferentschik/balena-sense · GitHub](https://github.com/hferentschik/balena-sense/blob/master/sensor/Dockerfile).

Hope that helps,  
Hardy

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 12, 2022, 2:03pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/3 "2022-01-12T14:03:32Z")

</div>

@hardy I was checking the project that I am using, base on the blog it is not supported. So will try to use your project and I let you know how it goes.

Thanks for the response  
Oscar

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 12, 2022, 6:22pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/4 "2022-01-12T18:22:51Z")

</div>

Great. Fingers crossed it works without too much hassle. Happy to help if you run into any problems.

–Hardy

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [January 13, 2022, 11:22am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/5 "2022-01-13T11:22:30Z")

</div>

@hardy nice work and thanks for sharing! We dropped sense hat support in version 2 of our project because it was holding us back from an approach we wanted to take to support many other sensors so that’s awesome to see you’ve supported it again. I’ll be sure to direct anyone else looking for this to your project 👍

Have you considered listing the project on [balenaHub](https://hub.balena.io)?

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 13, 2022, 12:17pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/7 "2022-01-13T12:17:34Z")

</div>

Hi,

> nice work and thanks for sharing!

Thanks

> We dropped sense hat support in version 2 of our project because it was holding us back from an approach we wanted to take to support many other sensors so that’s awesome to see you’ve supported it again.

I fully understand and would have done the same. It was really fiddly to get working and the only way it worked for me was to use the sense-hat Python library. The API of sense-hat is actually really good, the rub is that the library is terribly out of date (last commit from 2017) and I am forced to compile some needed dependencies as part of the Docker build. Unfortunately, the compilation is really slow. But it works 🙂 !

Ideally, someone would bring [python-sense-hat](https://github.com/astro-pi/python-sense-hat) up to date. The Sense HAT is really a great board to experiment with your Pi.

In the meantime, I might push some pre-compiled base images for Raspberry Pi 3 + 4.

> I’ll be sure to direct anyone else looking for this to your project 👍

Please do

> Have you considered listing the project on [balenaHub](https://hub.balena.io/)?

I have it on my to-do list. I’ll post it here when I get around to doing it.

–Hardy

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 15, 2022, 7:23am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/8 "2022-01-15T07:23:30Z")

</div>

Hi, It did not work 🤔. Here is what i did.

- forked your project and apply the `balena push`

- After some time I got the services running  

- I notice error logs I collect some, at this point no even Grafana is running  
[sensehat-RP3.log](https://forums.balena.io/uploads/short-url/2mIoB6TALXtuWm72snQVoTZpo3s.log) (121.6 KB)

most of the services throwing this error  
`standard_init_linux.go:211: exec user process caused "exec format error"`

I also tested a simple python project trying to find something wrong with my settings but it works, just thinking if I need use another Balena OS version?

here the main screen if it helps

 ![Screenshot 2022-01-15 at 9.18.11](https://global.discourse-cdn.com/balena/original/2X/7/7439db3f46d2f0625b3dc2f76caf956826defe73.png)

The RPi is connected using WiFi

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 15, 2022, 9:46am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/9 "2022-01-15T09:46:21Z")

</div>

Which device type / OS version do you use? The project is using 64bit arm since I am running on a Raspberry Pi 4. I think it works for Raspberry Pi 3 as well, but you will make sure that you use/flash the "Raspberry Pi 3 (using 64bit OS) image.

If you want to use the Raspberry Pi 3 with 32 bits, you will need to go through the Dockerfiles and update the images to use the right (32bit) versions of the various containers.

I have an [open issue](https://github.com/hferentschik/balena-sense-hat/issues/1) to enhance the project to support multiple OS types. Balena has support for it, but so far I always just build for the OS type I am actually using.

Hope this helps.

–Hardy

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 15, 2022, 9:48am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/10 "2022-01-15T09:48:49Z")

</div>

To be more concrete. These are the base images I mean (from the Dockerfiles):

`FROM balenalib/raspberrypi4-64:buster`

and for a Raspberry Pi 3 (32 bit) it should probably be:

`FROM balenalib/raspberrypi3:buster`

–Hardy

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 15, 2022, 9:54am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/11 "2022-01-15T09:54:17Z")

</div>

Hi,

@chrisys, fyi I added sense-hat to Balena Hub - [balena-sense-hat](https://hub.balena.io/hardy_ferentschik_balena/sense-hat).

–Hardy

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 15, 2022, 3:09pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/12 "2022-01-15T15:09:23Z")

</div>

Did more tests with no luck. The last test I switched to OS 64 plus docker files changes to use raspberrypi3-64. Attached the logs from the last test.

Error in sensor service:  
 Traceback (most recent call last):  
 File “measure.py”, line 2, in   
 from sense\_hat import SenseHat  
 File “/usr/local/lib/python3.7/dist-packages/sense\_hat/ **init**.py”, line 2, in   
 from .sense\_hat import SenseHat, SenseHat as AstroPi  
 File “/usr/local/lib/python3.7/dist-packages/sense\_hat/sense\_hat.py”, line 7, in   
 import numpy as np  
 File “/usr/local/lib/python3.7/dist-packages/numpy/ **init**.py”, line 150, in   
 from . import core  
 File “/usr/local/lib/python3.7/dist-packages/numpy/core/ **init**.py”, line 48, in   
 raise ImportError(msg)  
 ImportError:

Error in messenger:  
 Error: While importing ‘messenger’, an ImportError was raised.

[balena-sense\_blue-dinner-15.01.22\_16\_56\_43\_(+0200).txt](https://forums.balena.io/uploads/short-url/yAFR8P6cqR9iSp7R4XcYMkEgQ8L.txt) (71.7 KB)

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 15, 2022, 4:45pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/13 "2022-01-15T16:45:22Z")

</div>

Are the other containers up now? Is it just the messenger throwing errors? Was there an error in the Docker build for the messenger container?  
You could also try to use the messenger Dockerfile as is without changing to ‘raspberrypi3-64’. I think that might work.  
I will need to find an Raspberry Pi 3 to test this myself. ATM, I am using a Raspberry Pi 4.

–Hardy

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 15, 2022, 6:50pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/14 "2022-01-15T18:50:21Z")

</div>

Yes you are right the docker build was not right. I try again with these images.

 ![Screenshot 2022-01-15 at 20.44.33](https://global.discourse-cdn.com/balena/original/2X/7/73a30cc5159fae53acb0db9f6e337d081757ee92.png)

all containers are running now

 ![Screenshot 2022-01-15 at 20.43.48](https://global.discourse-cdn.com/balena/original/2X/2/2aade5d2ab43392409b3b894bb91ff86cad08dfd.png)

still errors in sensor  
[balena-sense\_blue-dinner-15.01.22\_20\_47\_05\_(+0200).txt](https://forums.balena.io/uploads/short-url/cS9CL2iUIP83jWPtS20yTdn1SCz.txt) (67.1 KB)

I give up for today, maybe you can try with RPi3 and I can also check if a friend can borrow a Pi4

- Oscar, Thanks for the help

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 15, 2022, 7:22pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/15 "2022-01-15T19:22:38Z")

</div>

I’d use ‘balenalib/raspberrypi4-64:buster’ for the sensor as well. With the switch to the ‘Raspberry Pi 3 (64 bit)’ OS you should be able to use the Dockerfiles as they are.

There might be a slight difference in the base libraries between ‘balenalib/raspberrypi3-64:buster’ and ‘balenalib/raspberrypi4-64:buster’.

It seems otherwise you are getting there.

You can also delete the whole ‘cron’ directory and its reference in ‘docker-compose.yml’. This container was just an experiment of mine to work around some Wifi connectivity issues I had. I removed this service from my repo as well. I think eventually I will create a Balena Block for it.

–Hardy

---

<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:** [January 19, 2022, 1:05am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/16 "2022-01-19T01:05:34Z")

</div>

Nice work @hardy!

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [January 21, 2022, 8:54pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/18 "2022-01-21T20:54:41Z")

</div>

Hi,

so I tried with a Raspberry Pi 3, and you can leave all the images as they are. The only pre-condition is that your flash the Raspberry Pi 3 64 bit OS. Then the setup works for both Pi 3 +4.

At least for me 😉

–Hardy

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [January 24, 2022, 7:38pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/19 "2022-01-24T19:38:18Z")

</div>

😢 did not work for me

I am using Raspberry Pi 3 (using 64bit OS)  
[balena-sense\_blue-dinner-24.01.22\_21\_36\_42\_(+0200).txt](https://forums.balena.io/uploads/short-url/2uWHFvay5qLYGJg5Q4FXQdDJaOS.txt) (89.1 KB)

---

<div class="post-metadata">

**Author:** ![hardy](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hardy/32/7276_2.png) [@hardy](https://forums.balena.io/u/hardy)\
**Post date:** [March 29, 2022, 10:30am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/20 "2022-03-29T10:30:58Z")

</div>

How odd. Did you make any progress afterwards or have you given up?

---

<div class="post-metadata">

**Author:** ![recio](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/recio/32/7275_2.png) [@recio](https://forums.balena.io/u/recio)\
**Post date:** [April 1, 2022, 8:58am UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/21 "2022-04-01T08:58:44Z")

</div>

I do not have another device to test, still same result

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [April 1, 2022, 8:33pm UTC](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891/22 "2022-04-01T20:33:12Z")

</div>

Just as an observation and from experience trying to get these older libraries to work, what I’d consider trying is using the `raspberrypi3` device type for all the containers. These will run fine on both Pi3 64-bit and Pi 4 64-bit as well as working on Pi 3 32-bit. I’ve had better luck in the past running older software within 32 bit containers even if it’s on a 64-bit device.

[Next page](https://forums.balena.io/t/belena-cloud-balena-sense-rpi3-is-sense-hat-supported/350891.md?page=2)
