admsasha
Posts: 5
Joined: Wed Jun 21, 2017 12:39 am

Яркость монитора

Fri Jun 23, 2017 12:23 am

По hdmi подключен телевизор. Возможно ли поменять ему яркость программно ?

peppy.player
Posts: 111
Joined: Mon Mar 07, 2016 6:10 am

Re: Яркость монитора

Fri Jun 23, 2017 2:25 pm

Вот здесь описано управление официальным дисплеем, возможно сработает и в вашем случае:
https://raspberrypi.stackexchange.com/q ... en-display

Удачи.

admsasha
Posts: 5
Joined: Wed Jun 21, 2017 12:39 am

Re: Яркость монитора

Sat Jun 24, 2017 11:42 am

Нет, данный метод при подключении через hdmi не подходит

leha862
Posts: 3
Joined: Mon May 07, 2018 7:30 pm

Re: Яркость монитора

Mon May 07, 2018 8:33 pm

пытаюсь управлять программой rpi_backlight но выбивает ошибку,вроде-бы устанавливается она нормально

Code: Select all

 [email protected]:~ $ rpi-backlight
usage: rpi-backlight up | down | max | min | on | off

options:
	up:	 increases brightness by 10%
	down:	 decreases brightness by 10%
	max:	 sets brightness to 100%
	min:	 sets brightness to 0%
	on:	 turns the screen on
	off:	 turns the screen off

2015, Jakub Hladik, www.github.com/jakeh12

[email protected]:~ $ rpi-backlight off
ERROR: '/sys/class/backlight/rpi_backlight/bl_power' does not exist/insufficient permissions.
[email protected]:~ $ sudo rpi-backlight off
ERROR: '/sys/class/backlight/rpi_backlight/bl_power' does not exist/insufficient permissions.
[email protected]:~ $ [code]

vladnt
Posts: 75
Joined: Sun Feb 21, 2016 10:16 am

Re: Яркость монитора

Tue May 08, 2018 8:30 pm

а если sudo добавить ?

leha862
Posts: 3
Joined: Mon May 07, 2018 7:30 pm

Re: Яркость монитора

Thu May 17, 2018 1:06 pm

вот лог установки этой недо-программы

Code: Select all

[email protected]:~ $ pip install rpi_backlight
Collecting rpi_backlight
  Downloading https://files.pythonhosted.org/packages/ce/f1/04ba3de4cae42d0c722931f7c59b19c9f97747c9e020b2e672bedd8f0510/rpi_backlight-1.8.1.tar.gz
Building wheels for collected packages: rpi-backlight
  Running setup.py bdist_wheel for rpi-backlight ... done
  Stored in directory: /home/pi/.cache/pip/wheels/09/71/d0/044367eed4d2c8dade6b1d4959abdbd948ba36dc4987cfead7
Successfully built rpi-backlight
Installing collected packages: rpi-backlight
Successfully installed rpi-backlight-1.8.1
[email protected]:~ $ git clone https://github.com/linusg/rpi-backlight.py
Cloning into 'rpi-backlight.py'...
Username for 'https://github.com': aleksej862
Password for 'https://[email protected]': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/linusg/rpi-backlight.py/'
[email protected]:~ $ git clone https://github.com/linusg/rpi-backlight.py
Cloning into 'rpi-backlight.py'...
Username for 'https://github.com': leha862
Password for 'https://[email protected]': 
remote: Repository not found.
fatal: repository 'https://github.com/linusg/rpi-backlight.py/' not found
[email protected]:~ $ git clone https://github.com/linusg/rpi_backlight.py
Cloning into 'rpi_backlight.py'...
Username for 'https://github.com': leha862
Password for 'https://[email protected]': 
remote: Repository not found.
fatal: repository 'https://github.com/linusg/rpi_backlight.py/' not found
[email protected]:~ $ git clone https://github.com/linusg/rpi-backlight.git
Cloning into 'rpi-backlight'...
remote: Counting objects: 355, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 355 (delta 2), reused 0 (delta 0), pack-reused 347
Receiving objects: 100% (355/355), 2.47 MiB | 497.00 KiB/s, done.
Resolving deltas: 100% (216/216), done.
[email protected]:~ $ cd rpi-backlight
[email protected]:~/rpi-backlight $ sudo python3 setup.py install
running install
running bdist_egg
running egg_info
creating rpi_backlight.egg-info
writing entry points to rpi_backlight.egg-info/entry_points.txt
writing dependency_links to rpi_backlight.egg-info/dependency_links.txt
writing top-level names to rpi_backlight.egg-info/top_level.txt
writing rpi_backlight.egg-info/PKG-INFO
writing manifest file 'rpi_backlight.egg-info/SOURCES.txt'
reading manifest file 'rpi_backlight.egg-info/SOURCES.txt'
writing manifest file 'rpi_backlight.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib
copying rpi_backlight.py -> build/lib
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
copying build/lib/rpi_backlight.py -> build/bdist.linux-armv7l/egg
byte-compiling build/bdist.linux-armv7l/egg/rpi_backlight.py to rpi_backlight.cpython-35.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying rpi_backlight.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying rpi_backlight.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying rpi_backlight.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying rpi_backlight.egg-info/entry_points.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying rpi_backlight.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/rpi_backlight-1.8.1-py3.5.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing rpi_backlight-1.8.1-py3.5.egg
Copying rpi_backlight-1.8.1-py3.5.egg to /usr/local/lib/python3.5/dist-packages
Adding rpi-backlight 1.8.1 to easy-install.pth file
Installing rpi-backlight-gui script to /usr/local/bin
Installing rpi-backlight script to /usr/local/bin

