Control backlight - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3) +--- Thread: Control backlight (/showthread.php?tid=1560) |
Control backlight - NaturalBornCamper - 2018-10-31 Hey there, Controlling the backlight of the official raspberry pi screen is easy enough on raspbian, but it looks like it's different on openplotter. The file and folder to use in the link do not even exist and you don't have write permission: https://raspberrypi.stackexchange.com/questions/46225/adjusting-the-brightness-of-the-official-touchscreen-display Same with the python code. Anybody figured it out? RE: Control backlight - BellaX - 2018-10-31 (2018-10-31, 05:00 PM)NaturalBornCamper Wrote: Hey there, Hi, controlling the backlight is very easy: https://github.com/linusg/rpi-backlight Open Terminal, type: sudo nano /etc/udev/rules.d/backlight-permissions.rules Add this to make access permanent: SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power" Install backlight-lib: sudo pip install rpi_backlight From now you can run 'sudo rpi-backlight' and it will ask for the brighness. Or 'sudo rpi-backlight-gui' to get a graphical slider. I am using an IR remote control and have changed the key-binding to call the rpi-backlight-gui. Works very nice! Type: sudo nano ~/.config/openbox/lxde-pi-rc.xml Insert after <!--keybindings for LXPanel -->: <keybind key="your keyboard key here"> <action name="Execute"> <command>sudo ripi-backlight-gui</command> </action> </keybind> To find out the Scancodes of your keyboard/RC, type: xev Use strg+c to quit xev. Cheers, Chris RE: Control backlight - NaturalBornCamper - 2018-11-01 Hey there, thanks for the answer! I have seen that python project repo on the same link I sent, but it's not working for me, I suppose for the same reason that the file in the first answer is missing. OpenPlotter seems to be set differently. Here's some error output when trying rpi-backlight: Code: pi@openplotter:~ $ sudo rpi-backlight --power Code: pi@openplotter:~ $ sudo rpi-backlight --brightness 100 Code: pi@openplotter:~ $ sudo rpi-backlight-gui |