Raspberry Pi setup


  • administrators

    @jackmonkey, you should be root when you run triggercmdagent and paste in your token, so switch to root with sudo su -. Please try that and do another ls /root/.TRIGGERcmdData -larth.



  • @russ I've got everything set up from your tutorial, but what do you do to actually add or edit triggers? I have done

    nano/root/.TRIGGERcmdData/commands.json

    But what do I actually need to do to create or edit triggers and commands?


  • administrators

    @ryan-roberts, you can add a line to that commands.json file like this, to add a command you want to be able to run:

    {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update"},
    

    If you find that your changes go away as soon as you save the file, then there's likely some bad json formatting in the file you tried to save. The most common problem is you have a comma on the last line.



  • This post is deleted!


  • Hi Russ..

    I think those instructions are not valid for the last raspio.
    I've got loads of errors that I am not sure how to solve.

    The following packages have unmet dependencies:
    nodejs : Conflicts: nodejs-legacy but 4.8.2~dfsg-1 is to be installed
    npm : Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
    Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
    Depends: node-ansi-color-table but it is not going to be installed
    Depends: node-archy but it is not going to be installed
    Depends: node-block-stream but it is not going to be installed
    Depends: node-fstream (>= 0.1.22) but it is not going to be installed
    Depends: node-fstream-ignore but it is not going to be installed
    Depends: node-github-url-from-git but it is not going to be installed
    Depends: node-glob (>= 3.1.21) but it is not going to be installed
    Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
    Depends: node-inherits but it is not going to be installed
    Depends: node-ini (>= 1.1.0) but it is not going to be installed
    Depends: node-lockfile but it is not going to be installed
    Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
    Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
    Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
    Depends: node-gyp (>= 0.10.9) but it is not going to be installed
    Depends: node-nopt (>= 3.0.1) but it is not going to be installed
    Depends: node-npmlog but it is not going to be installed
    Depends: node-once but it is not going to be installed
    Depends: node-osenv but it is not going to be installed
    Depends: node-read but it is not going to be installed
    Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
    Depends: node-request (>= 2.25.0) but it is not going to be installed
    Depends: node-retry but it is not going to be installed
    Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
    Depends: node-semver (>= 2.1.0) but it is not going to be installed
    Depends: node-sha but it is not going to be installed
    Depends: node-slide but it is not going to be installed
    Depends: node-tar (>= 0.1.18) but it is not going to be installed
    Depends: node-underscore but it is not going to be installed
    Depends: node-which but it is not going to be installed
    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.


  • administrators

    @gutopa, I want to try to reproduce that error and fix it. Can you tell me what Raspberry Pi and what OS you're running?



  • Thanks Russ..

    I'm using a pi2 B with a fresh install from noob. So I believe it's all the last version of raspbian.


  • administrators

    Thanks @gutopa.

    My Pi2 B died. I have a Pi 3 but I'll try the latest version of NOOBS/Raspbian on my Pi Zero to hopefully reproduce the problem.

    EDIT: I was able reproduce the problem, and fortunately there's a simple solution. I updated the instructions above.

    I changed this line:

    apt-get -y install npm nodejs-legacy

    To this:

    apt-get -y install npm nodejs

    Thank you for reporting the problem.



  • @russ said in Raspberry Pi setup:

    systemctl start triggercmdagent

    Hi, i'm curious - i use python scripts to trigger my gpio pins on my raspberry... it appears that these are "Foreground" tasks... how do i do this in the background (so that when the pi reboots - it loads automatically again)

    Any tips?


  • administrators

    @atmosphere, in your commands.json file, make the ground field background instead of foreground. That way it will run in the context of the background service.

     {
      "trigger": "GPIO 6 on",
      "command": "python /root/gpio6on.py",
      "ground": "background",
      "voice": "6 on"
     },
    

    Run this to install the background service:

    /usr/share/triggercmdagent/app/src/installdaemon.sh


  • Hi Russ..

    Could you give me some tips about how to remove it from raspbian?

    Thank you


  • administrators

    @gutopa, you could uninstall the Raspberry Pi agent using these commands:

    systemctl stop triggercmdagent
    /usr/share/triggercmdagent/app/src/removedaemon.sh
    apt remove triggercmdagent
    

    Then you should delete the computer from your account on the website.


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.