RecordEvolution / ReswarmOS

A small, customized host operating system for IoT devices meeting the needs of Reswarm
Apache License 2.0
5 stars 0 forks source link

support for RPI Sense HAT #53

Closed DewitteRuben closed 2 years ago

DewitteRuben commented 2 years ago
sense = SenseHat()
File "usr/lib/python3/dist-packages/sense_hat/sense_hat.py", line 39, in init
raise OSError ('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device

According to the minimal research I did, it seems like I2C needs to be enabled. In the boot config we already do dtparam=i2c_arm=on but i'm not sure if that suffices.

What may also be required is the following dev rule for the GPIO pins (not sure)

Create /etc/udev/rules.d/90-gpio.rules with:

KERNEL=="gpiomem", OWNER="root", GROUP="gpio"
Create the group itself and assign it to an existing user "pi":

sudo groupadd -f --system gpio
sudo usermod -a -G gpio pi
mario-fink commented 2 years ago

https://wiki.rocrail.net/doku.php?id=raspi:raspi-sensehat-en https://archlinuxarm.org/forum/viewtopic.php?f=23&t=14544 https://irq5.io/2018/07/24/boot-time-device-tree-overlays-with-u-boot/ https://gist.github.com/geekman/4ab2c074201efd76994a38dab36b23b9

mario-fink commented 2 years ago

https://ubuntu.com/blog/common-sense-using-the-raspberry-pi-sense-hat-on-ubuntu-impish-indri https://mike632t.wordpress.com/2016/03/27/allow-ordinary-users-to-use-the-raspberry-pi-sensehat/

mario-fink commented 2 years ago
# https://pythonhosted.org/sense-hat/
# https://ubuntu.com/blog/common-sense-using-the-raspberry-pi-sense-hat-on-ubuntu-impish-indri
# https://hub.docker.com/r/protik77/python3-sensehat/dockerfile

FROM arm32v7/debian:jessie-slim

RUN apt-get update && apt-get upgrade -y && \
    apt-get install -y \
    curl \
    python3-numpy \
    python3-pil

WORKDIR /tmp

ARG RTIMULIB_VERSION=7.2.1-3

RUN curl -LO https://archive.raspberrypi.org/debian/pool/main/r/rtimulib/librtimulib-dev_${RTIMULIB_VERSION}_armhf.deb \
 && curl -LO https://archive.raspberrypi.org/debian/pool/main/r/rtimulib/librtimulib-utils_${RTIMULIB_VERSION}_armhf.deb \
 && curl -LO https://archive.raspberrypi.org/debian/pool/main/r/rtimulib/librtimulib7_${RTIMULIB_VERSION}_armhf.deb \
 && curl -LO https://archive.raspberrypi.org/debian/pool/main/r/rtimulib/python3-rtimulib_${RTIMULIB_VERSION}_armhf.deb \
 && curl -LO https://archive.raspberrypi.org/debian/pool/main/p/python-sense-hat/python3-sense-hat_2.2.0-1_armhf.deb

RUN dpkg -i \
    librtimulib-dev_${RTIMULIB_VERSION}_armhf.deb \
    librtimulib-utils_${RTIMULIB_VERSION}_armhf.deb \
    librtimulib7_${RTIMULIB_VERSION}_armhf.deb \
    python3-rtimulib_${RTIMULIB_VERSION}_armhf.deb \
    python3-sense-hat_2.2.0-1_armhf.deb

RUN rm -f /tmp/*.deb \
   && apt-get clean \ 
   && rm -rf /var/lib/apt/lists/*