Colorgraphix 3 5632E: Difference between revisions

From HackRVA
Jump to navigation Jump to search
Yeti (talk | contribs)
Created page with "Overview This document describes the use of ANSI escape codes to control a network-connected display board. It includes instructions for text coloring, screen control, and cursor positioning, as well as guidance on establishing a network connection to the display board or a Lantronix UTS Serial Adapter. ANSI Escape Codes Screen Control: Clear Screen: '\033[2J' clears the entire display. Reset Cursor: '\033[H' moves the cursor to the home position (top-left corner). Cur..."
 
Yeti (talk | contribs)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Colorgraphix 3 5632E==
Overview
Overview
This document describes the use of ANSI escape codes to control a network-connected display board. It includes instructions for text coloring, screen control, and cursor positioning, as well as guidance on establishing a network connection to the display board or a Lantronix UTS Serial Adapter.
This document describes the use of ANSI escape codes to control a network-connected display board. It includes instructions for text coloring, screen control, and cursor positioning, as well as guidance on establishing a network connection to the display board or a Lantronix UTS Serial Adapter.
Line 6: Line 7:


Clear Screen: '\033[2J' clears the entire display.
Clear Screen: '\033[2J' clears the entire display.
Reset Cursor: '\033[H' moves the cursor to the home position (top-left corner).
Reset Cursor: '\033[H' moves the cursor to the home position (top-left corner).
Cursor Positioning:
Cursor Positioning:
Line 13: Line 15:


COLOR_GREEN_BLACK: Green text on a black background. ANSI Code: chr(27) + '[31{'.
COLOR_GREEN_BLACK: Green text on a black background. ANSI Code: chr(27) + '[31{'.
COLOR_RED_BLACK: Red text on a black background. ANSI Code: chr(27) + '[30{'.
COLOR_RED_BLACK: Red text on a black background. ANSI Code: chr(27) + '[30{'.
COLOR_ORANGE_BLACK: Orange text on a black background. ANSI Code: chr(27) + '[29{'.
COLOR_ORANGE_BLACK: Orange text on a black background. ANSI Code: chr(27) + '[29{'.
COLOR_BLACK_GREEN: Black text on a green background. ANSI Code: chr(27) + '[63{'.
COLOR_BLACK_GREEN: Black text on a green background. ANSI Code: chr(27) + '[63{'.
COLOR_BLACK_RED: Black text on a red background. ANSI Code: chr(27) + '[62{'.
COLOR_BLACK_RED: Black text on a red background. ANSI Code: chr(27) + '[62{'.
COLOR_BLACK_ORANGE: Black text on an orange background. ANSI Code: chr(27) + '[61{'.
COLOR_BLACK_ORANGE: Black text on an orange background. ANSI Code: chr(27) + '[61{'.
Network Connection to Display Board
Network Connection to Display Board
TCP/IP Connection:
TCP/IP Connection:
Line 29: Line 37:
IP Address: The IP of the Lantronix adapter.
IP Address: The IP of the Lantronix adapter.
Port: Use port 9999 for the Lantronix UTS Serial Adapter (Model: Snr 1363-058 V3.6).
Port: Use port 9999 for the Lantronix UTS Serial Adapter (Model: Snr 1363-058 V3.6).
Example Usage
 
The script sends ANSI escape codes over a network to the display board or serial adapter to control text display and formatting.
 
It can be used to display messages, control text color, clear the screen, or position the cursor.
 
 
 
import socket
import time
 
COLUMNS = 32
LINES = 4
 
COLOR_GREEN_BLACK = chr(27) + '[31{'
COLOR_RED_BLACK = chr(27) + '[30{'
COLOR_ORANGE_BLACK = chr(27) + '[29{'
COLOR_BLACK_GREEN = chr(27) + '[63{'
COLOR_BLACK_RED = chr(27) + '[62{'
COLOR_BLACK_ORANGE = chr(27) + '[61{'
# Constants
 
DISPLAY_TEXT = "Hack RVA"
DISPLAY_DELAY = 2  # Delay for display in seconds
 