Installed /usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg
Processing dependencies for rpi-backlight==1.8.1
Finished processing dependencies for rpi-backlight==1.8.1
[email protected]:~/rpi-backlight $ sudo nano /etc/udev/rules.d/backlight-permissions.rules
[email protected]:~/rpi-backlight $ import rpi_backlight as bl
bash: import: command not found
[email protected]:~/rpi-backlight $ sudo rpi_backlight
sudo: rpi_backlight: command not found
[email protected]:~/rpi-backlight $ sudo rpi-backlight
usage: rpi-backlight [-h] [-b VALUE] [-d DURATION] [-s] [--on] [--off]
                     [--max-brightness] [--actual-brightness] [--power]

Control power and brightness of the official Raspberry Pi 7" touch display.

optional arguments:
  -h, --help            show this help message and exit
  -b VALUE, --brightness VALUE
                        set the display brightness to VALUE (11-255)
  -d DURATION, --duration DURATION
                        fading duration in seconds
  -s, --smooth          fade the display brightness, see -d/--duration
  --on                  set the display powered on
  --off                 set the display powered off
  --max-brightness      get the maximum display brightness
  --actual-brightness   get the actual display brightness
  --power               get the current power state
[email protected]:~/rpi-backlight $ rpi-backlight -b 255
Traceback (most recent call last):
  File "/usr/local/bin/rpi-backlight", line 11, in <module>
    load_entry_point('rpi-backlight==1.8.1', 'console_scripts', 'rpi-backlight')()
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 151, in cli
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 83, in set_brightness
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 62, in get_max_brightness
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
[email protected]:~/rpi-backlight $ sudo rpi-backlight -b 20 -s -d 3
Traceback (most recent call last):
  File "/usr/local/bin/rpi-backlight", line 11, in <module>
    load_entry_point('rpi-backlight==1.8.1', 'console_scripts', 'rpi-backlight')()
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 151, in cli
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 83, in set_brightness
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 62, in get_max_brightness
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
[email protected]:~/rpi-backlight $ sudo rpi-backlight --max-brightness 255
usage: rpi-backlight [-h] [-b VALUE] [-d DURATION] [-s] [--on] [--off]
                     [--max-brightness] [--actual-brightness] [--power]
rpi-backlight: error: unrecognized arguments: 255
[email protected]:~/rpi-backlight $ sudo rpi-backlight --actual-brightness 20
usage: rpi-backlight [-h] [-b VALUE] [-d DURATION] [-s] [--on] [--off]
                     [--max-brightness] [--actual-brightness] [--power]
rpi-backlight: error: unrecognized arguments: 20
[email protected]:~/rpi-backlight $ sudo rpi-backlight --actual-brightness 60
usage: rpi-backlight [-h] [-b VALUE] [-d DURATION] [-s] [--on] [--off]
                     [--max-brightness] [--actual-brightness] [--power]
rpi-backlight: error: unrecognized arguments: 60
[email protected]:~/rpi-backlight $ sudo rpi-backlight --power True
usage: rpi-backlight [-h] [-b VALUE] [-d DURATION] [-s] [--on] [--off]
                     [--max-brightness] [--actual-brightness] [--power]
rpi-backlight: error: unrecognized arguments: True
[email protected]:~/rpi-backlight $ sudo rpi-backlight --off
[email protected]:~/rpi-backlight $ sudo rpi-backlight-gui

** (rpi-backlight-gui:1611): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Traceback (most recent call last):
  File "/usr/local/bin/rpi-backlight-gui", line 11, in <module>
    load_entry_point('rpi-backlight==1.8.1', 'console_scripts', 'rpi-backlight-gui')()
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 175, in gui
  File "/usr/local/lib/python3.5/dist-packages/rpi_backlight-1.8.1-py3.5.egg/rpi_backlight.py", line 52, in get_actual_brightness
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
[email protected]:~/rpi-backlight $ 
работает она только на официальных дисплеях? с sudo в прошлый раз та-же ерунда была

peppy.player
Posts: 111
Joined: Mon Mar 07, 2016 6:10 am

Re: Яркость монитора

Thu May 17, 2018 3:11 pm

Вот здесь жалуются на ту же проблему:
https://github.com/linusg/rpi-backlight/issues/9
Ответ - работает только на официальном 7" дисплее под который должны быть установлены нужные драйверы.

Удачи.

leha862
Posts: 3
Joined: Mon May 07, 2018 7:30 pm

Re: Яркость монитора

Thu May 17, 2018 6:34 pm

мда уж..есть-же кучи других дисплеев..а дисплеи waveshare как там регулируется яркость?вроде на сайте магазина onpad написано регулировка яркости и контрастности ..хотя могут иметь в виду отключение подсветки..плохо что другие производители так не сделали

Return to “Русский”