digitaltrails / vdu_controls

VDU controls - a control panel for monitor brightness/contrast/...
GNU General Public License v3.0
103 stars 4 forks source link

Sensor lightmeter stuck in wayland? #87

Closed Milor123 closed 2 months ago

Milor123 commented 2 months ago

Dear brother

I am writing to inform you that my VDU has stopped functioning properly, failing to read data from the Arduino sensor. Although I'm not sure when this issue began, it occasionally occurred previously, where the program would become stuck on 0 and restarting it would resolve the problem.

However, this issue persists and I have made no changes to the Arduino itself. The only notable modification I have made recently was switching from X11 to Wayland as my display server.

Could this be related to the transition to Wayland?

In an effort to troubleshoot the issue, I updated VDU today, deleted my personalized configuration files for the software, and also checked the Arduino console to verify if perhaps the device had malfunctioned. Additionally, I attempted changing ports, but all signs point to a peculiar error on the VDU side.

I have endeavored to revisit the steps outlined in your tutorial, including switching from using a symbolic link to the actual port. Despite my efforts, I am still unsure of the root cause of this issue and would greatly appreciate any guidance you can offer.

image

Please let me know if there is anything else I can provide or if you require further information to assist me in resolving this problem.

Best regards

This is the log

python vdu_controls.py --debug           
10:33:28 INFO: VDU Controls 2.0.3 vdu_controls.py  
10:33:28 INFO: python-locale: ('es_ES', 'UTF-8') Qt-locale: es_ES
10:33:28 INFO: app-style: breeze (detected a dark theme)
10:33:28 INFO: Looking for config file '/home/noe/.config/vdu_controls/vdu_controls.conf'
10:33:28 INFO: Using config file '/home/noe/.config/vdu_controls/vdu_controls.conf'
10:33:28 WARNING: command-line debug=yes overrides vdu-controls-globals.debug-enabled=no (in /home/noe/.config/vdu_controls/vdu_controls.conf)
10:33:28 INFO: Logging to stdout
10:33:28 DEBUG: config: vdu_controls.conf [metadata] version = 2.0.3
10:33:28 DEBUG: config: vdu_controls.conf [metadata] timestamp = 2024-04-27 10:16:43.189559-05:00
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] system-tray-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] hide-on-focus-out = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] transitions-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] translations-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] weather-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] schedule-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] lux-options-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] splash-screen-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] warnings-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] smart-window = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] monochrome-tray-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] mono-light-tray-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] debug-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] syslog-enabled = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-client-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-signals-enabled = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-globals] location = 
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] brightness = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] contrast = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-volume = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mute = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-treble = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-bass = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mic-volume = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] input-source = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] power-mode = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] osd-language = no
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] color-temperature = yes
10:33:28 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] enable-vcp-codes = 
10:33:28 DEBUG: config: vdu_controls.conf [ddcutil-parameters] sleep-multiplier = 0.0
10:33:28 DEBUG: config: vdu_controls.conf [ddcutil-parameters] ddcutil-extra-args = 
10:33:28 DEBUG: config: vdu_controls.conf [ddcutil-capabilities] capabilities-override = 
10:33:28 INFO: Reading autolux file '/home/noe/.config/vdu_controls/AutoLux.conf'
10:33:28 INFO: Screen DP-1
10:33:28 DEBUG: Reserve shortcut 'P'
10:33:28 DEBUG: Reserve shortcut 'G'
10:33:28 DEBUG: Reserve shortcut 'A'
10:33:28 DEBUG: Reserve shortcut 'C'
10:33:28 DEBUG: Reserve shortcut 'L'
10:33:28 DEBUG: Reserve shortcut 'S'
10:33:28 DEBUG: Reserve shortcut 'R'
10:33:28 DEBUG: Reserve shortcut 'T'
10:33:28 DEBUG: Reserve shortcut 'H'
10:33:28 DEBUG: Reserve shortcut 'Q'
10:33:28 INFO: native_font_height_pixels=18
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
10:33:28 INFO: Configuring application (reconfiguring=False)...
10:33:28 DEBUG: configure: try to obtain application_configuration_lock
10:33:28 DEBUG: Holding application_configuration_lock
10:33:28 DEBUG: Enabled callback for VDU-connectivity-change D-Bus signals
10:33:28 INFO: ddcutil version (2, 1, 4) (dynamic-sleep=True) - interface 1.0.4 (D-Bus ddcutil-service - libddcutil)
10:33:28 DEBUG: Detecting connected monitors, looping detection until it stabilises.
10:33:30 DEBUG: checking possible IDs for display 1
10:33:30 DEBUG: Unique key for vdu_number='1' manufacturer='AUS' is (model_name='PA248QV' main_id='M4LMQS006956')
10:33:33 DEBUG: checking possible IDs for display 1
10:33:33 DEBUG: Unique key for vdu_number='1' manufacturer='AUS' is (model_name='PA248QV' main_id='M4LMQS006956')
10:33:33 INFO: Number of detected monitors is stable at 1 (loop=2)
10:33:33 INFO: Initializing controls for vdu_number='1' vdu_model_name='PA248QV' self.vdu_stable_id='PA248QV_M4LMQS006956'
10:33:33 DEBUG: WorkerThread: init VduControllerAsyncSetter from thread_pid()=1961410
10:33:33 DEBUG: checking for config file '/home/noe/.config/vdu_controls/PA248QV_M4LMQS006956.conf'
10:33:33 DEBUG: WorkerThread: class_name='VduControllerAsyncSetter' running in thread_pid()=1962560 <bound method VduControllerAsyncSetter._async_setvcp_task_body of <__main__.VduControllerAsyncSetter object at 0x7f2acd81d090>>
10:33:33 DEBUG: checking for config file '/home/noe/.config/vdu_controls/PA248QV.conf'
10:33:33 DEBUG: Removed PA248QV_M4LMQS006956 audio-mute - not supported by VDU
10:33:33 DEBUG: Removed PA248QV_M4LMQS006956 audio-treble - not supported by VDU
10:33:33 DEBUG: Removed PA248QV_M4LMQS006956 audio-bass - not supported by VDU
10:33:33 DEBUG: Removed PA248QV_M4LMQS006956 audio-mic-volume - not supported by VDU
10:33:33 DEBUG: Removed PA248QV_M4LMQS006956 color-temperature - not supported by VDU
10:33:33 INFO: splash_message: 'DDC ID 1\nPA248QV:M4LMQS006956'
10:33:33 DEBUG: vcp_value_changed: PA248QV_M4LMQS006956 vcp_code='10' 23 origin=EXTERNAL
10:33:33 DEBUG: vcp_value_changed: PA248QV_M4LMQS006956 vcp_code='12' 80 origin=EXTERNAL
10:33:33 INFO: splash_message: 'Checking Presets'
10:33:33 DEBUG: SingletonDialog exists SettingsEditor False
10:33:33 DEBUG: configure: released application_configuration_lock
10:33:33 DEBUG: WorkerThread: init WorkerThread from thread_pid()=1961410
10:33:33 INFO: Lux auto-brightness settings refresh - monitoring is off.
10:33:33 INFO: Completed configuring application
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
10:33:38 DEBUG: SingletonDialog exists LuxDialog False
10:33:38 DEBUG: SingletonDialog exists LuxDialog False
10:33:38 DEBUG: SingletonDialog created for LuxDialog
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Please help me!! Thank u very much

