TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. eromano
    E
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 11
    • Best 0
    • Controversial 0
    • Groups 0

    eromano

    @eromano

    0
    Reputation
    2
    Profile views
    11
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    eromano Unfollow Follow

    Latest posts made by eromano

    • RE: TriggerCMD on Openwrt

      @Russ yes sure, thank you

      posted in Raspberry Pi
      E
      eromano
    • TriggerCMD on Openwrt

      Good evening all,
      I tried to install only the agent on Openwrt by following these steps:

      1. installed packeges: node-npm, git-http
      2. created new folder called gitrepo
        3)into the new folder (gitrepo) I executed the git command: git clone https://github.com/rvmey/TRIGGERcmd-Agent.git
      3. into the subfolder TRIGGERcmd-AgentI executed the command: "node ./src/agent.js --console" to verify missing modules
      4. the missing modules installed with npm have been: socket.io-client, sails.io.js, request, prompt, chokidar

      6)then I executed againg the command: "node ./src/agent.js --console" and inserted the token I obtained these rows:

      Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
      Daemon install: false
      Logging in with saved token.
      Checking if the computer exists.
      This computer exists in your account.
      Tokenfile: /root/.TRIGGERcmdData/token.tkn
      ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
      Logging in with saved token to run foreground tasks.
      Local Home Assistant Configuration file not found at /root/.TRIGGERcmdData/home_assistant_config.json
      Local Home Assistant listener is disabled.
      Write backup completed.

      The socket was unable to connect.
      The server may be offline, or the
      socket may have failed authorization
      based on its origin or other factors.
      You may want to check the values of
      sails.config.sockets.onlyAllowOrigins
      or (more rarely) sails.config.sockets.beforeConnect
      in your app.
      More info: https://sailsjs.com/config/sockets
      For help: https://sailsjs.com/support

      Technical details:
      TransportError: websocket error
      at WS.onError (/root/node_modules/engine.io-client/build/cjs/transport.js:48:37)
      at ws.onerror (/root/node_modules/engine.io-client/build/cjs/transports/websocket.js:57:39)
      at callListener (/root/node_modules/ws/lib/event-target.js:290:14)
      at WebSocket.onError (/root/node_modules/ws/lib/event-target.js:230:9)
      at WebSocket.emit (node:events:517:28)
      at emitErrorAndClose (/root/node_modules/ws/lib/websocket.js:1035:13)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      description: ErrorEvent {
      [Symbol(kTarget)]: WebSocket {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      _binaryType: 'nodebuffer',
      _closeCode: 1006,
      _closeFrameReceived: false,
      _closeFrameSent: false,
      _closeMessage: <Buffer >,
      _closeTimer: null,
      _extensions: {},
      _paused: false,
      _protocol: '',
      _readyState: 2,
      _receiver: null,
      _sender: null,
      _socket: null,
      _bufferedAmount: 0,
      _isServer: false,
      _redirects: 0,
      _autoPong: true,
      _url: 'wss://www.triggercmd.com/engine.io/?EIO=4&transport=websocket',
      _req: [ClientRequest],
      [Symbol(kCapture)]: false
      },
      [Symbol(kType)]: 'error',
      [Symbol(kError)]: Error: Unexpected server response: 404
      at ClientRequest.<anonymous> (/root/node_modules/ws/lib/websocket.js:912:7)
      at ClientRequest.emit (node:events:517:28)
      at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
      at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
      at TLSSocket.socketOnData (node:_http_client:541:22)
      at TLSSocket.emit (node:events:517:28)
      at addChunk (node:internal/streams/readable:368:12)
      at readableAddChunk (node:internal/streams/readable:341:9)
      at Readable.push (node:internal/streams/readable:278:10)
      at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23),
      [Symbol(kMessage)]: 'Unexpected server response: 404'
      },
      context: undefined,
      type: 'TransportError'
      }

      Computer name for Local Home Assistant listener: null
      Error fetching computer name: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
      at Object.writeFile (node:fs:2269:5)
      at /root/gitrepo/TRIGGERcmd-Agent/src/ha.js:120:10
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
      code: 'ERR_INVALID_ARG_TYPE'
      }
      Initiated command removals
      Initiated command adds
      Failed while trying add a trigger.
      Failed while trying add a trigger.
      ^C
      root@OpenWrt:~/gitrepo/TRIGGERcmd-Agent# node ./src/agent.js --console
      Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
      Daemon install: false
      Logging in with saved token.
      Checking if the computer exists.
      This computer exists in your account.
      Tokenfile: /root/.TRIGGERcmdData/token.tkn
      ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
      Logging in with saved token to run foreground tasks.
      Local Home Assistant listener is disabled.
      Write backup completed.
      Computer name for Local Home Assistant listener: null
      Error fetching computer name: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
      at Object.writeFile (node:fs:2269:5)
      at /root/gitrepo/TRIGGERcmd-Agent/src/ha.js:120:10
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
      code: 'ERR_INVALID_ARG_TYPE'
      }
      Initiated command removals

      The socket was unable to connect.
      The server may be offline, or the
      socket may have failed authorization
      based on its origin or other factors.
      You may want to check the values of
      sails.config.sockets.onlyAllowOrigins
      or (more rarely) sails.config.sockets.beforeConnect
      in your app.
      More info: https://sailsjs.com/config/sockets
      For help: https://sailsjs.com/support

      Technical details:
      TransportError: websocket error
      at WS.onError (/root/node_modules/engine.io-client/build/cjs/transport.js:48:37)
      at ws.onerror (/root/node_modules/engine.io-client/build/cjs/transports/websocket.js:57:39)
      at callListener (/root/node_modules/ws/lib/event-target.js:290:14)
      at WebSocket.onError (/root/node_modules/ws/lib/event-target.js:230:9)
      at WebSocket.emit (node:events:517:28)
      at emitErrorAndClose (/root/node_modules/ws/lib/websocket.js:1035:13)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      description: ErrorEvent {
      [Symbol(kTarget)]: WebSocket {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      _binaryType: 'nodebuffer',
      _closeCode: 1006,
      _closeFrameReceived: false,
      _closeFrameSent: false,
      _closeMessage: <Buffer >,
      _closeTimer: null,
      _extensions: {},
      _paused: false,
      _protocol: '',
      _readyState: 2,
      _receiver: null,
      _sender: null,
      _socket: null,
      _bufferedAmount: 0,
      _isServer: false,
      _redirects: 0,
      _autoPong: true,
      _url: 'wss://www.triggercmd.com/engine.io/?EIO=4&transport=websocket',
      _req: [ClientRequest],
      [Symbol(kCapture)]: false
      },
      [Symbol(kType)]: 'error',
      [Symbol(kError)]: Error: Unexpected server response: 404
      at ClientRequest.<anonymous> (/root/node_modules/ws/lib/websocket.js:912:7)
      at ClientRequest.emit (node:events:517:28)
      at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
      at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
      at TLSSocket.socketOnData (node:_http_client:541:22)
      at TLSSocket.emit (node:events:517:28)
      at addChunk (node:internal/streams/readable:368:12)
      at readableAddChunk (node:internal/streams/readable:341:9)
      at Readable.push (node:internal/streams/readable:278:10)
      at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23),
      [Symbol(kMessage)]: 'Unexpected server response: 404'
      },
      context: undefined,
      type: 'TransportError'
      }

      Initiated command adds
      Failed while trying add a trigger.
      Failed while trying add a trigger.

      1. on my account now I can see the openwrt instance but with the red icon and it isn't working.

      Can help me to let daemon working proprly please?

      Thanks for support
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • startup service for openwrt

      Good evening,
      wiht this command I'm able to start triggercmd agent:

      node /gitrepo/TRIGGERcmd-Agent/src/daemon.js --run /root/.TRIGGERcmdData
      

      so I have created "triggercmdservice", putted it into /etc/init.d folder and assigned excute rights.
      The code for the service is:

      #!/bin/sh /etc/rc.common
      
      START=95
      start_service() {
      node /gitrepo/TRIGGERcmd-Agent/src/daemon.js --run /root/.TRIGGERcmdData
      
      }
      

      but seems to not working. Only If I execute directly previous commad, trggercmd works.
      Can you help to fix the problem please?

      thanks for support
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @eromano resolved by a new install from zero.
      Maybe the problem was that at the first execute was already present another machine

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @Russ said in TriggerCMD on openMPTCP a fork of openwrt project:

      npm install socket.io

      thank you very much.

      Now I have installed the agent finally.

      I have created a service file put into init.d folder with code:

      #!/bin/sh /etc/rc.common
      
      START=95
      start_service() {
          node /tmp/gitrepo/TRIGGERcmd-Agent/src/daemon.js --run /root/.TRIGGERcmdData
      }
      

      Do you tink is it right or Mmay I cahnge the command?

      Then Into the web paanel I can see my router but the trigger standard already present aren't loaded

      Screenshot 2024-03-02 alle 18.28.07.png

      How you can see if I click on "View Triggers" nothing is loaded

      Screenshot 2024-03-02 alle 18.31.39.png

      if I execute the command:
      nano /root/.TRIGGERcmdData/commands.json

      I can see that default triggers are present:

      Screenshot 2024-03-02 alle 18.34.06.png

      How can I fix it?

      PS. before to create the service I tried to execute the command:

      node ./src/agent.js --console

      and the result was
      Screenshot 2024-03-02 alle 18.41.26.png

      Why it fail to add the trigger?
      Do you think that can be this the problem?

      thanks for help Russ
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @Russ if I try to run:

      node ./src/agent.js --console

      without npm installed first I obtain:

      root@OpenMPTCProuter:/tmp/gitrepo/TRIGGERcmd-Agent# node ./src/agent.js --console
      internal/modules/cjs/loader.js:905
      throw err;
      ^

      Error: Cannot find module 'socket.io-client'
      Require stack:

      • /tmp/gitrepo/TRIGGERcmd-Agent/src/agent.js
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
        at Function.Module._load (internal/modules/cjs/loader.js:746:27)
        at Module.require (internal/modules/cjs/loader.js:974:19)
        at require (internal/modules/cjs/helpers.js:93:18)
        at Object.<anonymous> (/tmp/gitrepo/TRIGGERcmd-Agent/src/agent.js:42:22)
        at Module._compile (internal/modules/cjs/loader.js:1085:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
        at Module.load (internal/modules/cjs/loader.js:950:32)
        at Function.Module._load (internal/modules/cjs/loader.js:790:12)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
        code: 'MODULE_NOT_FOUND',
        requireStack: [ '/tmp/gitrepo/TRIGGERcmd-Agent/src/agent.js' ]
        }

      but if execute

      npm install

      I arrive here:

      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! electron@27.0.4 postinstall: node install.js
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the electron@27.0.4 postinstall script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

      npm ERR! A complete log of this run can be found in:
      npm ERR! /root/.npm/_logs/2024-03-02T01_18_56_589Z-debug.log

      but now if I execute

      node ./src/agent.js --console

      It ask for the token.
      Any Idea to fix the errors? Can I skip them?

      thanks a lot for your support
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @Russ thank for your help.
      Restarted from zero again and installed only the npm
      So now I'm in this situation:

      running the code:

      node ./src/agent.js --console

      I obtain:

      internal/modules/cjs/loader.js:905
      throw err;
      ^

      Error: Cannot find module '/tmp/gitrepo/TRIGGERcmd-Agent/agent.js'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
      at Function.Module._load (internal/modules/cjs/loader.js:746:27)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
      at internal/main/run_main_module.js:17:47 {
      code: 'MODULE_NOT_FOUND',
      requireStack: []
      }

      What I have to do?

      Many thanks for your support
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @Russ said in TriggerCMD on openMPTCP a fork of openwrt project:

      node ./src/agent.js --console

      ok now if I execute

      node ./src/agent.js --console

      it ask me for the token

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      Ok retring to install from zero, after cloning the report in a tmp folder a renaming the file ubuntu pakage to package.json, installation went on but now I'm here with this new error:

      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! electron@27.0.4 postinstall: node install.js
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the electron@27.0.4 postinstall script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

      npm ERR! A complete log of this run can be found in:
      npm ERR! /root/.npm/_logs/2024-03-02T00_19_09_885Z-debug.log

      Any suggests to me?

      thanks
      Egidio

      posted in Raspberry Pi
      E
      eromano
    • RE: TriggerCMD on openMPTCP a fork of openwrt project

      @eromano said in TriggerCMD on openMPTCP a fork of openwrt project:

      npm ERR! code ENOSPC

      this is the result of the mount command :

      /dev/root on /rom type ext4 (rw,noatime)
      devtmpfs on /rom/dev type devtmpfs (rw,relatime,size=918428k,nr_inodes=229607,mode=755)
      proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
      sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
      cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
      /dev/mmcblk0p2 on / type ext4 (rw,relatime)
      /dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
      tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
      devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
      debugfs on /sys/kernel/debug type debugfs (rw,noatime)
      none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
      mountd(pid5152) on /tmp/run/blockd type autofs (rw,relatime,fd=7,pgrp=1,timeout=21474836510,minproto=5,maxproto=5,indirect)

      posted in Raspberry Pi
      E
      eromano