Hyperion service on OSMC

#2

This thread would be the place to start.

#3

This is where I pointed the user when they opened a support ticket.

#4

I cant say i appreciate having my time wasted on this extensive 600+ comments thread, which doesn’t even scratch the surface on starting hyperion ng. on boot.

#5

Just copy the unit to systemd path, run systemctl daemon-reload and enable it

#6

Would it be too much to ask to break down these “simple” steps for me even more? Im a Linux illiterate.
If i had each particular line of code in the proper order,I think i could pull this off.

#7

You’ll have more luck posing in the thread mentioned earlier I’m pretty sure something that already has it set up will try to help you.

But from looking at the thread and people discussing it I don’t think getting Hyperion to work on osmc is really a very trivial process

#8

I think @hissingshark has a one line installer - at least for Vero

1 Like
#9

If everything else is already in place, you simple need to create a file (using sudo):

/etc/systemd/system/hyperion.service

and copy the above code into it. Then run the command:

sudo systemctl enable hyperion.service

then reboot the device.

#10

I believe to have done so,I then run sudo systemctl status hyperion which gave

  • hyperion.service - Hyperion ambient light systemd service for user
    Loaded: loaded (/etc/systemd/system/hyperion.service; enabled; vendor preset: enable
    Active: activating (auto-restart) (Result: exit-code) since Wed 2019-10-09 23:01:38
    Process: 2217 ExecStart=/usr/bin/hyperiond (code=exited, status=210/CHROOT)
    Main PID: 2217 (code=exited, status=210/CHROOT)

Oct 09 23:01:38 osmc systemd[1]: hyperion.service: Failed with result ‘exit-code’.

And it does not activate hyperion on boot. Maybe not everything is in place then?

#11
  1. For reference, which guide have you followed up to this point to build/install all of the hyperion files?

  2. What command did you use to launch hyperion previously through the terminal?

  3. What is the output from these?
    ls -l /usr/share/hyperion/bin
    ls -l /usr/bin | grep hyperion

#12

Looking at the start script, I see it contains the line User=%i that might be a problem.

I’m not familiar with Hyperion so don’t know why the script has the possibility to run the job under different users. For now, edit the file and replace the %i with an appropriate username, eg osmc, that hyperion shound run under. Reboot and see if works.

@hissingshark I suspect you’ve added the ll command alias yourself. The only alias I find on my OSMC systems is alias ls='ls --color=auto'.

#13

From the look of it I strongly suspect the binaries are not arranged as the service unit is expecting. I await the feedback from @bont55 to be sure.

The %iis not meant to be supported in old versions of systemd, but these days will cause it to run as root. The only effect is to cause hyperion to put the config folder under /root/.hyperion instead of /home/osmc/.hyperion, which is ok for now as you don’t edit the file directly. On my Vero4k installer I change it to osmc, but that’s for forms sake.

Good spot with ll, that’s caught me out before… my alias for ls -l.

#14
  1. I used this video as a guide. https://www.youtube.com/watch?v=xm8Oi22B0gI
    I was told on hyperion forum that it would work for OSMC as well.
    In addition I added
sudo apt-get install rbp-userland-dev-osmc

as it seemed important.

  1. hyperiond
    I find it strange that after launching it, every 10 sec the terminal would continuously pop the “No carrier” notifications, and no other other commands can be executed. If i close the terminal,hyperion stops working.

  2. ls -l /usr/share/hyperion/bin
    ls: cannot access ‘/usr/share/hyperion/bin’: No such file or directory

ls -l /usr/bin | grep hyperion
This command goes pretty much ignored.
Im not sure if and how I should alter those lines based on dillthedog’s remark.

P.S.
Sorry about delayed response. My raspberry wouldn’t boot so I had to start everything from the scratch. Im suspecting it got corrupted from my recent attempt to create hyperion.service.
I know its a question for another topic, but would it be possible to create an image of the sd card,so if things go wrong again I could simply burn the backup image? I thought win32diskimager could do it but im not sure because the sd card has 2 partitions.

#15

That program images the whole card and worked fine when I used it in the past.

#16

3
I’d already altered the lines for you, so you’re good there. The lack of output is because the file aren’t where they are supposed to be.

2
The “no carrier” spamming is normal behaviour, so don’t worry about that.

1
As I suspected the executables are in the wrong place.
From the output onscreen it looked like their install command uses different paths to the ones used in the service unit. Rather than move everything it will be easier to just change the paths in the service file.

In hyperion.service change:

ExecStart=/usr/bin/hyperiond
to
ExecStart=/usr/local/bin/hyperiond

and
WorkingDirectory=/usr/share/hyperion/bin
to
WorkingDirectory=/usr/local/share/hyperion/bin

#17

Ok,so I created /etc/systemd/system/hyperion.service file with the changes to ExecStart and WorkingDirectory. Did the reboot but hyperion didnt auto-start.
I then altered User from %i to osmc ,again without success.

Anything else we could try? Whats with this :

Is it also a necessary step?

This video on YT shows creation of systemd service file. https://www.youtube.com/watch?v=fYQBvjYQ63U&t=119s
He first creates bash script, adds executable permission, only then does he create the service file.
Could it be Im missing those first 2 steps?

#18

Yes, you have to reload the systemd daemon for it to see the changes to the file. And it must be enabled or it won’t run at startup.

#19

Let’s make sure their install command put everything where it did in the video and that the binaries are executable…

  1. What is the output from these?
    ls -l /usr/local/share/hyperion/bin
    ls -l /usr/local/bin | grep hyperion
#22
  1. As usual, it would help greatly if we could see logs.

  2. Since you’re trying to run it under user osmc, why not try to run it from the command line?

     cd /usr/local/share/hyperion/bin
     /usr/local/bin/hyperiond
#23

Eureka! We did it and its working!

So the changes to

and

were necessary. As it would not work with user %i.
Then running

Here is the output from ls -l /usr/local/share/hyperion/bin

total 18956
-rwxr-xr-x 1 root staff 3692508 Oct 11 18:24 hyperion-dispmanx
-rwxr-xr-x 1 root staff 3692468 Oct 11 18:24 hyperion-framebuffer
-rwxr-xr-x 1 root staff 3737612 Oct 11 18:24 hyperion-remote
-rwxr-xr-x 1 root staff 3770464 Oct 11 18:24 hyperion-v4l2
-rwxr-xr-x 1 root staff 4509132 Oct 11 18:24 hyperiond

and ls -l /usr/local/bin | grep hyperion

lrwxrwxrwx 1 root staff 39 Oct 11 18:24 hyperion-dispmanx -> …/share/hyperion/bin/hyperion-dispmanx
lrwxrwxrwx 1 root staff 42 Oct 11 18:24 hyperion-framebuffer -> …/share/hyperion/bin/hyperion-framebuffer
lrwxrwxrwx 1 root staff 37 Oct 11 18:24 hyperion-remote -> …/share/hyperion/bin/hyperion-remote
lrwxrwxrwx 1 root staff 35 Oct 11 18:24 hyperion-v4l2 -> …/share/hyperion/bin/hyperion-v4l2
lrwxrwxrwx 1 root staff 31 Oct 11 18:24 hyperiond -> …/share/hyperion/bin/hyperiond

But i think that this settles it. Many,many many thanks for helping me out with this.:+1: After a few months of struggling with broken ambilight and refusing to watch movies without it I can finally go back to it.