Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sense Hat V2: Colour sensor not detected on raspberry Pi 5 #143

Open
ZGMFX20AR opened this issue Feb 23, 2024 · 6 comments
Open

Sense Hat V2: Colour sensor not detected on raspberry Pi 5 #143

ZGMFX20AR opened this issue Feb 23, 2024 · 6 comments

Comments

@ZGMFX20AR
Copy link

Hello, I'm experiencing an issue with the Sense HAT v2 on the Raspberry Pi 5.

When executing the i2cdetect -y 1 command on the Pi 5, it successfully detects all sensors except for the color sensor.

Conversely, on the Pi 4, the command detects all sensors including the color sensor, which has an I2C address of 0x29.

@ZGMFX20AR ZGMFX20AR changed the title Colour sensor not detected on raspberry Pi 5 Sense Hat V2: Colour sensor not detected on raspberry Pi 5 Feb 23, 2024
@XECDesign
Copy link
Contributor

Are you using the same Sense HAT in both cases? I think newer Sense HATs have the colour sensor on 0x39. Tested on a pi5 here and the output was as expected.

@yupm
Copy link

yupm commented May 2, 2024

I think the library or package (for ubuntu?) might not be updated in this case.

from sense_hat import SenseHat
from time import sleep

sense = SenseHat()
sense.color.gain = 60
sense.color.integration_cycles = 64

while True:
    sleep(2 * sense.colour.integration_time)
    red, green, blue, clear = sense.colour.colour # readings scaled to 0-256
    print(f"R: {red}, G: {green}, B: {blue}, C: {clear}")

Error:

Traceback (most recent call last):
  File "/home/piuser/csense.py", line 5, in <module>
    sense.color.gain = 60
    ^^^^^^^^^^^
AttributeError: 'SenseHat' object has no attribute 'color'

Tested on Ubuntu 24.04

@bsimmo
Copy link

bsimmo commented May 3, 2024

Spell it correctly and it should work?

colour

You have it correct later.

@yupm
Copy link

yupm commented May 5, 2024

Erm... the official documentation is using color though
https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat/7
image

Anyway I managed to fix it by just using Rasbian as the default OS.
After setting up Ubuntu via docker and fooling around with building this repo and the RTIMU repo from source, I am thinking the Ubuntu 24.04 issue might be a result of outdated packages in the repo..

@bsimmo
Copy link

bsimmo commented May 6, 2024 via email

@bsimmo
Copy link

bsimmo commented May 6, 2024

It's seems it was 4 years ago they added color as spelling :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants