Loading...
 
Print

AdminCommands

Table of contents:

Overview
  • Admin Commands:
    • starting and stopping pimucHA process
    • starting and stopping controller thread
    • setup controller
    • load and unload controller features
    • run startscript macros
  • These commands are launched:
    • locally
    • on the system running pimucHA
    • using coroutine sysevents for processing
    • stop command may be process by RPC in localhost

Changes in 0.8.2
  • No pipe '|' character between arguments
  • Syntax for options
General syntax in version 0.8.2
  • The command is composed by parts separated by white space
    • first part : command itself (case sensitive)
    • second part : first argument of command
    • third part : second argument
  • Second argument may have options
  • The list of options is enclosed with parenthesis
  • No white space between argument and left parenthese

General syntax in version 0.8.1
  • The command is composed by two parts separated by white space
    • left part : command itself (case sensitive)
    • right part : argument of command (all uppercase)
  • Argument of command always started by the name of controller
    • name given by user to identify controller
    • idcontroller choosen in the list : ATIR,CM11,CM15,RFXCOM,RFXTRX,TSDUO
    • separated by pipe '|' character in setup phase and by colon ':' character in other case


Running admin command
Issuing an echo command at OS level
  • After pimucHA was started and is running
  • Open an terminal in the directory where reside sysevents.log
  • Run the echo command
  • With redirection / append to sysevents.log
  • domo@hpc:~/temp/pimucHA-0.8.1$ echo 'RUNscript STOPALL' >> sysevents.log
  • 'ThreadSYSLOGF' will read the line added to sysevents.log
  • and transmit to coroutine sysevents for processing

Using console.py
  • After pimucHA was started and is running
  • Open an terminal in the directory where reside console.py and sysevents.log
  • Run the script console.py
  • domo@hpc:~/pimucHA-0.8.1d$ python console.py
    ['console.py']
    CMD INPUT INTO sysevents.log 
    Welcome to console!
    =>> RUNscript ATIR
    =>>
  • 'ThreadSYSLOGF' will read the line after user issue return character at keyboard
  • and transmit to coroutine sysevents for processing
  • Enter QUIT to quit console.py
  • =>> QUIT
    Exiting...
    domo@hpc:~/pimucHA-0.8.1d$

Using startscript as macro
  • After pimucHA was started and is running
  • Open an terminal in the directory where reside sysevents.log
  • Run at OS level or with script console.py
  • Command 'RUNscript STARTSCRIPT':
    • RUNscript run in a separated thread
    • a script with name as STARTSCRIPT
    • name without extension .scr
Startscript file content
  • Line = Admin command
  • One command per line
  • Blank line ignored
  • Line starting with # (comment) ignored
  • Last line = blank line
Example
  • domo@hpc:~/temp/pimucHA-0.8.1$ echo 'RUNscript STOPALL' >> sysevents.log
  • Script stopall.scr in directory startscript/
  • Two lines = two admin commands
  • that will be processed with 1s interval between
  • STOPall
    STOPsrv SYSLOGF

