Skip to content

SW_ConfigCmdLine

Rolf Obrecht edited this page Dec 7, 2022 · 21 revisions

Configuration by Command Line Arguments

telex.py as the main routine of piTelex can be called with a bunch of cmdline arguments. These are primarily meant for temporary overriding or generation of the main configuration file, which defaults to telex.json. Your final configuration should be represented by this file, so that specifying command line arguments should be obsolete, except perhaps -c to specify the correct config file (this could be necessary e.g. if you plan to run more than one instance of pitelex from the same account).

Below is a list of all command line parameters together with a short explanation, as well as a link to further corresponding documentation.

You can also get a summary of the command line arguments by calling telex.py --help.

piTelex Arguments

Teletype interfaces

arg
short
arg
long
Description default See also
-G --RPiTW39 enable GPIO on RPi
with TW39 teletype
false RPiTTY
--RPiCtrl enable RPi button controls and LEDs false RPiCtrl
-X --terminal set serial terminal device (8-bit ASCII) none Terminal
-Y <TTY> --tty <TTY> use CH340 USB adapter
with teletype w/o dialling
none CH340TTY
-W <TTY> --ttyTW39 <TTY> use CH340 USB adapter
with TW39 teletype (pulse dial)
none CH340TTY
-M <TTY> --ttyTW39 <TTY> use CH340 USB adapter
with TWM teletype (keypad dial)
none CH340TTY
-V <TTY> --ttyV10 <TTY> use CH340 USB adapter
with V.10 teletype (FS220,FS200)
none CH340TTY
-E --audioED1000 enable USB sound card
with ED1000 teletype
false ED1000
--noscreen disable screen I/O true Screen

Gateways to the Outside World

arg
short
arg
long
Description default See also
-I <port> --iTelex <port> enable i-Telex client (and server if <port> > 0) -1 iTelexClient
iTelexServer
-N <path> --news <path> enable newsticker (news in folder <path>) none News
-T <twa> --twitter <twa> enable twitter client (access details in , see docs) none Twitter
--twitterv2 <twa> enable twitter client (access details in , see docs) none Twitter
-C <chan> --IRC <chan> enable IRC Client with channel <chan> none IRC
-R <templ> --REST <templ> enable REST client with Template <templ> none REST

Further options

arg
short
arg
long
Description default See also
-Z --eliza enable Eliza chat bot false Eliza
-A --archive enable archive module false Archive
-S --shellcmd enable dictionary of shellcommands false ShellCmd
-L <file> --log <file> Log all incoming and outgoing characters to <file> none Log
-d <level> --debug <level> turn on debugging at<level> 0 deprecated
-c <file> --config <file> set name of central confguration file ./telex.json ConfigFile
-k <id> --id <id> set machine id ("Kennungsgeber")
leave empty to use Hardware ID
none ConfigFile:
wru_id
--id-fallback use software id (set with -k)
in case of hardware failure
false ConfigFile:
wru_replace_always
--errorlogpath <path> specify path of errlog directory ./ ConfigFile:
errorlog_path
-q --quiet disable status messages to stdout true
-s --save write actual config to configfile false
-h --help display help message and exit

With the arguments above only a subset of program and module properties can be set. telex.json can (and probably must) be fine-tuned by editing it by hand with a text editor of your choice.

Initial setup

Instead of fiddling with the full blown telex.json from the distribution which contains nearly all possible combinations and variants and therefore might be confusing for the first time user, you can use a more convenient method described below.

  1. Optional, but recommended: save the original telex.json for future use, e.g.:

      cp telex.json telex.json.orig
    
  2. produce a stripped down config file that is tailored to your needs. For a standard current loop TW39 setup with i-Telex connectivity on port 2342 this could be achieved by e.g.

     ./telex.py --RPiTW39 --iTelex 2342 --log pitelex.log --id "134567 dummy d" --save [--config mypitelexconfig.json]
    

    If you omit the specification of a file name by --config, the default file telex.json will be overwritten without warning.

  3. After that,telex.json resp. mypitelexconfig.json contains your 'bare metal' config, equipped with default settings.

  4. You may now edit the file to reflect non-standard conditions (e.g. different GPIO-lines). For this fine tuning all options from section Configuration file can be used.

With a fine-tuned config-file the cmdline args can be omitted when calling telex.py - unless you want to temporarily add/overwrite a feature.

Hint: Remember to pass the correct filename to 'telex.py' (e.g. ./telex.py -c mypitelexconfig.json) if you did not overwrite the default file telex.json in step 2 :-)

Clone this wiki locally