Hello,
I run OSMC on raspberry 3. There is a program called hyperion ng which I also installed on the raspberry pi3 to control a led strip at the back of my tv to mimic philip’s ambilight. But in order to get this hyperion service going i have to start it from my pc using putty and leave the pc on (which is not convenient).
There is a way to have this hyperion service run at the startup but getting it to work is just way over my head.
Here is the file which is needed to start hyperion service:
Would anyone care to guide me step by step through this process of creating a service on OSMC please?
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.
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.
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'.
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.
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.
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.
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
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?