SW_MainsPower - fablab-wue/piTelex GitHub Wiki
In some cases, it makes sense not to leave the telex equipment constantly connected to the mains, for example due to questionable electrical safety of very old devices. In such cases, an energy-saving circuit is recommended which only powers up the devices for the duration of an incoming call and, for outgoing calls, only after a push button has been pressed, for a defined maximum time or until the button is pressed again.
This solution requires a RaspBerry Pi with device module RPiCtrl enabled, and of course, mains voltage handling. The power management can be implemented using the telex.json options
-
"pin_power": <n># use GPIO <n> to control the power relay (H=relay on, L= relay off) -
"inv_power": <bool># if true, use inverted signal (H=relay off, L=relay on)
The output signal at pin_power can be used to control a power relay that switches the mains voltage. Examples of how this can be set up can be found in
The following options complete the control options for the power management:
-
"power_off_delay": <n># wait <n> seconds after poweroff condition before switching off mains -
"pin_button_PT": <n># use GPIO <n> to toggle power condition by pushbutton -
"power_button_timeout": <n># if switched on by power pushbutton, switch off mains after <n> seconds of inactivity (probably forgot to switch off manually...)
Some trade fairs or exhibitions impose strict safety requirements on the devices used and only allow standard-tested, certified devices in the mains voltage range. In these cases, the above solution cannot be used. A purely software-based solution can provide a remedy here:
With device module ShellCmd enabled and configured, piTelex can execute system commands when piTelex internal commands occur. In the following example, TP0 (teleprinter power off) and TP1 (teleprinter power on) are used to send switching commands via curl to a FritzBox router with connected DECT-controlled switchable sockets. (TP0 and TP1 are issued by piTelex internally when the power condition changes.)
"shellcmd": {
"type": "shellcmd",
"enable": true,
"LUT": {
"TP1": "curl -s -o null http://fs200.fritz.box/cm?cmnd=Power%20On",
"TP0": "curl -s -o null http://fs200.fritz.box/cm?cmnd=Power%20Off"
}
}Other WLAN socket systems can be integrated in the same or similar way.
Caution
Single-pole switching of the teletypewriter's power supply only provides protection against electrical hazards if “L” (for “live,” sometimes also marked as “P” for phase) is switched. The German Schuko plug system, for example, does not offer reverse polarity protection. In such systems, only all-pole switching sockets should be used in your own interest.