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

Cant run commands on Raspberry Pi 3B+

General Discussion
2
4
138
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.
  • R
    rtn17
    last edited by rtn17 Mar 2, 2020, 4:21 PM Mar 2, 2020, 3:46 PM

    Hi !
    I successfully setup my Raspberry Pi 3B+ but can't run any commands. My TriggerCMD is linked, too. Alexa is finding the "device" but when I run the command nothing happens. The original commands also didn't work for me.

    I want to control one LED Strip through Alexa. My config.json looks like following

    [
      {"trigger":"strip","command":"sudo PYTHONPATH=".:build/lib.linux-armv7l-2.7" python rpi_ws281x/python/examples/strandtest.py -c","ground":"background","voice":"strip","allowParams": "false"}
    ]
    

    The path of the json file is /root/.TRIGGERcmdData/commands.json

    Thank you in advance!

    R 1 Reply Last reply Mar 2, 2020, 10:18 PM Reply Quote 0
    • R
      Russ @rtn17
      last edited by Russ Mar 2, 2020, 10:22 PM Mar 2, 2020, 10:18 PM

      @rtn17 said in Cant run commands on Raspberry Pi 3B+:

      [
      {"trigger":"strip","command":"sudo PYTHONPATH=".:build/lib.linux-armv7l-2.7" python rpi_ws281x/python/examples/strandtest.py -c","ground":"background","voice":"strip","allowParams": "false"}
      ]

      You need to escape the quotes (using backslashes) in your command because they're inside other quotes (for the json). Please try this instead:

      [
       {
        "trigger": "strip",
        "command": "sudo PYTHONPATH=\".:build/lib.linux-armv7l-2.7\" python rpi_ws281x/python/examples/strandtest.py -c",
        "ground": "background",
        "voice": "strip",
        "allowParams": "false"
       }
      ]
      

      Russell VanderMey

      R 1 Reply Last reply Mar 3, 2020, 1:15 PM Reply Quote 0
      • R
        rtn17 @Russ
        last edited by rtn17 Mar 3, 2020, 1:15 PM Mar 3, 2020, 1:15 PM

        @Russ

        Thank you very much!

        I changed the command and added the absolute path.

        [
         {
          "trigger": "strip",
          "command": "sudo python /home/pi/rpi_ws281x/python/examples/strandtest.py -c",
          "ground": "background",
          "voice": "strip",
          "allowParams": "false"
         }
        ]
        

        Now it's working.

        R 1 Reply Last reply Mar 4, 2020, 3:12 PM Reply Quote 0
        • R
          Russ @rtn17
          last edited by Mar 4, 2020, 3:12 PM

          @rtn17, awesome. You're welcome.

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post