Start a new topic

pi-top with latest Raspbian and screen working at full brightness !!!

Hi everyone.



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 .


it manages:

-screen brightness increment/decrement ( and expilcit values between 1 and 10 )

-screen blank / unblank

-system shutdown ( when requested, the HUB must be shutdown also...)


by executing

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[6]

if isValid(resp_bin_str, screen_off):
 print "Valid response"

 

should became

else:
# Incorrect log from command - take value from hub and presume correct
screen_off = resp_bin_str[6]
'''
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.


reboot

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

 


*) ok.

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!! :)



This thread is completely outdated. If you want to use standard Raspbian, look at github.com/rricharz/pi-top-install

2 people like this
Thank you :)

This is not well documented.  How does the .pi-top directory happen?  There are a few steps missing on getting started.  rricharz material is about as useless.  I will just keep googleing until I find something that works and post the link here for the rest of us. 

Hi, .pi-top does not exist anymore since more that a year! stanoc‘s input is outdated. If you want to use the pi-top with the latest Raspbian Stretch, look at github.com/rricharz/pi-top-setup . If you find that this is useless, please tell us know why. What needs to be improved to make it useful for you?
Login or Signup to post a comment