hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.11k stars 384 forks source link

Autostart systemd Ubuntu 20.04 issues #1097

Closed aut0 closed 3 years ago

aut0 commented 3 years ago

Bug report

Hyperion NG works on my Ubuntu 20.04 on an x86_64 machine. So far so good. But I cannot figure out how to get autostart working. I get errors in the journal like so:

Nov 16 19:01:39 blaecki systemd[1]: Started Hyperion ambient light systemd service  for user lukas.
Nov 16 19:01:40 blaecki hyperiond[497]: 2020-11-16T19:01:40.001 hyperiond QTGRABBER    : <ERROR> No displays found to capture from!
Nov 16 19:01:40 blaecki hyperiond[497]: No displays found to capture from!
Nov 16 19:01:40 blaecki hyperiond[497]: 2020-11-16T19:01:40.133 hyperiond LEDDEVICE    : <ERROR> Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB0]!'
Nov 16 19:01:40 blaecki hyperiond[497]: Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB0]!'

It looks like the ttyUSB0 is not there when hyperion wants it to be there. I tried to run with debug, but it gives no conclusive output. When I restart the service with sudo systemctl restart hyperiond@lukas it works fine afterwards and journal looks like this:

Nov 16 19:06:26 blaecki systemd[1]: Started Hyperion ambient light systemd service  for user lukas.
Nov 16 19:06:26 blaecki hyperiond[1537]: 2020-11-16T19:06:26.821 hyperiond QTGRABBER    : <ERROR> No displays foun>
Nov 16 19:06:26 blaecki hyperiond[1537]: No displays found to capture from!

Maybe related to systemd? Maybe /dev/ttyUSB0 is not populated at that point, but that would be surprising I think. I cannot really debug with gdb because it works after boot.

Steps to reproduce

Install latest hyperion. Enable systemd service likes sudo systemctl enable hyperiond@lukas. Reboot.

What is expected?

Hyperion should work.

What is actually happening?

Hyperion starts, but doesn't work, because the LED device is not recognized.

System

Hyperion Server:

Hyperion Server OS:

Anyways. Thank you for this great software. I really love it.

Tihass1975 commented 3 years ago

The same Problem under Manjaro 20.1.2

Paulchen-Panther commented 3 years ago

This post may help you here: https://superuser.com/a/1287260

aut0 commented 3 years ago

Solved by creating a udev rule to start systemd service when /dev/ttyUSB0 is available, as described here