• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

TriggerHappy Daemon (THD) doesn't work on my Pi running Retropie ! Help

Scheduled Pinned Locked Moved Help and Support
retropietriggerhappydaemonhelpbug
32 Posts 4 Posters 8.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Djon
    last edited by 13 Jun 2018, 03:24

    Maybe should i past it before "exit 0" line ?

    1 Reply Last reply Reply Quote 0
    • M
      mitu Global Moderator @Djon
      last edited by mitu 13 Jun 2018, 03:24

      @djon Does the process shows up when your run ps -ef from the terminal ?
      EDIT: Yes, of course you need to add it before the exit, otherwise it's not executed.

      1 Reply Last reply Reply Quote 0
      • D
        Djon
        last edited by Djon 13 Jun 2018, 03:29

        Ok so i add it before "exit 0" this time and run ps -ef @mitu
        And i think the line you're interested in is
        "nobody 364 1 0 03:26 ? 00:00:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*"

        M 1 Reply Last reply 13 Jun 2018, 03:33 Reply Quote 0
        • M
          mitu Global Moderator @Djon
          last edited by mitu 13 Jun 2018, 03:33

          @djon Doesn't seem to be correct. Have you disabled the service ? The process shown there seems the one started from the built-in service script. Post your rc.local file contents, surrounded by code tags (```).

          1 Reply Last reply Reply Quote 0
          • D
            Djon
            last edited by 13 Jun 2018, 03:36

            No prob ! @mitu

            
            #
            
            # rc.local
            
            #
            
            # This script is executed at the end of each multiuser runlevel.
            
            # Make sure that the script will "exit 0" on success or any other
            
            # value on error.
            
            #
            
            # In order to enable or disable this script just change the execution
            
            # bits.
            
            #
            
            # By default this script does nothing.
            
            
            
            # Print the IP address
            
            _IP=$(hostname -I) || true
            
            if [ "$_IP" ]; then
            
              printf "My IP address is %s\n" "$_IP"
            
            fi
            
            
            
            /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --devicelob /dev/input/event* &
            
            
            
            exit 0
            M 1 Reply Last reply 13 Jun 2018, 03:40 Reply Quote 0
            • M
              mitu Global Moderator @Djon
              last edited by 13 Jun 2018, 03:40

              @djon Just change it to

              # Start THD as user pi
              nohup /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event* &
              
              exit 0
              

              and reboot. Disable the service with sudo systemctl disable triggerhappy first.

              1 Reply Last reply Reply Quote 0
              • D
                Djon
                last edited by Djon 13 Jun 2018, 03:41

                I'll do it in a sec, so i'll change all the file just with these lines ? @mitu

                1 Reply Last reply Reply Quote 0
                • D
                  Djon
                  last edited by Djon 13 Jun 2018, 03:51

                  Okay so i made the mistake to erase all the file, to put just your line...
                  So i did it again, with just your line at the end, and i can say... that... it is workinggggggggggg !!!!!!! @mitu

                  I think that i will start again from stratch with a brand new retropie image, next time i'll just need to put :

                  # Start THD as user pi
                  nohup /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event* &
                  
                  exit 0
                  

                  Or i'll need to take all the steps we made ?

                  1 Reply Last reply Reply Quote 0
                  • D
                    Djon
                    last edited by Djon 13 Jun 2018, 03:56

                    Since you're here @mitu and that your the best guy ever, i need to change a bit the script to make the brightness increase by 25% each time, i was thinking :

                    sudo chmod 777 /sys/class/backlight/rpi_backlight/brightness && echo 25% > /sys/class/backlight/rpi_backlight/brightness
                    

                    ... hum no i just test it and they say "invalid argument"

                    FYI the brightness can go from 0 to 250

                    1 Reply Last reply Reply Quote 0
                    • H
                      Headrush69
                      last edited by Headrush69 23 Jul 2018, 02:09

                      I ran into the same issue trying to get triggerhappy to process the VOLUME_UP and VOLUME_DOWN events from my Dell AC511 soundbar.

                      No matter whether I set the user to run the process as in /etc/defaults/triggerhappy, or /etc/init.d/triggerhappy, it would always run as user nobody.

                      The process would run, but because nobody doesn't have privileges, my commands to amixer would not run.

                      The solution I found was to edit /etc/systemd/system/multi-user.target.wants/triggerhappy.service and set the user in there to pi.

                      After doing that and restarting the daemon, the triggerhappy process ran under user pi and everything worked.

                      Edit: Future updates my overwrite changes to this file, I don't know.

                      S 1 Reply Last reply 30 Jan 2021, 14:06 Reply Quote 1
                      • S
                        simple @Headrush69
                        last edited by 30 Jan 2021, 14:06

                        @headrush69 Thank you sssssssssssssooooooooooooooooooo much headrush!
                        I have spent the last 2 days digging for this!!
                        My volume knob, It WORKS!

                        I literally created an account here just to thank you!

                        1 Reply Last reply Reply Quote 0
                        • M mitu referenced this topic on 17 Aug 2022, 12:05
                        • L levis78 referenced this topic on 22 Jun 2023, 13:52
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                          This community forum collects and processes your personal information.
                          consent.not_received