ATEN VC080 Automation on Linux
In my RetroRacks project I am using an ATEN VC080 HDMI EDID emulator which has four EDID presets: A default preset and three user presets. On top of the unit is a button to switch between the different presets. It has also got a serial RS-232 connection to download, change and upload EDIDs and also to upgrade the firmware. Unfortunately there only exists a Windows software (ATEN EDID Wizard) to do all this. I thought this software would be able to switch between the presets, but when I tested it I found out it doesn’t. To automate it I had to find out how the software communicates with the device and if there is a way to automate the selection of the presets.
Analyzing the Proprietary ATEN EDID Wizard
While testing the EDID Wizard I observed that when it reads out the EDIDs stored on the device, it switches between the three user presets while reading their data. This was a hint that there must be a command which switches between the presets before they are read.
To analyze the communication between the software and the device I used a “Serial Port Logger” Windows software which records and visualizes the captured data.
When starting the software, at first the serial communication is set to 115200,8,N,1
.
When I started reading out the EDIDs from the device, some data was exchanged with the device.
I only looked at the data which has been sent to the device in this process, and it was sending the following bytes (hex, one event per line):
0B
0B
02 0C
05
0B
03 0C
05
0B
04 0C
05
Analyzing the Commands Sent and Sending own Commands
Looking at the bytes sent you can clearly see three byte pairs which contain an incremented number (hex):
02 0C
03 0C
04 0C
So I was guessing this might be the bytes which are the commands to switch between the presets.
To test this, I first had to set the right baud rate to my USB-to-RS-232 adapter located at /dev/ttyUSB0
on Linux.
The current settings can be read out using stty
:
$ stty -F /dev/ttyUSB0
If you have permission problems accessing your serial device, make sure you are in the dialout
group and then relogin (applies to Debian based OS’s).
To set the right baud rate, the following command can be used:
$ stty -F /dev/ttyUSB0 115200 cs8 -cstopb
This shorter command should also work in most cases:
$ stty -F /dev/ttyUSB0 115200
To send bytes to the serial interface I used the following command:
$ echo -ne "\x<Byte 1>\x<Byte 2>" > /dev/ttyUSB0
E. g.
$ echo -ne "\x03\x0C" > /dev/ttyUSB0
To my surprise it directly worked as desired!
It is as simple as you might expect: The first byte of the command indicates the preset, followed by the second byte.
Even using the sequence 01 0C
worked, it selects the first (default) preset.
So the command bytes and presets correlate the following way:
01 0C: DEFAULT
02 0C: SET 1
03 0C: SET 2
04 0C: SET 3
Script it
A super simple Bash script to select the preset would be the following:
#!/bin/bash
# Filename: selectpreset.sh
if [[ "$1" =~ ^[1-4] ]]; then
echo Setting preset $1
echo -ne "\x0$1\x0c" > /dev/ttyUSB0
else
echo Wrong parameter, must be a number between 1 and 4!
fi
Keep in mind it does not check if the serial port baud rate is set right!
Save it in a file called e. g. selectpreset.sh
and make it executable using the following command:
$ chmod u+x selectpreset.sh
Usage:
$ ./selectpreset.sh <Preset number>
E. g.
$ ./selectpreset.sh 3
Enjoy!