below is what I've came up trying to use latest raspbian version with pi-top forcing the screen to full brightness.
I've been trying to use the latest raspbian version but was unable to force screen brightness to full value until...
inside /home/pi/.pi-top/sys/ there's a python script hub_controller.py that manages comunication with pi-top HUB .
-screen brightness increment/decrement ( and expilcit values between 1 and 10 )
-screen blank / unblank
-system shutdown ( when requested, the HUB must be shutdown also...)
ps ax | grep hub
you will see that script in execution...
Now you can bring the sys directory with you and boot in the latest raspbian .
once in raspbian, the display should be not so bright...
*) put sys directory where you wish.
*) hub_controller.py uses another executable to check screen status:
It calls the execution of xscreensaver-command .
But raspbian hasn't it installed by default .
so we can open a text editor and edit sys/hub_controller.py
around line 171 there is
print "Reading screen state" try:
must change in
print "Reading screen state" ''' try:
( we started a multi line comment )
then, around line 184 there is
else: # Incorrect log from command - take value from hub and presume correct screen_off = resp_bin_str if isValid(resp_bin_str, screen_off): print "Valid response"
else: # Incorrect log from command - take value from hub and presume correct screen_off = resp_bin_str ''' screen_off = "0" if True: #isValid(resp_bin_str, screen_off): print "Valid response"
( we ended the multilline comment, set screen_off to a default value and changed the if condition to be always true )
*) now. you need to enable SPI interface in raspbian:
execute sudo raspi-config and in advanced options enable SPI interface by default and answer yes when asked for enable automatic kernel-module load.
if screen is flickering, reboot by shutdown raspbian and unplugging/plugging the AC power.
*) now you need SPI python module ( by default rasbpian has not, pi-top has it ) .
in a terminal ( be aware of spaces in https addresses to be removed before executing the instructions )
mkdir python-spi cd python-spi wget https : / / raw.github.com / doceme / py-spidev / master / setup.py' wget https : / / raw.github.com / doceme/py-spidev / master / spidev_module.c wget https : / / raw.github.com / doceme/py-spidev / master / README.md wget https : / / raw.github.com / doceme/py-spidev / master /CHANGELOG.md sudo apt-get install python-dev sudo python setup.py install
now create some empty file. in a terminal
cd sys touch ./brightness_signal touch ./shutdown_signal touch ./screen_signal
now you can execute the script ( and let it run )
sudo python ./hub_controller.py
*) the funny part:
#to increase brightness echo "increment" > ./brightness_signal #to decrease brightness echo "decrement" > ./brightness_signal #to set brightness to a explicit value ( between 1 and 10 ) echo "10" > ./brightness_signal #to blank the screen ( not tested, but should go ) echo "blank" > ./screen_signal #to unblank the screen ( not tested, but should go ) echo "unblank" > ./screen_signal #to shutdown ( not tested, but should go ) echo "shutdown" > ./shutdown_signal
now we can say that this approach is not the better one, but for my need it's ok. A good idea to start could be binding keystrokes to above commands to manage brightness from keyboard ( but another good idea should be implement a better python script than the ugly editing I've done above, which is not reliable... )
have fun!! :)
the above solution is not well written, not well tested and should be understood by the reader...
follow the instructions at you own risk!! ;)
it's no more than an hint!!
Thank you for the instruction.
I have used them to get battery statistics and brightness
I started debian from scratch and I am missing .pi-top directory.
Can you please provide me internet location of these files?
I replied to you already but my response is missing ?
I read somewhere that you can do
sudo apt-get install pi-topOS.zip
by writing the flavor(overlay) over top of Raspbian.
I read that's all there is to PiTop OS..
You can manage brightness using PiTop overlay. It is possible to program settings at certain times in Terminal.