SW_DevMCP - fablab-wue/piTelex GitHub Wiki

Device Module "MCP"

Description

The "MCP" Module (= Main Control Program? ) builds the central control instance for all the other modules. All modules read and write from/to a shared buffer, and the main routine telex.py hands out the buffer contents to all enabled device modules in sequence. Each device module can/react on the contents of the buffer which may hold text or commands, and finally write its results back to the buffer for further recognition/processing by the other modules (and MCP).

MCP contains the central "heartbeat" of the system, it monitors the different status of piTelex, issues commands to the other modules depending on the actual status, reads result codes from the modules and updates the current status of the system.

Main status codes

Code Name Description
ZZ Sleeping StandBy, Teleprinter off, waiting for action
Z Offline Teleprinter may be on (depending on module)
WB Dialing
"WählBereit"
1. Ready to dial
A ActiveInit Connection established, printer start command sent
AA ActiveReady Connection established, printer ready

Issuing commands

Commands are identified by a preceeding <ESC>, therefore issuing <ESC>-A<Enter> e.g. in the screen module will switch the teleprinter on and will output someting like <MCP:TP1><piT:AA>.

These are messages from different modules. To the left of the colon is the abbreviated module identifier, to the right the output of the module. In the above example MCP reacts to our A command by giving the command to switch in the teleprinter; after execution of the 'printer on' command the RPiTTY module sends message AA (printer ready).

Important

For debbuging purposes you can use most of these codes as commands (i.e. embedded in <ESC> and <Enter>) to force the system into a specific state. But keep in mind that this might lead to an uncertain overall behaviour, because normal state transition conditions are neglected and overridden. For more commands see Screen Module

Available Module Identifiers

ID Module
??? txBase
Arc Archive
chT CH340TTY
edS ED1000SC
Eza Eliza
IRC IRC
iTc ITelexClient
iTs ITelexSrv / ITelexCentralex
Log Log
MCP MCP
Nws News
Rst REST
piC RPiCtrl
piT RPiTTY
Scn Screen
ShC ShellCmd
Trm Terminal
Baf Babelfish
KPd KeyPad
RSS RSS

Module Information

System

System Comments
RPi OK
PC Linux OK
PC Windows OK
Mac OK

Config File Parameter

Parameter Default Type or range Comment
devices {} dict Dictionary of device-node-IDs (modules)
errorlog_path error_log string Directory path for error log
errorlog_level "INFO" "NOTSET", "DEBUG",
"INFO", "WARN",
"ERROR", "CRITICAL"
verbosity of error log (see python manual)
wru_id [none] string Software-WRU-ID
wru_replace_always false false / true if true, always replace Hardware-WRU by Software-WRU
continue_with_no_printer true false / true if true, ignore missing / faulty printer device; if false, abort connections if teleprinter to start up
power_off_delay 20 non-neg. int time in seconds from end-of-conection until switching off TTY power
power_button_timeout 300 non-neg. int time in seconds from switching on TTY power by means of button PT until switch off PWR
dial_timeout 2.0 '+‘ / float (0.0...55.0) idle time after last dialled digit to start dial process;
if ‚+‘, „plus-dialling“ selected,
if ‚0‘, instant dialling is used (see Configuration File )
welcome_msg true false/true if true, print the welcome msg (DateTime stamp) at connection start
⚠️ **GitHub.com Fallback** ⚠️