From cc95d6f89282c9d66120f2a9b40a9aaff2f981bb Mon Sep 17 00:00:00 2001 From: fmertz Date: Wed, 24 Jun 2020 16:25:21 +0000 Subject: system display: T2564 Extend VyOS to support appliance LCDs Added support for system LCDs under CLI system display +data/templates/system-display/LCDd.conf.tmpl template for LCDd server configuration file +data/templates/system-display/lcdproc.conf.tmpl template for lcdproc client configuration file +interface-definitions/system-display.xml.in CLI for system display +src/conf_mode/system-display.py processing code for system display +src/systemd/lcdproc.service systemd service definition file for lcdproc client CLI: system display model (SDEC|EZIO) system display config (enabled|disabled) system display show host (cpu|cpu-all|cpu-hist|disk|load-hist|memory|proc|uptime) network interface alias units (bps|Bps|pps) clock (big|mini|date-time) title system display duration system display hello system display bye --- interface-definitions/system-display.xml.in | 245 ++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 interface-definitions/system-display.xml.in (limited to 'interface-definitions') diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in new file mode 100644 index 000000000..7a5cf9283 --- /dev/null +++ b/interface-definitions/system-display.xml.in @@ -0,0 +1,245 @@ + + + + + + + + System display LCD/VFD/LED + 400 + + + + + + Model of the display attached to this system [REQUIRED] + + SDEC EZIO + + + (SDEC|EZIO) + + Invalid system display model + + SDEC + Display model for Lanner, Watchguard, Nexcom NSA, Sophos UTM appliances with built-in SDEC LCD + + + EZIO + Display model for Portwell, Caswell appliances with built-in EZIO-100 or EZIO-300 LCD + + + + + + + Configuration status + + enabled disabled + + + (enabled|disabled) + + Invalid system display config status + + enabled + Turn system display configuration ON + + + disabled + Turn system display configuration OFF + + + + + + Select the screens for the system display [REQUIRED] + + + + + + + Select host screens for the system display + + cpu cpu-all cpu-hist disk load-hist memory proc uptime + + + (cpu|cpu-all|cpu-hist|disk|load-hist|memory|proc|uptime) + + Invalid host screen + + cpu + Detailed CPU usage + + + cpu-all + CPU usage overview (one line per CPU) + + + cpu-hist + CPU usage histogram + + + disk + File systems fill level + + + load-hist + Load histogram + + + memory + Memory and swap usage + + + proc + Top processes by size + + + uptime + System uptime + + + + + + + Network settings for system display + + + + + + Show network traffic on the system display [Max 3 interfaces] + + + + + + + + Interface alias + + [A-Za-z0-9]{1,10} + + Invalid alias, must be 1 to 10 char or digit + + + + + + + + Unit for network details + + bps Bps pps + + + (bps|Bps|pps) + + Invalid network detail unit + + bps + Bit(s) per second + + + Bps + Byte(s) per second + + + pps + Packet(s) per second + + + + + + + + + + Show a clock on the system display + + big mini date-time + + + (big|mini|date-time) + + Invalid clock format + + big + Multi-line clock + + + mini + Minimal clock + + + date-time + Clock with Date and Time + + + + + + + Screen title to show on the system display + + [A-Za-z0-9]{1,16} + + Invalid title, must be 1 to 16 char or digit + + + + + + + + Time in sec to show each screen on the system display + + 1-30 + Numer of seconds + + + + + + + + + + Message to show when system display first starts + + .{1,16} + + Hello message must be 1 to 16 char + + + + + + Message to show when system display stops + + .{1,16} + + Bye message must be 1 to 16 char + + + + + + + -- cgit v1.2.3 From 3e8b6841db6ab803b898376754b469954d212cf7 Mon Sep 17 00:00:00 2001 From: fmertz Date: Sun, 28 Jun 2020 18:27:11 +0000 Subject: system display: T2564: Lowercase model names * data/templates/system-display/LCDd.conf.tmpl Lowercase sdec ezio * interface-definitions/system-display.xml.in Lowercase sdec ezio --- data/templates/system-display/LCDd.conf.tmpl | 6 +++--- interface-definitions/system-display.xml.in | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'interface-definitions') diff --git a/data/templates/system-display/LCDd.conf.tmpl b/data/templates/system-display/LCDd.conf.tmpl index 0b605e09d..8079dcb76 100644 --- a/data/templates/system-display/LCDd.conf.tmpl +++ b/data/templates/system-display/LCDd.conf.tmpl @@ -52,11 +52,11 @@ DriverPath=/usr/lib/x86_64-linux-gnu/lcdproc/ # Olimex_MOD_LCD1x9, picolcd, pyramid, rawserial, sdeclcd, sed1330, # sed1520, serialPOS, serialVFD, shuttleVFD, sli, stv5730, svga, t6963, # text, tyan, ula200, vlsys_m428, xosd, yard2LCD -{%- if model == 'SDEC' %} +{%- if model == 'sdec' %} Driver=sdeclcd {%- endif %} -{%- if model == 'EZIO' %} +{%- if model == 'ezio' %} Driver=hd44780 {%- endif %} @@ -544,7 +544,7 @@ Speed=19200 ## Hitachi HD44780 driver ## [hd44780] -{%- if model == 'EZIO' %} +{%- if model == 'ezio' %} ConnectionType=ezio Device=/dev/ttyS1 Keypad=yes diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in index 7a5cf9283..ac9f17b6c 100644 --- a/interface-definitions/system-display.xml.in +++ b/interface-definitions/system-display.xml.in @@ -1,7 +1,7 @@ + Model of the display attached to this system [REQUIRED] - SDEC EZIO + sdec ezio - (SDEC|EZIO) + (sdec|ezio) Invalid system display model - SDEC + sdec Display model for Lanner, Watchguard, Nexcom NSA, Sophos UTM appliances with built-in SDEC LCD - EZIO + ezio Display model for Portwell, Caswell appliances with built-in EZIO-100 or EZIO-300 LCD -- cgit v1.2.3 From f3e0a409ee01e1b3ffa0c9a267434a7725f61231 Mon Sep 17 00:00:00 2001 From: fmertz Date: Sun, 28 Jun 2020 20:36:19 +0000 Subject: system display: T2564: Replace "config (enabled|disabled)" with "display disabled" * interface-definitions/system-display.xml.in system disply disabled * src/conf_mode/system-display.py system display disabled --- interface-definitions/system-display.xml.in | 26 ++++++-------------------- src/conf_mode/system-display.py | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) (limited to 'interface-definitions') diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in index ac9f17b6c..afa6dba10 100644 --- a/interface-definitions/system-display.xml.in +++ b/interface-definitions/system-display.xml.in @@ -2,7 +2,6 @@ @@ -42,27 +42,13 @@ - - + + - Configuration status - - enabled disabled - - - (enabled|disabled) - - Invalid system display config status - - enabled - Turn system display configuration ON - - - disabled - Turn system display configuration OFF - + Disable sytem display + - + Select the screens for the system display [REQUIRED] diff --git a/src/conf_mode/system-display.py b/src/conf_mode/system-display.py index 4db375d8e..e30d591cc 100755 --- a/src/conf_mode/system-display.py +++ b/src/conf_mode/system-display.py @@ -66,7 +66,7 @@ def verify(c): return None def apply(c): - if not c or c['config'] == 'disabled': + if not c or 'disabled' in c.keys(): # Stop client first run('systemctl stop lcdproc.service') # Stop server next -- cgit v1.2.3 From d4199a17adeac422882013a8951d18b7c3b74f2a Mon Sep 17 00:00:00 2001 From: fmertz Date: Mon, 29 Jun 2020 14:45:57 +0000 Subject: system display: T2564: Changed "duration" to "time" * data/templates/system-display/LCDd.conf.tmpl duration to time * interface-definitions/system-display.xml.in duration to time --- data/templates/system-display/LCDd.conf.tmpl | 2 +- interface-definitions/system-display.xml.in | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'interface-definitions') diff --git a/data/templates/system-display/LCDd.conf.tmpl b/data/templates/system-display/LCDd.conf.tmpl index 8079dcb76..0ef796c76 100644 --- a/data/templates/system-display/LCDd.conf.tmpl +++ b/data/templates/system-display/LCDd.conf.tmpl @@ -92,7 +92,7 @@ GoodBye="{%- if bye %}{{ bye }}{%- else %}Bye from VyOS{%- endif %}" #FrameInterval=125000 # Sets the default time in seconds to displays a screen. [default: 4] -WaitTime={%- if duration %}{{ duration }}{%- else%}4{%- endif %} +WaitTime={%- if time %}{{ time }}{%- else%}4{%- endif %} # If set to no, LCDd will start with screen rotation disabled. This has the # same effect as if the ToggleRotateKey had been pressed. Rotation will start diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in index afa6dba10..0439288a0 100644 --- a/interface-definitions/system-display.xml.in +++ b/interface-definitions/system-display.xml.in @@ -8,7 +8,7 @@ clock (big|mini|date-time) title - system display duration + system display time system display hello system display bye system display disabled @@ -191,8 +191,8 @@ - - + + Time in sec to show each screen on the system display @@ -203,7 +203,7 @@ - + -- cgit v1.2.3 From b5e0a1796cc7887245ae79c759f709e1705f5e93 Mon Sep 17 00:00:00 2001 From: fmertz Date: Sun, 5 Jul 2020 15:58:33 +0000 Subject: system display: T2564: Added test model * data/templates/system-display/LCDd.conf.tmpl * interface-definitions/system-display.xml.in May need to ba backed out, test code only for USB CrystalFontz CF533 --- data/templates/system-display/LCDd.conf.tmpl | 45 +++++++--------------------- interface-definitions/system-display.xml.in | 10 +++++-- 2 files changed, 17 insertions(+), 38 deletions(-) (limited to 'interface-definitions') diff --git a/data/templates/system-display/LCDd.conf.tmpl b/data/templates/system-display/LCDd.conf.tmpl index 0ef796c76..1dd646202 100644 --- a/data/templates/system-display/LCDd.conf.tmpl +++ b/data/templates/system-display/LCDd.conf.tmpl @@ -60,6 +60,10 @@ Driver=sdeclcd Driver=hd44780 {%- endif %} +{%- if model == 'test' %} +Driver=CFontzPacket +{%- endif %} + # Tells the driver to bind to the given interface. [default: 127.0.0.1] #Bind=127.0.0.1 @@ -191,44 +195,15 @@ Reboot=no ## CrystalFontz packet driver (for CFA533, CFA631, CFA633 & CFA635) ## [CFontzPacket] - -# Select the LCD model [default: 633; legal: 533, 631, 633, 635] -Model=633 - -# Select the output device to use [default: /dev/lcd] -Device=/dev/ttyS1 - -# Set the initial contrast [default: 560; legal: 0 - 1000] +{%- if model == 'test' %} +Model=533 +Device=/dev/serial/by-bus/usb0b1.1p1.0 Contrast=350 - -# Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 - -# Set the initial off-brightness [default: 0; legal: 0 - 1000] -# This value is used when the display is normally -# switched off in case LCDd is inactive OffBrightness=50 - -# Reinitialize the LCD's BIOS on driver start. [default: no; legal: yes, no] Reboot=yes - -# Enable the USB flag if the device is connected to an USB port. For -# serial ports leave it disabled. [default: no; legal: yes, no] -#USB=yes - -# Very old 633 firmware versions do not support partial screen updates using -# 'Send Data to LCD' command (31). For those devices it may be necessary to -# enable this flag. [default: no; legal: yes, no] -#OldFirmware=yes - -# Override the LCD size known for the selected model. Usually setting this -# value should not be necessary. -#Size=20x4 - -# Override the default communication speed known for the selected model. -# Default value depends on model [legal: 19200, 115200] -#Speed=115200 - +USB=yes +{%- endif %} ## Curses driver ## @@ -546,7 +521,7 @@ Speed=19200 [hd44780] {%- if model == 'ezio' %} ConnectionType=ezio -Device=/dev/ttyS1 +Device=/dev/ttyUSB0 Keypad=yes Size=16x2 KeyMatrix_4_1=Enter diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in index 0439288a0..fbd897996 100644 --- a/interface-definitions/system-display.xml.in +++ b/interface-definitions/system-display.xml.in @@ -1,7 +1,7 @@ -- cgit v1.2.3