# Establish socket connection
host = '10.200.200.98'  # Replace with the correct host
port = 23              # Replace with the correct port
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((host, port))
 
# Clear the display
sock.sendall(chr(27).encode() + "[2J".encode())
 
# Reset cursor
sock.sendall(chr(27).encode() + "[H".encode())
 
# set cursor position
cursor_position = chr(27) + f'[{2};{10}H'
sock.sendall(cursor_position.encode())
 
# Display the text in
message = COLOR_BLACK_RED + DISPLAY_TEXT
sock.sendall(message.encode())
 
# Wait for a while
time.sleep(DISPLAY_DELAY)
 
# Close the socket
sock.close()
 
 
https://dchote.tumblr.com/post/24206361892/telegenix-led-wallboard-update
 
 
 
[[File:Openhouse5632E.jpeg|400px]]

Latest revision as of 16:57, 5 January 2024

Colorgraphix 3 5632E

Overview This document describes the use of ANSI escape codes to control a network-connected display board. It includes instructions for text coloring, screen control, and cursor positioning, as well as guidance on establishing a network connection to the display board or a Lantronix UTS Serial Adapter.

ANSI Escape Codes Screen Control:

Clear Screen: '\033[2J' clears the entire display.

Reset Cursor: '\033[H' moves the cursor to the home position (top-left corner). Cursor Positioning:

Position Cursor: '\033[{line};{column}H' moves the cursor to the specified line and column. Color Configuration:

COLOR_GREEN_BLACK: Green text on a black background. ANSI Code: chr(27) + '[31{'.

COLOR_RED_BLACK: Red text on a black background. ANSI Code: chr(27) + '[30{'.

COLOR_ORANGE_BLACK: Orange text on a black background. ANSI Code: chr(27) + '[29{'.

COLOR_BLACK_GREEN: Black text on a green background. ANSI Code: chr(27) + '[63{'.

COLOR_BLACK_RED: Black text on a red background. ANSI Code: chr(27) + '[62{'.

COLOR_BLACK_ORANGE: Black text on an orange background. ANSI Code: chr(27) + '[61{'.

Network Connection to Display Board TCP/IP Connection:

To control a display board over a network, establish a TCP socket connection. IP Address: Replace '10.200.200.98' with the actual IP address of your display board. Port: Use port 23 for standard Telnet connections to the display board. Connection to Lantronix UTS Serial Adapter:

For connecting to devices through a Lantronix UTS Serial Adapter, use Telnet. IP Address: The IP of the Lantronix adapter. Port: Use port 9999 for the Lantronix UTS Serial Adapter (Model: Snr 1363-058 V3.6).



import socket import time

COLUMNS = 32 LINES = 4

COLOR_GREEN_BLACK = chr(27) + '[31{' COLOR_RED_BLACK = chr(27) + '[30{' COLOR_ORANGE_BLACK = chr(27) + '[29{' COLOR_BLACK_GREEN = chr(27) + '[63{' COLOR_BLACK_RED = chr(27) + '[62{' COLOR_BLACK_ORANGE = chr(27) + '[61{'

  1. Constants

DISPLAY_TEXT = "Hack RVA" DISPLAY_DELAY = 2 # Delay for display in seconds

  1. Establish socket connection

host = '10.200.200.98' # Replace with the correct host port = 23 # Replace with the correct port sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host, port))

  1. Clear the display

sock.sendall(chr(27).encode() + "[2J".encode())

  1. Reset cursor

sock.sendall(chr(27).encode() + "[H".encode())

  1. set cursor position

cursor_position = chr(27) + f'[{2};{10}H' sock.sendall(cursor_position.encode())

  1. Display the text in

message = COLOR_BLACK_RED + DISPLAY_TEXT sock.sendall(message.encode())

  1. Wait for a while

time.sleep(DISPLAY_DELAY)

  1. Close the socket

sock.close()


https://dchote.tumblr.com/post/24206361892/telegenix-led-wallboard-update