Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[Deprecated} Using the Flirc USB for remote control with mOde 5.4+
#51
(02-22-2020, 06:03 PM)Tim Curtis Wrote: Why not simply change the --user from nobody to root in the system unit file?

Sure, that works and it allows the direct invocation from triggerhappy actions of system commands like /sbin/poweroff.

I was thinking in terms of the principle of least privilege. That's probably silly. There's already a huge number processes running with root privileges on any of my moOde players. One more isn't going to make a noticeable difference.

Regards,
Kent
Reply
#52
ps -A -u root
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#53
(02-22-2020, 07:52 PM)Tim Curtis Wrote: ps -A -u root

Exactly my point.
Reply
#54
I've read this thread and the linked responses going on three or four times by now. It's a bit rough to piece together. Smile

I want to use the Flirc USB with a Harmony remote. Other sources say the best way to do that is to configure the Flirc as a KODI interface since that's supported in the Harmony software, so that's all good so far.


What do I need to do to get TriggerHappy running and mapping to moOde?

I'd really like to support the mouse movements, eventually as in didier31's post, but...baby steps...

Thanks!

Jason
Reply
#55
@LaserGecko

Hi, Jason.

So you said:

Quote:I want to use the Flirc USB with a Harmony remote. Other sources say the best way to do that is to configure the Flirc as a KODI interface since that's supported in the Harmony software, so that's all good so far.


What do I need to do to get TriggerHappy running and mapping to moOde?

The triggerhappy daemon is already running on current moOde players.

You'll need to create a mapping in the /etc/triggerhappy/triggers.d/media.conf file which implements the action you want for each keystroke output from the Flirc when it's configured "as a KODI interface". 

Added note: You can also put your Flirc mappings in their own .conf file in the same subdirectory. Triggerhappy merges all files matching the .conf.

The media.conf file already contains some lines for use of a USB volume controller which you can take as teaching examples. There's also the man page for the triggerhappy daemon, thd.

Regards,
Kent
Reply
#56
Just a quick note that its not running by default. It only gets started if USB volume knob is set to ON in Audio Config.

Code:
pi@rp2:~ $ systemctl status triggerhappy
● triggerhappy.service - triggerhappy global hotkey daemon
  Loaded: loaded (/lib/systemd/system/triggerhappy.service; disabled; vendor preset: enabled)
  Active: inactive (dead)

User would need to do that or alternatively run the cmd below then reboot.

Code:
sudo systemctl enable triggerhappy
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#57
Oops, my bad.
Reply
#58
Thanks, Kent and Tim!

I've created flirc_kodi.conf

Since I don't know what buttons on the Harmony do what, I figured it would be easier to just see what the remote sends than cross referencing configs. I will create a new document, enter a command, push the appropriate buttons on the remote, see what gets sent, then kind of build the config backwards.

Unfortunately, the only things the Harmony sends as text are the numbers and a few extended commands. Play, next, pause, etc. all look like they're not really text even though https://support.flirc.tv/hc/en-us/articl...-Flirc-GUI shows that play should be "p".
Reply
#59
I've took the plunge and got a Flirc-USB. I've set it up associated actions via Triggerhappy and all is well: I can change the volume, mute and change radio stations. With the latter, I've created a simple bash script that passes to mpc the radio stream. Is there a way of doing this in a Moode compliant way so that the Moode UI knows this is station is playing? Or to put another way, is there a way to intruct Moode to play a certain radio station? I see in the vol.sh script it updates the DB etc.

Many thanks.
Reply
#60
@SoundAdikt

I'm not sure I understand your question. What does "in a Moode compliant way so that the Moode UI knows this is station is playing" mean?

Do you mean so that it displays the station name and logo? Then the URL you pass to mpc literally must be one that is already defined in the RADIO library (which means in a .pls file, in the collection of logo files, and in a corresponding entry in the moode-sqlite3.db database)

Let's take Zen FM as an example. Its entry in the moOde RADIO library  contains the stream URL http://lb.zenfm.be/zenfm.mp3

The following triplet of mpc commands clears the queue, adds the Zen FM URL as the first entry and starts the stream playing. The moOde UI shows the Zen FM logo, name, and misc stuff because of the info in the library.

Code:
mpc clear
mpc add http://lb.zenfm.be/zenfm.mp3
mpc play

Here's another URL to the Zen FM stream which I just found in the latest .m3u file from the station website: http://str.topradio.be:80/zenfm.mp3. This stream also can be added and played but no station logo or name is displayed. Name and other info may be displayed if the station includes metadata in its stream.

Regards,
Kent
Reply


Forum Jump: