I've always wanted an LED sign for years. Searching around the net I found Walt's LED Sign Page. I orignally was looking at the Pro-Lite sign and emailed Walt asking a few questions. He told me about the protocol for the BetaBrite being released. My focus changed to the BetaBrite and any available information on it.
I purchased the sign and built the cable with the info on Walt's site. I've added my version of building the cable to this site with part numbers and pictures of the easily obtainable parts to make it as easy as possible.
This is definately a cool geek toy. With a little knowledge of Perl, or your choice of programming/scripting languages you can do some cool things with this. Computer related possibilities include displaying system information, headlines off the Internet, reports from system monitoring and many other things. If you can write some simple code, you can program this sign.
I code in Perl and use Linux as my Operating System. This really opens up what you can do with the sign scripting wise. Any examples on this site will be in Perl and is written from a viewpoint that your using Linux as your OS. Any changes to make it run on a non-Linux platforms are up to you.
The following is to get somebody that is interested in programming with the ALPHA protocol up to speed quickly and stuff that I have learned about the sign.
This page isn't fancy..I coded it in VI
The BetaBrite sign is an Electronic Color Message Display using the ALPHA protocol by Adaptive Micro Systems, Inc.
AMS recently released the Alpha Sign Communications Protocol. This allows some of us hacker types to write custom apps for the sign. The BetaBrite is not the only sign to use the ALPHA protocol, but it's the cheapest. Any of the stuff you learn can be applied to the other models.
The BetaBrite one-line sign has several models:
There is also a Series 200 Alpha LED Sign - model 215C. I was confused about what the difference was when I first got my BetaBrite sign. A quick look and you think they are one and the same. That's not correct.
Frank from Pacesetter Signs answered my questions about the models that I asked when I first purchased my sign. This is an edited version from the BetaBrite Forum on www.ams-i.com
--------------------- >Sign info: >EZ95 >8K RAM >Rom version: >(c)AMS 1040-4402d >1997 BETA EZ95 >Kinda old. Is this the model before the 215c? >Some of the differences seem to be the that it doesn't have the second jack on the sign (not really needed I don't think) or the 215c rom. The 1040 version of the Beta-Brite is model 2 of 3, but that's still pretty much the same protocol. The newest version (has a black alum. enclosure vs dark grey plastic) has a few added features but no real biggie. >Is this the model before the 215c? "They are totally different signs. The Beta-Brite/BETAbrite line is separate from the Alpha line. The Alpha 215C is the Beta-Brite's "big brother" in that it had RS485 and RS232 inputs, RS485 bridged output, real-time clock (rolls over automatically at midnight), addressability, 90 pixel width vs 80, and the internal counters." ----------------------Same protocol but different signs
Features:
| Model(Indoor) | 215C |
| Rating | Standard |
| Matrix | Full |
| Character Height | 2 inch |
| Characters Displayed | 27 in condensed rotate mode |
| Serial Interface | RS232 |
| Pitch | 0.3" |
| Max. Viewing Distance | 100'/30m |
| Case Material | Aluminum (older sign are plastic)_ |
| Display Dimensions | 27" x 2.1" x 4.5" ( 73.4 x 5.3 x 11.4 cm ) |
| Case Size | 28.9 x 4.5 x 2.1 |
| Weight | 7 lbs (3kg) |
| LED Color | Tri-color |
| No. Messages stored and displayed | 81 |
| Operating Temp. | 0-50 C |
| Compatable Interfaces | Alpha / SmartAlec |
| Display Config Avail | Discrete/ Ethernet |
| Max. Charaters / Height | 15 /2.1" |
Some of SPECIAL text displaying modes are:
SPECIAL graphics are:
It's also capable of displaying the Day, Time and the date in several different formats.
The other fonts listed in the protocol appear as listed
Walt has info about making the cable. I originally went by the info on Walts site for building the cable. To make things a little easier I have the parts I used and where to get them. Like Walt, I also have pictures of the items properly connected.
Here are the parts I used. Here are the part #'s and the links. Radio Shack seems to change there site every 4ms..so if they don't work you'll have to search.
The connector - Wires snapped in place - back view - 1
The connector - Wires snapped in place - back view - 2
Checking the cable plugged into DB-9 cable (extension)
Here's a small test script just to see if you can talk to the sign once your cable is constructed. It loads a message into the first TEXT file on the sign and displays it. This is programming the sign in it's simplest form. Oh..and you must have Perl installed :)
#!/usr/bin/perl print "\0\0\0\0\0\001" . "Z" . "00" . "\002" . "AA" . "\x1B" . " b" . "Test Message" . "\004";
test-sign.pl > /dev/ttyS1You should see the message appear on the sign. Now that looks like some cryptic stuff. It becomes easier once all the protocol items are loaded into variables. That script programs the default text file A with the message and displays it. More one text files later. Also this is as easy as it gets. Once you go past playing with the default text file, it gets a little crazy.
The BetaBrite is one of Adaptive Micro Systems ALPHA display signs. This means it is programmed using the EZ KEY II / EZ95 protocol. Below are sections from the protocol manual and a description of each to get you up to speed. Some of the things mentioned in this section will be covered later on.
Items in white and quoted are from the AMS protocol pdf:This is a freely available document. Where I have quoted from it I give the section numbers. Since the documnt is freely available I'm guessing there's nothing wrong with doing so.
The first thing to understand is how to go about programming the sign. There are TEXT files ( your messages ), DOT FILE PICTURES (custom graphics) and STRINGS.
Programming the sign consists of the following steps in this order
But in order to SET MEMORY you need to know the sizes of your TEXT, DOT and STRING files!
I'll go over what each thing is.
"The Alpha line of products supports several types of files and a number of special functions which are used for specific applications"
TEXT files ( Section 3.0 )
"The ASCII message data and display mode information, along with various other control codes, are stored in TEXT files. DOTS PICTURE files and STRING files may be inserted into a TEXT file."
"As well as containing the actual message, calls to other types of files may be inserted into TEXT files. For example, if you wish to include a DOTS PICTURE as part of a TEXT file, you may simply include a call to a DOTS PICTURE file in the proper location in your TEXT file."
How to look at it - your messages are the TEXT files. Consider each TEXT file a line of text or a "page" which can be longer than the width of the display. To better understand this, you set the TEXT files and then create a RUN SEQUENCE of which TEXT files you want displayed and their order. So in short a TEXT file can be several screens of text, but all of the message that is programmed under that TEXT LABEL is called when it is added to the RUN SEQUENCE.
On initial power-up, the signs memory is configured with one TEXT file (File Label = A ). If multiple TEXT files are required you must set the memory for them(more on LABELS and SET MEM later)
How to look at it - The DOT PICTURE file is nothing more than a map of the LEDs to light and the color to light them as. You have to get the graphics in the proper format and program them into the sign under a DOT LABEL. Once this is done you can CALL them into your TEXT file.
Here's an yellow arrow pointing right.
The following string would be part of the frame sent to the sign.
00000080000\r00000088000\r08888888800\r08888888880\r08888888800\r00000088000\r00000080000\r Here it is formatted so you can see it. 0=off, 8=yellow 00000080000\r 00000088000\r 08888888800\r 08888888880\r 08888888800\r 00000088000\r 00000080000\r Each character represents a colorNotes: To correctly program a DOT FILE you must also calculate the DOT MEMORY SIZE.(more later) The first two bytes = # pixel rows and the last two bytes = the # of pixel columns in the picture.off 0 or 30H red 1 or 31H green 2 or 32H amber 3 or 33H dim red 4 or 34H dim green 5 or 35H brown 6 or 36H orange 7 or 37H yellow 8 or 38H
For drawing purposes the BetaBrite display is a 7 x 80 matrix.
I haven't experimented with the STRING files but the description seems pretty basic. This seems to be a file you can set up in memory and then write changes to. You can then insert these STRING files into your TEXT file. Sounds like to calling DOT files but instead of inserting a graphic, your inserting a STRING file..kinda like printing a variable.
I'll add more on this when I work with them :)
From the protocol doc ( section 4.1.1 - Valid Label Formats )
20H - sp 30H - 0 40H - @ 50H - P 60H - ` 70H - p
21H - ! 31H - 1 41H - A 51H - Q 61H - a 71H - q
22H - " 32H - 2 42H - B 52H - R 62H - b 72H - r
23H - # 33H - 3 43H - C 53H - S 63H - c 73H - s
24H - $ 34H - 4 44H - D 54H - T 64H - d 74H - t
25H - % 35H - 5 45H - E 55H - U 65H - e 75H - u
26H - & 36H - 6 46H - F 56H - V 66H - f 76H - v
27H - ` 37H - 7 47H - G 57H - W 67H - g 77H - w
28H - ( 38H - 8 48H - H 58H - X 68H - h 78H - x
29H - ) 39H - 9 49H - I 59H - Y 69H - I 79H - y
2AH - * 3AH - : 4AH - J 5AH - Z 6AH - j 7AH - z
2BH - + 3BH - ; 4BH - K 5BH - [ 6BH - k 7BH - {
2CH - , 3CH - < 4CH - L 5CH - \ 6CH - l 7CH - |
2DH - - 3DH - = 4DH - M 5DH - ] 6DH - m 7DH - }
2EH - . 3EH - > 4EH - N 5EH - ¢ 6EH - n 7EH - 1/2 sp
2FH - / 3FH - ? 4FH - O 5FH - _ 6FH - o 7FH - reserved
20H through 7EH - excluding Priority TEXT file 30H ( zero ).
Ok, a majority of these are extended characters. If we stick to human readable and easy programable labels, we have around 61 out of the 95 ( 95 in the protocol, but the BetaBrite box says 75 messages). I'm saying this because from my viewpoint and method of programming, I'm using characters and not hex values. I'd really hate to see some of these parsed from a text file in Perl.Besides, I type and read in english, not hex :)
We've reviewed, quickly, the major aspects of how the sign is programmed. The terms atleast.
Here we'll set up some variables to make life a lot easier and then I'll use a "WRITE TEXT FILE" frame as an example of how to program the sign. Here is description of the transmission frame and some code from my Protocol script for example purposes.
Note: I'll hightlight sections of the frame in color, to break it apart, and also have the text that explains it in the same color:
The 'Standard Transmission Frame' is: [ NULs ][ SOH ][ Type Code ][ Sign Address ][ STX ] [ Command Code ][ Data Field ] [ EOT ]
We'll set some variables and build some other useful ones.
Every message frame you send to the sign must start with the items listed below.
$NUL = "\0\0\0\0\0\0"; # NUL - Sending 6 nulls for wake up sign and set baud neg.
$SOH = "\x01"; # SOH - Start of header
$TYPE = "Z"; # Type Code - Z = All signs. See Protocol doc for more info
$SIGN_ADDR = "00"; # Sign Address - 00 = broadcast, 01 = sign address 1, etc
$STX = "\x02"; # STX - Start of Text character
# These are other useful variables
$ETX = "\x03"; # End of TeXt
$ESC = "\x1b"; # Escape character
$EOT = "\004"; # End of transmission
# We group some of the variables above to make life easy.
# This leaves us 2 type of init strings we can add to the front of our frame.
$INIT="$NUL$SOH$TYPE$SIGN_ADDR$STX"; # Most used.
$INIT_NOSTX="$NUL$SOH$TYPE$SIGN_ADDR"; # Used for nested messages.
Note: Sign Type - Since I have just one sign I set it to 'all signs'. Sign Address - Each sign as a user settable address.
If your not familiar with it, the '\x' means the value following is a HEX value.
If you look at the $INIT varaible you'll see I've grouped several varaibles together to make one. We now have $INIT and $EOT which will be the start and end of every frame we send to the sign. Now each frame becomes easier to construct.
We now have a more compact string for the beginning of the frame and it's now: $INIT[ Command Code ][ Data Field ]$EOT
Here is just one example of the [command code][data field] part of the frame. For every different 'command code' in the beginning of the field, the other ones after it change. Walking through the frame we'll treat this example as if it was a 'WRITE TEXT' frame.
The [ Command Code ][ Data Field ] can be broken down into the following parts for a WRITE TEXT frame
[COMMAND CODE][FILE LABEL] <esc> [Display Position][Mode Code] Speical Specifier [ASCII MESSAGE]$WRITE ="A"; # Write TEXT file
$READ ="B"; # Read TEXT file * $WRITE_SPEC ="E"; # Write SPECIAL FUNCTION file $READ_SPEC ="F"; # Read SPECIAL FUNCTION file * $WRITE_STRING ="G"; # Write STRING file * $READ_STRING ="H"; # Read STRING file * $WRITE_DOT ="I"; # Write DOT file $READ_DOT ="J"; # Read DOT file *
* Note: I haven't tried any of the READ files stuff or the STRING stuff yet
0 (zero) is special and means "Priority Text"
Middle line = " " or \x20 Top Line = \x22 Bottom Line = \x26 Fill - all = \x30
Note = \x20 seems to be best on the Betabrite sign.
# I create DPOS ... notice the -esc- to start the Mode Field: $DPOS="\x1b\x20"; # Set for BetaBrite one line sign
Once you go beyond programming the default TEXT file ( Label "A" ), anything else you want to do (FILE, DOT or STRINGS) requires the setting of memory for the file. This means the TEXT FILE lengths and DOT FILE sizes must be calculated and the memory set for each one. I do this everytime I send to the sign and seemed like a pain in the ass at first but I came up with a good solution.
The memory sizes are calculated for each TEXT file and DOT file, the memory is set and then I send the TEXT and DOT files. In order to set the memory for TEXT files you need to count the characters (including control CODES), add a small amount to it and convert it to HEX. The memory setting for a DOT file is the height and width values converted to hex. These values are then added to a other [[ First 2 bytes = # pixel rows ][ Last two bytes = # pixel columns]] = mem setting.
To SET MEM for a DOT file:(BETABRITE being a filehandle to serial port)
print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x24" . "$DOT_LABEL" . "DU" . "$DOT_SIZE" . "4000" . "$EOT";
$WRITE_SPEC = Write SPECIAL FUNCTIONS file
"\x24" = 24H - Set Memory Configuration
A = TEXT file (41H) B = STRING file (42H) D = DOT PICTURE FILE (42H)
U = 55H - Unlocked. Means that the file can be accessed via an IR keyboard. L = 4CH - Locked. Means that the file can not be accessed via an IR keyboard. $DOT_SIZE = The first two bytes = # pixel rows and the last two bytes = the # of pixel columns in the picture (in HEX).4000 = 8-color Color Status (ALWAYS STAYS THE SAME FOR BETABRITE)
So say we have a 11x7 DOT file we want to program into DOT LABEL "J". Converting the rows and cols values to HEX and joining them together we would get "070E". Without the variables our string would actually look more like: JDU070B4000
To compete the example above: print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x24" . "JDU070B4000" . "$EOT"; In reality you would have more than just the "JDU07B4000". You'd have all your memory settings in the same frame. Once ALL your memory settings are sent you would send the actual DOT FILE itself: print BETABRITE "$INIT" . "$WRITE_DOT" . "J" . "070B" . "00000080000\r00000088000\r08888888800\r08888888880\r08888888800\r00000088000\r00000080000\r" . "$EOT"; To SET MEM for a TEXT file: print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x24" . "$TEXT_LABEL" . "AU" . "$TEXT_SIZE" . "$RUNTIME" . "$EOT"; Well set TEXT file "H" in this example: Explanation: $TEXT_LABEL = H - Label of the text file :) A = TEXT FILE B = STRING file (42H) D = DOT PICTURE FILE (42H) U = 55H - Unlocked. Means that the file can be accessed via an IR keyboard. L = 4CH - Locked. Means that the file can not be accessed via an IR keyboard.It gets a little more complicated for TEXT files. In the message we have to count the characters, but also count the MODE stuff too.
For the example our message is: $message="<$ROTATE><$RED> Hello there, how is everybody doing?"; What I do is read the text message from a file. The variables are surrounded by < and > just like html code. I copy the string into a variable I can work on with without changing the original.Here's some code from my scripts to do it:
#===============================
# copy - $message remains the $message sent to the sign, $message2 is or working copy
$message2=$message;
#make the spaces something
$message2 =~ s/ /X/g;
# Convert the stuff between < and > back into variables an kill the < and >
# When the varaibles are read from a file they aren't really variables. This converts them.
$message2 =~ s/\<\$(\w+)\>/${$1}/g;
# Throw all the characters in a array
@string = split / */, $message2;
# reset the counter
$char_count=0;
# Count the characters in the array
foreach $character ( @string ) {
$char_count++;
}
# Add characters for before message ( Remember $DPOS ? )
$char_count=$char_count+4;
# convert count to hex
$hex_char_count = sprintf("%02x",$char_count);
# make the letters uppercase
$hex_char_count =~ tr/[a-z]/[A-Z/;
# set the values in the hash
$text{$label}{textsize}=$hex_char_count;
$text{$label}{char_count}=$char_count;
#==============================================
I then have the number of characters in both Dec and HEX. We use the HEX value for the memsize.
44 characters = 2C HEX
$TEXT_SIZE="002C"Just group them together and then send the $EOT When your are setting more than one, your frame might look like print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x24" . "HDU07374000" . "IDU07294000" . "JDU07324000" . "KDU07474000" . "$EOT";
Once you have SET MEM for ALL your TEXT, DOT and STRING files you can then send your TEXT, DOT and STRINGS. You then need to send a RUN SEQUENCE This tells the sign what you want to show and in what order. This list can up to 130 ASCII characters long and is needed in order for the sign to display anything.
Everytime I write a TEXT file to the sign I throw the LABEL into the end of an array called @text_runlist like so: push (@text_runlist,$LABEL); When I'm done sending all of the TEXT files I can then copy all the stuff into a varaible called $text_runlist $text_runlist="@text_runlist";Then all I have to do is remove the spaces and I can create the string to send to the sign # remove the spaces $text_runlist =~ s/ //g;
To SET RUN SEQUENCE: print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x2e" . "S" . "U" . "$SEQ" . "$EOT";
\x2e = Set Run Sequence One ASCII character that represents the type of Run Sequence order: T 54H = All subsequent TEXT File Labels in the Run Sequence will run according to their associated times (default). S ( 53H ) = All subsequent TEXT File Labels in the Run Sequence will run in order regardless of each file s run time. D 44H = All subsequent TEXT file labels in the Run Sequence will run according to their associated times. Then when the file reaches an off time , the file will be deleted.Well say we want to add A B C D and E as an example:
And send it to the sign in the order then were sent (alphabeticaly)
print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x2e" "SU" . "ABCDE" . "$EOT";
or print BETABRITE "$INIT" . "$WRITE_SPEC" . "\x2eSUABCDE" . "$EOT"; Pretty simple (See section 3.3.2 for more info)
TEXT scroller
bb-scroller.pl
SUMMARY:
bb-scroller.pl is a Perl utility that allows the scrolling of text on the
BetaBrite one line LED Display. It counts the characters and delays
between lines to allow the line being displayed to completely scroll
off the display before the next line starts. This allows the displaying
of any text file or output from a command specified on the command line.
Supports "Titles": If it finds "===" prefixing the line it will treat that
line as the "Title" until it finds another line with "===". Until it comes
across another line with "===" it considers each line to be a child of the
previous "Title". This was done to make it capable of displaying articles
from websites and display "Site - Article". I use this feature with 'yanf'
and a config file for /yanf' should be included with the script. Yanf can
be found at http://yanf.sourceforge.net/
Created in Linux. Requires /dev/ttyS*
Example:
The file contains:
===Site 1
Article 1
Article 2
Article 3
===Site 2
Article 1
Article 2
This would display as:
Site 1 - Article 1
Site 1 - Article 2
Site 1 - Article 3
Site 2 - Article 1
Site 2 - Article 2
Features include:
- Automatically strips out HTML code.
- Reading default file set in script or set from command line.
--file="/var/log/messages"
- Reading of text from command line.
--text="Hello World!"
- Option of running of a command and displaying the output on LED display.
--command="cat /etc/release"
- Option of setting color. --color=[color]
Requires:And it can handle very large lines and filter out </b>html</b> code <font color="darkblue">like this</font> Script Package - betabrite-scroller-0.4.tar.gz
SUMMARY:
bb-stockticker.pl is a utility that allows the scrolling of stock quotes
on the BetaBrite one line LED Display. It counts the characters and delays
between lines to allow the line being displayed to completely scroll
off the display before the next line starts.
All the quotes are downloaded in the same transaction and then displayed one
at a time till completed.
How old are the quotes?
From http://help.yahoo.com/help/us/fin/quote/quote-01.html
"Quotes are delayed 15 minutes for Nasdaq and 20 minutes for other exchanges.
The quote data is updated continuously while the stock markets are open. The
data displayed reflects the delayed version of the last trade."
Features include:
- Option of setting color.
- Option of displaying stock quotes in different formats.
- Yahoo will support up to 200 stocks at a time. Enter multiple ticker
symbols separated by a space. The script should go there, your mileage
may vary :)
- supports Foreign exchange symbols such as "^OSEI", "OTC.TO" and "PRTC.BO"
Created in Linux. Requires /dev/ttyS*
INSTALLATION:
* edit the Perl script bb-stockticker.pl:
Configuration items at top of script
- Serial port name.
- Sign type and sign address.
- Set path to lynx and sed (used for quote option only)
- Make sure the appropriate #! line pointing to your copy of Perl.
* Download and install Time::HiRes
Download - Time::HiRes
perl Makefile.PL
make
make test
make install
Script Package - bb-stockticker-0.2.tar.gz
Make sure it's set for the right com port ( ttyS0 = COM1, ttyS1 = COM2 ) # stty version > 2.0 stty -F /dev/ttyS1 9600 -opost -ocrnl -onlcr cs7 parenb -parodd # stty version < 2.0 #stty 9600 -opost -ocrnl -onlcr cs7 parenb -parodd < /dev/ttyS1