SW_ConfigInitial - fablab-wue/piTelex GitHub Wiki
Initial setup
Overview
Instead of messing around with the complete telex.json from the distribution, which can be confusing for the first-time user, you can use a more convenient method to get a usable configuration file: Just let piTelex write the file according to your requirements...
Background
At startup, piTelex tries to read its configuration file (either the default one or the one given by -c |--config). If no configuration file can be found, piTelex throws a warning message and starts with built in defaults. The values from this first step make up the initial configuration. In a second step, piTelex looks at command line arguments. These add features and possibly overwrite values from the first step; devices specified by command line arguments will contain default values for their specific options. Specifying the command line argument -s  | --save lets piTelex finally write out the resulting configuration back to the file (default or given in -c).
Recipe:
- 
Strongly recommended: save the original telex.jsonfor future use, e.g.:cp telex.json telex.json.origThe file contains a bunch of templates for different device configurations together with short explanations. It should be kept for information purposes. 
- 
Call telex.pywith the command line parameters of your choice plus--saveand--config=parameters. For a standard current loop TW39 setup with i-Telex connectivity on port 2342 and logging enabled this can be./telex.py --config "myconfig.json" --RPiTW39 --iTelex 2342 --log "pitelex.log" --id "134567 dummy d" --saveThis calls telex.pywith all values frommyconfig.json(if it exists), adds or overwrites them with the specified features from the command line, and writes the resulting configuration back tomyconfig.json. To start from scratch, just give piTelex in-c | --configa nonexistent or empty file.[!TIP] You may even start without any telex hardware, just focusing on a mere "software telex" driven by the screen module. 
- 
After piTelex has started successfully you can terminate it by Ctrl-C. Nowmyconfig.jsoncontains your 'bare metal' config, as you requested:{ "devices": { "screen": { "type": "screen", "enable": true, "show_BuZi": true, "show_capital": false, "show_ctrl": true, "show_info": false }, "RPiTTY": { "type": "RPiTTY", "enable": true, "pin_txd": 17, "pin_rxd": 27, "inv_rxd": false, "pin_relay": 22, "inv_relay": false, "pin_dir": 0, "pin_number_switch": 6, "baudrate": 50, "coding": 0, "loopback": true }, "i-Telex": { "type": "i-Telex", "enable": true, "port": 2342, "tns_dynip_number": 0, "tns_pin": 12345 }, "log": { "type": "log", "enable": true, "filename": "pitelex.log" } }, "wru_id": "134567 DUMMY D"
- 
You can now edit the file for fine tuning or to reflect non-standard conditions (e.g. different GPIO-lines). Therefore all options from section Configuration file can be used. With a fine tuned configuration file the cmdline args can be omitted in the future when calling telex.py-- unless you want to add or change a feature temporarily.[!Important] Remember to pass the correct filename of your new configuration file to 'telex.py' (e.g. ./telex.py -c myconfig.json) if you did not overwrite the default filetelex.jsonin step 2 :-)[!NOTE] For a complete list of command line arguments see Command Line Arguments