Infrared remote for Max2Play rpi Squeezebox

Max2Play Home 2016 (en) Forums Max2Play as Squeezebox (Player / Server) Infrared remote for Max2Play rpi Squeezebox

This topic contains 20 replies, has 6 voices, and was last updated by  Bort premium 10 months, 3 weeks ago.

Viewing 21 posts - 1 through 21 (of 21 total)
  • 25. November 2015 at 9:20 #17016

    Hello,

    I am in search of a infrared remote solution for my raspberry pi Squeezebox installation.
    My Setup:
    – raspberry pi 2
    – HifiBerry DAC+ Pro
    – 7″ Touchscreen
    Max2Play plugin: Hifiberry, SqueezeboxServer, Audioplayer (Squeezelite activated), RPi Display, Jivelite.

    Everything is working as expected, esp. the Touchscreen with Jiverlite.
    My question: I would like to add a infrared remote (like a lirc solution) to control Squeezelite/Jivelite in case I can not use the touch functionality of the Touchscreen; is it possible? What to do? Is there a plugin for this problem?

    By the way: Initially I wanted to install a DLNA audio client solution, because I have up and running a DLNA audio server (MinimServer on a Linux PC). Anyhow I was not able to use MinimServer via the DLNA client solution in the Max2Play Audioplayer plugin. Any idea what went wrong?

    Regards Rainer

    25. November 2015 at 16:30 #17020

    Hi Rainer,
    Regarding the infrared, the Raspberry Pi does not have a native infrared receiver. Thus, a hardware component would have to be added. Thus, we are not planning on implementing such a solution in the near future.
    Regarding the DLNA Audio Player, did your server not recognize the Player in the network or was the playback problematic? Please try running just the gmediarender as an Audioplayer to rule out interference with the opther players (tick off autostart at Squeezelite).

    25. November 2015 at 18:04 #17021

    For a cheap and working IR receiver: http://powerpi.de/jede-infrarot-fernbedienung-am-raspberry-pi-2-nutzen-so-installierst-du-guenstig-einen-ir-empfaenger-teil-1/ (only in German)

    Works for me like a charm with Harmony 885

    26. November 2015 at 11:24 #17036

    Hi,

    thanks for your input.
    Regarding the infrared remote Solution:
    The solution Manfred2k mentions is not possible for my system because I have installed the HifiBerry board and the GPIO pins are not available for the IR Receiver. So I will have to use a USB solution like Flirc. Can I control the Jivelite/Squeezebox interface on my RPi Touchscreen with a Flirc based IR Receiver solution (together with a remote like Logitech Harmony)? How to install? Is there a how-to available?

    I know, a lot of “beginner questions” …

    Regards Rainer

    29. November 2015 at 10:07 #17060

    Hi

    I have exactly the same bundle than you and my system is working perfectly with a hifiberry dac+ and a homemade IR receiver explained in Manfred2k webpage (I don’t speak german but command line are understoodable:) ).
    But there is one trick to do: default lirc port (19?) is not possible because it is already used by the DAC. You have to change it in /boot/config.txt file on your raspi like this:
    dtoverlay=lirc-rpi,gpio_in_pin=<your pin number>
    And of course solder new pins on your DAC.
    And it works like a charm 🙂

    29. November 2015 at 10:37 #17061

    Same here. With a little bit of soldering and changing the GPIO to 24, lirc works nearly perfect with a PI2 and Hifiberry Digi+.

    29. November 2015 at 12:03 #17062

    Thanks a lot for your inputs.
    But I will implement a solution with the Flirc USB stick. My son told me this is the easiest way to go… a little bit more expensive but idiot proof. Because Flirc emulates a standard keyboard. I put a keyboard on the RPi and viola I could find out the relevant keys to control Squeezelite/Jivelite.
    So I ordered a Flirc and will give you a feedback as soon as the product has arrived.

    Regards Rainer

    14. December 2015 at 12:18 #17318

    @Manfred2k:

    did you install lirc manually (can’t find lirc folders anywhere)? I did this, but when I started following he tutorial with the “killall” command, no lirc process was found. I also changed the GPIO-IN pin to 24 like you (I hope I got this right and connected the cable to PIN#18 on the board?).

    Can you remember the steps to get there? Got a bit frustrated here 😉

    14. December 2015 at 13:26 #17321

    try

    sudo apt-get install lirc lirc-x liblircclient-dev

    another tutorial in German http://www.vdr-wiki.de/wiki/index.php/Raspbian_VDR_Streaming_Client_-_LIRC

    17. December 2015 at 0:18 #17381

    @manfred2k

    Thanks for that excellent tip. I got i kinda working. Whenever i run irw i get results like this in the command line:
    irw
    000000004be0b946 00 KEY_RIGHT /root/lircd.conf
    000000004be039c6 00 KEY_LEFT /root/lircd.conf
    000000004be0d926 00 KEY_DOWN /root/lircd.conf
    000000004be059a6 00 KEY_UP /root/lircd.conf
    000000004be07986 00 KEY_A /root/lircd.conf
    000000004be0e916 00 KEY_Q /root/lircd.conf
    000000004be09966 00 KEY_H /root/lircd.conf

    But no reaction in jivelite…

    Is there another key-mapping file for jivelite that has to be adjusted?

    I did all steps in the tutorial as the root user, maybe it has got something to do with this as it says /root/lircd.conf?

    Any help is appreciated, as I got so far now 🙂

    17. December 2015 at 9:10 #17382

    In the meantime I got a Flirc infrared USB stick (https://flirc.tv/more/flirc-usb). A little bit more expensive than the solutions you are discussing (I had to pay 25 Euro for the stick) but working out of the box.
    No problems to get it up and running. The stick emulates a standard keyboard so you only have to put a keyboard at your RPi and check the keystrokes you need in the application you are using.
    I use an old remote from an now unused BluRay player and it now controls Max2Play Squeezelite. May be an alternative for those who get frustrated with their diy solutions…

    Regards Rainer

    17. December 2015 at 9:13 #17383

    I think flirc does the same… emulating keystrokes. I already mapped those Keystrokes in the config files and can see them in the terminal, but somehow nothing happens in jivelite when I press buttons

    21. December 2015 at 19:52 #17451

    @manfred2k

    Hi again. I tried to install everything again using the tutorial on vdr-wiki and everything worked (this time not as root user… don’t know if this makes a difference)… I pasted the terminal code when hitting buttons on the remote control. And I think at least with KEY_RIGHT, left, down and so on somethin should happen in jivelite right? Do you have an idea what might have to be done here to make jivelite understand/receive those keyboard commands? Automatic startup of lirc seems to work.

    Any help would really be appreciated!

    Best, Fred

    [email protected] ~ $ irw
    000000004be0b946 00 KEY_RIGHT /home/pi/lircd.conf
    000000004be039c6 00 KEY_LEFT /home/pi/lircd.conf
    000000004be07986 00 KEY_A /home/pi/lircd.conf
    000000004be0e916 00 KEY_Q /home/pi/lircd.conf
    000000004be09966 00 KEY_H /home/pi/lircd.conf

    21. December 2015 at 22:38 #17454

    try to kill the running jivelite and start it again. On my Pi i have to do this after a reboot. Maybe lirc starts before jivelite and doesn´t recognize the commands from the remote

    21. December 2015 at 23:03 #17455

    I tried this… doesn’t help… 😐

    So you didn’t change any other mapping file… like the jivelite .lua files?

    7. January 2016 at 11:35 #17601

    Hi,

    I’ve nearly the same configuration (7″ touch + jive lite + [email protected] + XBOX one remote clone) for both of my kids very stable and nearly indestructible.

    At first I played around with some default key mappings like “KEY_RIGHT” this worked – but the remote has a lot of more keys 😉
    Since Jive Lite has no native IR/lirc support, I had to use irxevent:
    1.) complete lircd.conf for all keys you wanted to use (for such a much-used remote like the XBOX one just download it somewhere ;-))
    2.) take the whole needed mapping from IR-keys to the keyboard control of jive lite (reference: InputToActionMap.lua) in the lircrc config file
    for example:

    # Remote: VolumeUp
    # Jivelite '+'
    begin
       remote = XBOX-ONE
       prog = irxevent
       button = VolumeUp
       config = Key plus jivelite
    end

    or for multiple keyboard action just double the block:

    # Remote: big green button
    # jivelite at first stop playback 'C'
    begin
       remote = XBOX-ONE
       prog = irxevent
       button = XboxFancyButton
       config = Key shift-c jivelite
    end
    # Remote: big green button
    # jivelite second power off for display backlight 'q'
    begin
       remote = XBOX-ONE
       prog = irxevent
       button = XboxFancyButton
       config = Key q jivelite
    end

    Instead of jivelite you may use CurrentWindow as target for the keyboard emulation and control even other applications with the mapped keys in the lircrc.

    3.) On startup you need a script which waits for the successfull start of lircd and jivelite to start finally irxevent e.g.
    irxevent /etc/lirc/lircrc

    Always check lircd for running correctly (e.g. via irw) – otherwise thee hardware.conf may be not correct…

    • This reply was modified 11 months, 1 week ago by  Bort.
    • This reply was modified 11 months, 1 week ago by  Bort.
    9. January 2016 at 19:19 #17656

    @Bort: Thank you so much for answering.

    One question: where shall I put the lircrc file and do I have to make it known somewhere?

    11. January 2016 at 14:14 #17721

    If you just want to use the lircrc in the described irxevent for jivelite scenario just put it in the /etc/lirc/ folder (it’s even the default folder for an global irexec-configuration which based this file too) – or anywhere else.
    You have to start irxevent with the target file as paramter to get the solution to work:
    irxevent /etc/lirc/lircrc

    20. January 2016 at 22:21 #18030

    @Bort

    I finally got it to work, thanks for your help! Do you have an suggestion, how I can load irxeven on startup? I think it has to wait until the other services like lirc and maybe X are loaded?

    Best, fblu

    20. January 2016 at 22:30 #18031

    Here is the script I start via crontab @reboot

    #!/bin/bash                                                                                                         
                                                                                                                        
    # Nur ausführen, wenn jivelite im Autostart                                                                         
    autostart=$(grep -a "jivelite=1" /opt/max2play/autostart.conf | wc -l)                                              
    if [ $autostart -eq 0 ];                                                                                            
    then                                                                                                                
      echo "Jivelite nicht im Autostart - irxevent wird nicht gestartet!"                                               
      exit 0                                                                                                            
    fi                                                                                                                  
                                                                                                                        
    # Warten bis jivelite gestartet ist                                                                                 
    while [ -z "$(pidof jivelite)" ];                                                                                   
    do                                                                                                                  
      sleep 1                                                                                                           
    done                                                                                                                
                                                                                                                        
    # Warten bis Lircd gestartet ist                                                                                    
    while [ -z "$(pidof lircd)" ];                                                                                      
    do                                                                                                                  
      sleep 1                                                                                                          
    done                                                                                                                
                                                                                                                        
    if [ -z "$(pidof irxevent)" ];                                                                                      
    then                                                                                                                
      echo "Starte irxevent!"                                                                                           
      echo 'DISPLAY=:0 irxevent -d /etc/lirc/lircrc'                                                                 
    else                                                                                                                
      echo "Starte irxevent neu!"                                                                                       
      echo 'sudo kill “$(pidof irxevent)“'                                                                            
      sleep 1                                                                                                           
      echo 'DISPLAY=:0 irxevent -d /etc/lirc/lircrc'                                                                
    fi                                                                                                                  
                                                                                                                        
    exit 0
    • This reply was modified 10 months, 3 weeks ago by  Bort.
    • This reply was modified 10 months, 3 weeks ago by  Bort.
Viewing 21 posts - 1 through 21 (of 21 total)

You must be logged in to reply to this topic.

Register here