• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

i can't add trigger on my raspberry pi

Raspberry Pi
2
7
561
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.
  • P
    Pé de Pano
    last edited by May 3, 2022, 11:06 PM

    Hello Russ, I managed to install the Trigger cmd on my Raspberry pi, insclusive managed to see it on the site. But I'm having trouble adding a Trigger. I could not edit the file: commands.json. I opened the terminal as root user, and typed the following code: /root/. TRIGGERcmdData/commands.json, and I received the output: Permission denied. I'd like you to help me. Thank you right now.

    R 1 Reply Last reply May 4, 2022, 12:12 PM Reply Quote 0
    • R
      Russ @Pé de Pano
      last edited by Russ May 4, 2022, 12:12 PM May 4, 2022, 12:12 PM

      @pé-de-pano , try

      nano /root/.TRIGGERcmdData/commands.json
      

      Your command tried to execute the text file as if it was a script. Nano is a text editor.

      Russell VanderMey

      P 1 Reply Last reply May 4, 2022, 11:57 PM Reply Quote 0
      • P
        Pé de Pano @Russ
        last edited by May 4, 2022, 11:57 PM

        @russ hello russ, I edited the commands.json to:
        [
        {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
        {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
        {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
        {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
        {"trigger":"python test","command":"python /root/led.py","ground":"background","voice":""}
        ]
        but when saving I can't see the trigger on the site, only Gnome Editor. Could you help me?

        R 1 Reply Last reply May 6, 2022, 12:44 PM Reply Quote 0
        • R
          Russ @Pé de Pano
          last edited by Russ May 6, 2022, 12:45 PM May 6, 2022, 12:44 PM

          @pé-de-pano, can you check whether your background service is running?

          systemctl status triggercmdagent

          pi@garagepi:~ $ systemctl status triggercmdagent
          ● triggercmdagent.service - TRIGGERcmd Agent
             Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
             Active: active (running) since Thu 2022-03-31 10:17:03 UTC; 1 months 5 days ago
           Main PID: 262 (node)
             CGroup: /system.slice/triggercmdagent.service
                     └─262 node /usr/share/triggercmdagent/app/src/daemon.js --run /root/.TRIGGERcmdData
          
          May 01 23:13:40 garagepi env[262]:   |>    Socket reconnected successfully after
          May 01 23:13:40 garagepi env[262]: \___/   being offline at least 28.27 seconds.
          May 01 23:13:40 garagepi env[262]:   |>    Now connected to https://www.triggercmd.com.
          May 01 23:13:40 garagepi env[262]: \___/   For help, see: http://bit.ly/2q0QDpf
          

          It has to be running in order to sync up the background commands in your commands.json with your computer in your account.

          Russell VanderMey

          P 1 Reply Last reply May 7, 2022, 12:18 PM Reply Quote 0
          • P
            Pé de Pano @Russ
            last edited by May 7, 2022, 12:18 PM

            @russ said in i can't add trigger on my raspberry pi:
            hello, I received the following output

            ● triggercmdagent.service - TRIGGERcmd Agent
                 Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vend>
                 Active: active (running) since Fri 2022-05-06 00:28:26 BST; 1 day 12h ago
               Main PID: 404 (node)
                  Tasks: 11 (limit: 1598)
                    CPU: 3.577s
                 CGroup: /system.slice/triggercmdagent.service
                         └─404 node /usr/share/triggercmdagent/app/src/daemon.js --run /roo>
            
            May 07 13:09:12 raspberrypi env[404]: _-|>_-  (attempt #3)
            May 07 13:09:12 raspberrypi env[404]:  
            May 07 13:09:12 raspberrypi env[404]:   |>    Socket reconnected successfully a>
            May 07 13:09:12 raspberrypi env[404]: \___/   being offline at least 132038.91 >
            May 07 13:09:12 raspberrypi env[404]:   |>    Now connected to https://www.trig>
            May 07 13:09:12 raspberrypi env[404]: \___/   For help, see: http://bit.ly/2q0Q>
            May 07 13:09:12 raspberrypi env[404]:         (using sails.io.js node SDK @v1.1>
            May 07 13:09:12 raspberrypi env[404]:          Connected at: Sat May 07 2022 13>
            May 07 13:09:12 raspberrypi env[404]: { message: 'Subscribed to null!' }
            May 07 13:09:12 raspberrypi env[404]: { message: 'Subscribed to null!' }
            ~
            ~
            ~
            lines 1-19/19 (END)...skipping...
            ● triggercmdagent.service - TRIGGERcmd Agent
                 Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
                 Active: active (running) since Fri 2022-05-06 00:28:26 BST; 1 day 12h ago
               Main PID: 404 (node)
                  Tasks: 11 (limit: 1598)
                    CPU: 3.577s
                 CGroup: /system.slice/triggercmdagent.service
                         └─404 node /usr/share/triggercmdagent/app/src/daemon.js --run /root/.TRIGGERcmdData
            
            May 07 13:09:12 raspberrypi env[404]: _-|>_-  (attempt #3)
            May 07 13:09:12 raspberrypi env[404]:  
            May 07 13:09:12 raspberrypi env[404]:   |>    Socket reconnected successfully after
            May 07 13:09:12 raspberrypi env[404]: \___/   being offline at least 132038.91 seconds.
            May 07 13:09:12 raspberrypi env[404]:   |>    Now connected to https://www.triggercmd.com.
            May 07 13:09:12 raspberrypi env[404]: \___/   For help, see: http://bit.ly/2q0QDpf
            May 07 13:09:12 raspberrypi env[404]:         (using sails.io.js node SDK @v1.1.13)
            May 07 13:09:12 raspberrypi env[404]:          Connected at: Sat May 07 2022 13:09:12 GMT+0100 (British Summer Time)
            May 07 13:09:12 raspberrypi env[404]: { message: 'Subscribed to null!' }
            May 07 13:09:12 raspberrypi env[404]: { message: 'Subscribed to null!' }
            
            R 1 Reply Last reply May 7, 2022, 1:36 PM Reply Quote 0
            • R
              Russ @Pé de Pano
              last edited by May 7, 2022, 1:36 PM

              @pé-de-pano, I see this in your output:

              "Subscribed to null!"
              

              That's bad. It should not be "null". It should be your computer ID.

              I suggest you try this:

              • Delete your computer from your account
              • Login as root with this command: sudo su -
              • Run triggercmdagent
              • Re-enter your token.
              • Press CTRL-C to exit.
              • Run: systemctl restart triggercmdagent
              • Run: systemctl status triggercmdagent

              It should re-create your computer in your account, with the commands in your commands.json file.

              Russell VanderMey

              P 1 Reply Last reply May 7, 2022, 3:24 PM Reply Quote 0
              • P
                Pé de Pano @Russ
                last edited by May 7, 2022, 3:24 PM

                It all worked out! Thank you very much Russ, you helped me a lot.@russ

                1 Reply Last reply Reply Quote 1
                7 out of 7
                • First post
                  7/7
                  Last post