Colorgraphix 3 5632E: Difference between revisions

From HackRVA
Jump to navigation Jump to search
No edit summary
Line 37: 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).
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

Revision as of 17:54, 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