Using startscript at startup
  • To start pimucHA with script atir.scr
  • Open an terminal at package root directory
  • domo@hpc:~/pimucHA-0.8.1d$ python -m piHAcore.startm -d ATIR
  • Argument use when starting pimucHa with piHAcore.startm
  • Name of the startscript without path and extension
  • Script atir.scr in directory startscript/
  • SETUPctrl AMCT|ATIR
    STARTsrv ALLRXTX_AMCT:ATIR
    
    #ADDParser AMCT:ATIR
    #ADDDecoder AMCT:ATIR|RXREMOTE([DEBUG,LOG2FILE])
  • Log of startup execution
  • domo@hpc:~/pimucHA-0.8.1d$ python -m piHAcore.startm -d ATIR
     : No module named rfxtrxlibs
    Module RFXTRX not yet installed
     : No module named rfxtrxlibs
    Module RFXTRX not yet installed
    No handlers could be found for logger "root"
    RFXtrx modules not yet installed
    Command line arguments : {'debug': True, 'startscript': 'ATIR'}
    classlogf - 2014-02-25 14:44:42,358 DEBUG Opening sysevents.log....
    classlogf - 2014-02-25 14:44:42,359 WARNING Logfile sysevents.log opened
    ThreadSYSLOGF started and active...
    INPUTPARSER started and active...
    Executing startscript/atir.scr...
    syslogf - 2014-02-25 14:44:42,362 DEBUG Writing SETUPctrl AMCT|ATIR to logfile sysevents.log
    syslogf - 2014-02-25 14:44:43,365 DEBUG Writing STARTsrv ALLRXTX_AMCT:ATIR to logfile sysevents.log
    usbtools - 2014-02-25 14:44:43,368 DEBUG Finding USB device with Id 0bc7:0004....
    devusb - 2014-02-25 14:44:43,412 WARNING USB device found at 0x05:0x02
    atir - 2014-02-25 14:44:43,413 DEBUG Test reading ATIR....
    devusb - 2014-02-25 14:44:43,420 DEBUG Read ['0x14', '0xc6', '0x01', '0xf0']
    atir - 2014-02-25 14:44:43,421 WARNING ATIR Ready....
    controller - 2014-02-25 14:44:43,421 DEBUG Added in SetupControllers {'AMCT:ATIR': }
    coresetup - 2014-02-25 14:44:43,421 WARNING Daemon of Controller correctly setup : 
    CONTROLLEROf_AMCT:ATIR starting...
    coresetup - 2014-02-25 14:44:43,422 INFO Command started for ALLRXTX_AMCT:ATIR

Using autostart at startup
  • To start pimucHA with script autostart.scr
  • Open an terminal at package root directory
  • domo@hpc:~/pimucHA-0.8.1d$ python -m piHAcore.startm -d
  • No argument use when starting pimucHa with piHAcore.startm
  • Script autostart.scr in directory startscript/
  • SETUPsrv RPC1|RPCS
    STARTsrv STARTS_RPC1:RPCS
    
    #SETUPctrl AMCT|ATIR
    #STARTsrv ALLRXTX_AMCT:ATIR
    
    #SETUPnetctrl BMCT|NCM15-192.168.3.103:9999-RX
    #STARTsrv ALLRXTX_BMCT:NCM15
    
    #SETUPnetctrl CMCT|NCM11-192.168.3.148:9000-RX
    #STARTsrv ALLRXTX_CMCT:NCM11
  • Log of startup execution
  • domo@hpc:~/pimucHA-0.8.1d$ python -m piHAcore.startm -d
     : No module named rfxtrxlibs
    Module RFXTRX not yet installed
     : No module named rfxtrxlibs
    Module RFXTRX not yet installed
    No handlers could be found for logger "root"
    RFXtrx modules not yet installed
    Command line arguments : {'debug': True, 'startscript': 'autostart'}
    classlogf - 2014-02-25 14:54:03,104 DEBUG Opening sysevents.log....
    classlogf - 2014-02-25 14:54:03,104 WARNING Logfile sysevents.log opened
    ThreadSYSLOGF started and active...
    INPUTPARSER started and active...
    Executing startscript/autostart.scr...
    syslogf - 2014-02-25 14:54:03,107 DEBUG Writing SETUPsrv RPC1|RPCS to logfile sysevents.log
    syslogf - 2014-02-25 14:54:04,110 DEBUG Writing STARTsrv STARTS_RPC1:RPCS to logfile sysevents.log
    coresetup - 2014-02-25 14:54:04,111 WARNING Daemon of server correctly setup : 
    Listening at address localhost on port number 8000...
    RPCServer RPC1:RPCS started and active...
    
    coresetup - 2014-02-25 14:54:04,114 INFO Command started for STARTS_RPC1:RPCS