digitaltrails commented 2 months ago

I doubt wayland has anything to do with it. It should not affect communicating with ttys. Although I suppose different default permissions might be applied. Anyway, you could always try switching back to X11.

I would first suspect the arduino. Isolate the Arduino from vdu_controls. Stop vdu_controls using the arduino by switching to manual ambient light input, or by shutting down vdu_controls completely. Then use cat to see what the arduino is producing, here is a healthy example:

% cat  /dev/arduino 
8.33

8.33

9.17

10.00

12.50

13.33
14.17

14.17

14.17

Control-C the cat to get out of it.

Rarely, every few months, the arduino doesn't initialise properly on a system boot. The output from cat might contain garbage such as:

[BH1750] Device is not configured!
-2.00
[BH1750] Device is no%

To fix this I have to switch vdu_controls into manual (or exit). Then I unplug the USB connection to cut the arduino's power. Then reconnect the USB and it should be OK. On my system it seems OK to do this while the system is up, but if cautious, a shutdown/power-off would do the same thing.

If the arduino is still the problem, could it be a loose wire or dry-joint. As illustrated, I use plugable pins on a breadboard, so I would replug each wire to make sure the connections are good.

Reloading the arduino's software using the arduino IDE might fix corrupted software. In my experience, that's never been necessary.

digitaltrails commented 2 months ago

I took a closer look at your screen-capture, in the image you have switched off automatic brightness control. Is that just because you are testing the arduino? Otherwise it would explain your problem:

image

Note, if auto is on, the auto-brightness-symbol should be orange. If the auto-brightness-symbol is grey, automatic adjustment is off.

image

Also if auto is on, there should be an orange symbol on the tray icon:

image

Milor123 commented 2 months ago

Thank u very much for your reply bro. I am trying it with a weird result xD:

image

I took a closer look at your screen-capture, in the image you have switched off automatic brightness control. Is that just because you are testing the arduino? Otherwise it would explain your problem:

image

Note, if auto is on, the auto-brightness-symbol should be orange. If the auto-brightness-symbol is grey, automatic adjustment is off.

image

Also if auto is on, there should be an orange symbol on the tray icon:

image

Oh my god, I was thinking that option ignored the graphic design (since I had a personalized design previously)

Thank you so much for your help, choosing that option completely solved my problem, it seems like I’ve been a complete idiot all this time haha, sorry about that, thanks for your time

digitaltrails commented 2 months ago

Note also that clicking on the main-panel auto-brightness-symbol will toggle auto between on and off (handy if passing clouds are causing too many changes). Also altering the manual ambient light sider will also switch to manual. Clicking on the slider is one possible the way that can happen accidentally.

Milor123 commented 2 months ago

Note also that clicking on the main-panel auto-brightness-symbol will toggle auto between on and off (handy if passing clouds are causing too many changes). Also altering the manual ambient light sider will also switch to manual. Clicking on the slider is one possible the way that can happen accidentally.

I’ll keep that in mind, thank you very much, at least I finally understand clearly with the yellow sun icon and the yellow dot on the system tray icon. image