astro-pi / python-sense-hat

Source code for Sense HAT Python library
https://sense-hat.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
505 stars 253 forks source link

sense-hat V 1.0 with latest driver #125

Closed hb9cvh closed 1 year ago

hb9cvh commented 1 year ago

My sense-hat is now on a new Rpi 3+ with PiOS Bullseye and latest python-sense-hat. This little program :

from sense_hat import SenseHat sense = SenseHat() sense.show_message("Hello World")

Display the message but show:

WARNING:root:Failed to initialise TCS34725 colour sensor. (sensor not present)

What can I do?

bsimmo commented 1 year ago

You ignore it.

I wish they didn't display this message as it brings a lot of worry and comments like yours to users.

Basically they made a new version of the sensehat a year or so ago for the ISS/AstroPi missions that has a light sensor on it, the retail (original version) does not have it. And that is what it is saying.

They need to write in a SenseHAT version check so if it is not the v2 (which we cannot buy but is on the ISS) then do not display to user.

On Wed, 12 Oct 2022, 10:30 pm Johann Maurer, @.***> wrote:

My sense-hat is now on a new Rpi 3+ with PiOS Bullseye and latest python-sense-hat. This little program :

from sense_hat import SenseHat sense = SenseHat() sense.show_message("Hello World")

Display the message but show:

WARNING:root:Failed to initialise TCS34725 colour sensor. (sensor not present)

What can I do?

— Reply to this email directly, view it on GitHub https://github.com/astro-pi/python-sense-hat/issues/125, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN456WJAZ4L7HQDV5A3WC4UVVANCNFSM6AAAAAARDVT2XU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

hb9cvh commented 1 year ago

Hi Ben,

Thanks for your answer.

Unfortunately my program abort when I insert the driver sense-hat. So I downloaded the source from GitHub and found the lines 96 - 101 in sense_hat.py :

    # initialise the TCS34725 colour sensor (if possible)
    try:
        self._colour = ColourSensor()
    except Exception as e:
        logging.warning(e)
        pass

I commended this part out and my program runs now.

Sincerely John

-- Johann Maurer, Hauptstrasse 85, CH 2563 Ipsach, Schweiz @.***

Am 13.10.2022 um 06:30 schrieb Ben @.***>:

You ignore it.

I wish they didn't display this message as it brings a lot of worry and comments like yours to users.

Basically they made a new version of the sensehat a year or so ago for the ISS/AstroPi missions that has a light sensor on it, the retail (original version) does not have it. And that is what it is saying.

They need to write in a SenseHAT version check so if it is not the v2 (which we cannot buy but is on the ISS) then do not display to user.

On Wed, 12 Oct 2022, 10:30 pm Johann Maurer, @.***> wrote:

My sense-hat is now on a new Rpi 3+ with PiOS Bullseye and latest python-sense-hat. This little program :

from sense_hat import SenseHat sense = SenseHat() sense.show_message("Hello World")

Display the message but show:

WARNING:root:Failed to initialise TCS34725 colour sensor. (sensor not present)

What can I do?

— Reply to this email directly, view it on GitHub https://github.com/astro-pi/python-sense-hat/issues/125, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN456WJAZ4L7HQDV5A3WC4UVVANCNFSM6AAAAAARDVT2XU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/astro-pi/python-sense-hat/issues/125#issuecomment-1277014897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUFTUUQXZJGVXO2CYR5MPYDWC6F4ZANCNFSM6AAAAAARDVT2XU. You are receiving this because you authored the thread.

bsimmo commented 1 year ago

They should change (hopefully to stop users being worried about something they don't even haven) logging.warning(e) to whatever it is that doesn't normally show this error in 'logging' , then users can override the message logging level IF they are having problems with it and it comes to debugging the hardware.

Also Add logging/debug information in the documents.

Or have it check the SenseHAT version first and then only check for it?

:-)

But you've made me crack out my sensehats again and have a play :-)

On Thu, 13 Oct 2022, 5:00 pm Johann Maurer, @.***> wrote:

Hi Ben,

Thanks for your answer.

Unfortunately my program abort when I insert the driver sense-hat. So I downloaded the source from GitHub and found the lines 96 - 101 in sense_hat.py :

initialise the TCS34725 colour sensor (if possible)

try: self._colour = ColourSensor() except Exception as e: logging.warning(e) pass

I commended this part out and my program runs now.

Sincerely John

-- Johann Maurer, Hauptstrasse 85, CH 2563 Ipsach, Schweiz @.***

Am 13.10.2022 um 06:30 schrieb Ben @.***>:

You ignore it.

I wish they didn't display this message as it brings a lot of worry and comments like yours to users.

Basically they made a new version of the sensehat a year or so ago for the ISS/AstroPi missions that has a light sensor on it, the retail (original version) does not have it. And that is what it is saying.

They need to write in a SenseHAT version check so if it is not the v2 (which we cannot buy but is on the ISS) then do not display to user.

On Wed, 12 Oct 2022, 10:30 pm Johann Maurer, @.***> wrote:

My sense-hat is now on a new Rpi 3+ with PiOS Bullseye and latest python-sense-hat. This little program :

from sense_hat import SenseHat sense = SenseHat() sense.show_message("Hello World")

Display the message but show:

WARNING:root:Failed to initialise TCS34725 colour sensor. (sensor not present)

What can I do?

— Reply to this email directly, view it on GitHub https://github.com/astro-pi/python-sense-hat/issues/125, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACYAXN456WJAZ4L7HQDV5A3WC4UVVANCNFSM6AAAAAARDVT2XU

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/astro-pi/python-sense-hat/issues/125#issuecomment-1277014897>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AUFTUUQXZJGVXO2CYR5MPYDWC6F4ZANCNFSM6AAAAAARDVT2XU . You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/astro-pi/python-sense-hat/issues/125#issuecomment-1277841977, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN35XRTKUXZTMSSFE23WDAW3LANCNFSM6AAAAAARDVT2XU . You are receiving this because you commented.Message ID: @.***>

G3zz commented 1 year ago

Thanks for your feedback - the latest version (2.5.1) has downgraded that output to debug level, so as to not cause confusion. The documentation is in the process of being updated too