bk1285 / rpi_wordclock

Software to create a Raspberry Pi based wordclock
GNU General Public License v3.0
214 stars 106 forks source link

Brightness and Sleeping not working #176

Closed kas1kas closed 3 years ago

kas1kas commented 3 years ago

The current build d523f81 still seems to suffer from two old problems:

1: Default brightness value not set in config-file: To do so, add a "brightness" between 1..255 to the [wordclock_display]-section.

2: No sleeping time set, display will stay bright 24/7. No sleeping time set, display will stay bright 24/7. No sleep brightness set within the config-file. Defaulting to 5.

Does someone have a solution? I tried all kind of suggestions but nothing works.

What I noticed:

Data for brightness in the config file is 200 Why does the code below jump to the except? When I print the brightness value it says 200

    try:
        self.setBrightness(config.getint('wordclock_display', 'brightness'))
    except:
        self.brightness = max_brightness
        print(
            'Default brightness value not set in config-file: '
            'To do so, add a "brightness" between 1..255 to the [wordclock_display]-section.')

Similar for the sleep times

thanks!!

Patrik42 commented 3 years ago

Hey! Same problem with my clock. Changing the config file value of brightness does not change a thing. I would just change the "max_brightness" value within wordclock_display.py to a different value for starters.

"rpi_wordclock/wordclock_tools/wordclock_display.py"

    # Get the wordclocks wiring-layout
    self.wcl = wiring.wiring(config)
    self.wci = wci
    self.config = config
    self.base_path = config.get('wordclock', 'base_path')
    # max_brightness = 255
    max_brightness = 25

That works for me, because I just need the time to be displayed. I know that I am restricting max_brightness within all plugins now... but that is ok for me.

kas1kas commented 3 years ago

Hard coding was also needed to get the sleeping time to work, but it does not change the fact that something is wrong in the total setup. It all starts with the Raspberry OS install. I use raspbian stretch (instructions say to use the latest raspbian, but that does not work). Then it needs corrections like manual versions: pyrsistent==0.14.7 flask-restplus==0.12.1 flask==1.0.2 werkzeug==0.16.1

There are other forks claiming to use python 3, but sofar I have not found a clear step by step description that works!

Is there anyone who has everything working ? Please let me know how this was achieved. Thanks a lot.

phenze commented 3 years ago

Hi. I dont know if the brightness stuff is working in my fork because i have a brightness sensor installed. But everything is working with python3 (There is a step by Step description in the Readme File)

Take a look here https://github.com/phenze/rpi_wordclock/tree/master-python3

kas1kas commented 3 years ago

Hi Pascal, Thanks for your software: It installs very easy and without errors! Great. The brightness and sleeping times however are still giving errors. But I will change the code as I did before.

Do you have the diagram for the light sensor that you use?

Thanks again!

kas1kas commented 3 years ago

Well, there is already a detailed description called Brightness sensor Issue #139 (sorry for not having seen that earlier). I will try this.

phenze commented 3 years ago

Fell free to create a pull request when you have fixed that