[SOLVED] Infrared remote for Max2Play rpi Squeezebox

Max2Play Home Forums Max2Play as Squeezebox (Player / Server) [SOLVED] Infrared remote for Max2Play rpi Squeezebox

Viewing 30 posts - 1 through 30 (of 32 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. Dezember 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. Dezember 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. Dezember 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. Dezember 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. Dezember 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. Dezember 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

    pi@max2play ~ $ 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. Dezember 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. Dezember 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. Januar 2016 at 11:35 #17601

    Hi,

    I’ve nearly the same configuration (7″ touch + jive lite + tsop4838@gpio + 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 8 years, 11 months ago by Bort.
    • This reply was modified 8 years, 11 months ago by Bort.
    9. Januar 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. Januar 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. Januar 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. Januar 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 8 years, 10 months ago by Bort.
    • This reply was modified 8 years, 10 months ago by Bort.
    26. Januar 2017 at 19:53 #26350

    Hi,

    thanks for sharing this Bort!

    If anyone interested in IR-Support: we now have an easy installer for the Justboom Remote in our Justboom-Soundcard Plugin for Max2Play that supports Jivelite, Squeezlite (direct) and MPD. It comes with preconfigured IR-Codes for the Justboom Remote and has the button configuration ready for Jivelite, Squeezelite and MPD.
    You may also override existing settings with your own and replace IR-Codes or button configuration. There might come a even more powerful standalone IR-Addon for Max2Play in the future with more preconfigured remotes.

    All the Best,
    Stefan

    27. Januar 2017 at 18:39 #26368

    I installed justboom plug-in and there is no ir control.
    It says „NOT IMPLEMENTED YET“.

    25. April 2017 at 11:17 #28463

    Are you using the Remote with a soldered IR receiver on your JustBoom sound card?

    25. Juli 2017 at 4:50 #30117

    @Bort

    I try your script with crontab and also with LXDE Autostarts but the irxevent doesn’t work for me.

    If I use the command „DISPLAY=:0 irxevent -d /home/pi/lircrc“ in a shell that works.

    can you help me?

    regards
    Carsten

    25. Juli 2017 at 12:47 #30131

    Hi Carsten,

    What setup are you using and what steps have you taken so far?

    25. Juli 2017 at 20:42 #30153

    @Heiner

    Hi Heiner,

    everything with my remote control works fine, if I wrote in the shell of the remote session this:

    DISPLAY=:0 irxevent -d /home/pi/lircrc

    but after a reboot of the Raspberry PI3, I have to do it every time again.

    My Problem is, to do that string anywhere in the boot sequence.

    I try it as a script whit crontab like follow:

    #!/bin/bash

    ### BEGIN INIT INFO
    # Provides: fb.sh
    # Required-Start:
    # Required-Stop:
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Starts & Stops fb.sh
    # Description: Starts & Stops fb.sh
    ### END INIT INFO

    # Nur asuführen wenn jivelite im Autostart
    autostart=$(grap -a „jivelite=1“ /opt/max2play/autostartconf | 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 /home/pi/lircrc‘
    else
    echo „Starte irxevent neu!“
    echo ’sudo kill „$(pidofirxevent)“‚
    sleep 1
    echo’DISPLAY=:0 irxevent -d /home/pi/lircrc‘
    fi

    exit 0

    The script name is fb.sh and that is the crontab config:

    @reboot /home/pi/fb.sh

    I don’t know what is wrong in my script.

    regards
    Carsten

    • This reply was modified 7 years, 4 months ago by relgi.
    26. Juli 2017 at 12:47 #30165

    Hi Carsten,

    Have you tried using our LIRC implementation in the Raspberry Settings?

    Just enter the GPIO’s of your IR sensor and tick the box. Afterwards click save and reboot.

    26. Juli 2017 at 14:28 #30167

    Hi Heiner,

    yes the LIRC implementation is checked, but I modify the config.txt in /boot.

    I change it to GPIO=17 and remove the GPIO OUT. I use a Hifiberry Digi+.

    I told that everything works fine if I use this command in a shell:

    DISPLAY=:0 irxevent -d /home/pi/lircrc, so my problem know is, that after a reboot of the raspbian OS,
    i have todo it every time. I need help for a implementation of this command that it works after any reboot without my doing in the shell.

    • This reply was modified 7 years, 4 months ago by relgi.
    26. Juli 2017 at 14:44 #30168

    Hi Heiner,

    UPDATE!!

    it works now.

    What I change:
    copy the file lircrc from /home/pi to /etc/lirc

    change my script from echo’DISPLAY=:0 irxevent -d /home/pi/lircrc’ to echo’DISPLAY=:0 irxevent -d /etc/lirc/lircrc’

    after that everything works as I like.

    thx for support.

    regards
    Carsten

Viewing 30 posts - 1 through 30 (of 32 total)

You must be logged in to reply to this topic.

Register here