Page Contents
General Info
This page will serve as a repository to help explain the functionality of custom idle screens, as well as document bugs and identify work-arounds where possible.Please refresh the page before editing, as others may have made changes in the meantime.
Firmware Notes and Bugs
Firmware 1.1.1.14
Bugs
- MINOR (Feb21/07) - automatic screen update not working ;-)
- FEATURE (Feb21/07) - Allow to automaticaly refresh the idle screen after a given secs e.g. for "queue viewing","news reeding" purposes.- WDTY
Firmware 1.1.1.9
Bugs
- MINOR (Aug18/06) - Random corruption on screen when using custom XML file. Noticable as dots or lines on the extreme left and right of text blocks. - acabtp
- MINOR (Aug18/06) - The phone seems to always evaluate the "a1reg" as true, resulting in any <DisplayStr> that have "a1reg=false" never being displayed, and <DisplayStr> that do not have "a1reg=false" always being displayed, regardless of the Line 1 registration state. - acabtp
- FEATURE (Nov2/06) - Allow the display of the Account 1 "Account Name" via some format string — perhaps $N? - awint
Firmware 1.1.1.7
(JUL17,2006) Idle screen configuration functionality is introduced. - MikeBBugs
- MAJOR (Jul24/06) - Using custom bitmap with offset causes phone to crash. Suspect chunks of memory are being overwritten by the offset routine. The problem reoccurs every reboot when the phone attempts to load the Custom SCR. To remedy this, I had to reboot the phone with the network cable disconnected, and clear the custom screen from the preferences menu before it could be loaded. - acabtp
- MINOR (Jul24/06) - Random corruption on screen when using custom XML file. Noticable as dots or lines on the extreme left and right of text blocks. - acabtp
- MINOR (Jul24/06) - Using the $d variable reference causes the phone to display only the last digit of the day of the month, and the rest of the <DisplayStr> after the $d is truncated. - acabtp
- MINOR (Jul24/06) - The phone seems to always evaluate the "a1reg" as true, resulting in any <DisplayStr> that have "a1reg=false" never being displayed, and <DisplayStr> that do not have "a1reg=false" always being displayed, regardless of the Line 1 registration state. - acabtp
- FEATURE (Aug11/06) - Should be able to specify auto download of the XML file on boot-up, it's odd you have to do this manually! - mattb
- FEATURE (Oct18/06) - Can change the name of the xml file, for example to use a php file, to generate a dynamic idle screen! - jorgeci
Grandstream documentation on configuring idle screens
XML Based Customizable Screen Rev 1.3
Variables
The following variables have been provided by Grandstream. When entered in a <DisplayStr> element, these strings will be replaced by their corresponding values.$W: Current day of week and has the following possible values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
$N: Configured Account 1 Display Name.
$X: Configured Account 1 SIP User ID.
$V: Configured Account 1 SIP Server.
$I: Configured System IP address.
$D: Current day of month with leading zero, possible values: 01, 02... 31
$d: Current day of month without leading zero, possible values: 1, 2... 31 - broken in 1.1.1.7, fixed in 1.1.1.9
$M: Current month in English, possible values: January, February... December
$o: Current month in number with leading zero, possible values: 01, 02... 12
$n: Current month in number without leading zero, possible values: 1, 2... 12
$Y: Current year in 4-digit number, for example: 2006, 2007 ...
$y: Current year in 2-digit number, for example: 06, 07 ...
$P: Current AM/PM status in upper case, possible values: AM, PM
$p: Current AM/PM status in lower case, possible values: am, pm
$H: Current hour of day in 24-hour representation with leading zero, possible values: 00, 02... 23
$h: Current hour of day in 12-hour representation with leading zero, possible values: 01, 02... 12
$m: Current minute of hour with leading zero, possible values: 01, 02... 59
$s: Current second of minute with leading zero, possible values: 01, 02... 59
$N: Configured Account 1 Display Name.
$X: Configured Account 1 SIP User ID.
$V: Configured Account 1 SIP Server.
$I: Configured System IP address.
$D: Current day of month with leading zero, possible values: 01, 02... 31
$d: Current day of month without leading zero, possible values: 1, 2... 31 - broken in 1.1.1.7, fixed in 1.1.1.9
$M: Current month in English, possible values: January, February... December
$o: Current month in number with leading zero, possible values: 01, 02... 12
$n: Current month in number without leading zero, possible values: 1, 2... 12
$Y: Current year in 4-digit number, for example: 2006, 2007 ...
$y: Current year in 2-digit number, for example: 06, 07 ...
$P: Current AM/PM status in upper case, possible values: AM, PM
$p: Current AM/PM status in lower case, possible values: am, pm
$H: Current hour of day in 24-hour representation with leading zero, possible values: 00, 02... 23
$h: Current hour of day in 12-hour representation with leading zero, possible values: 01, 02... 12
$m: Current minute of hour with leading zero, possible values: 01, 02... 59
$s: Current second of minute with leading zero, possible values: 01, 02... 59
- acabtp
Excerpt from the Phone Manual
The feature will be activated when “Enable Idle-Screen XML Download� is set to YES (HTTP or TFTP) AND a valid “Idle-Screen XML Path� is set. This feature does not automatically download the gs_screen.xml file in the path even when activated. Because the LCD is composed of 130*64 mono pixels, the resolution of the screen XML should be within this range. The following 2 options are added to the Preference LCD GUI submenu:- Download SCR XML
- Erase Custom SCR
Example XML file of gs_screen.xml:
<?xml version="1.0"?>
<Screen>
<IdleScreen>
<ShowStatusLine>false</ShowStatusLine>
<DisplayBitmap>
<Bitmap>Put your customized screen file with bitmap format here</Bitmap>
<X>0</X>
<Y>0</Y>
</DisplayBitmap>
<DisplayString font="f8" halign="Right">
<DisplayStr>Doraemon</DisplayStr>
<X>130</X>
<Y>0</Y>
</DisplayString>
<DisplayString font="f10" halign="Left" valign="Bottom">
<DisplayStr>Call me:</DisplayStr>
<X>0</X>
<Y>54</Y>
</DisplayString>
<DisplayString font="f8" halign="Left" valign="Bottom">
<DisplayStr>$X@$V</DisplayStr>
<X>0</X>
<Y>64</Y>
</DisplayString>
</IdleScreen>
</Screen>
Note: The feature requires some expertise on XML. For more technical
details, please contact Grandstream.
Example
In this example, the company name is displayed at the top, the account name, the account number (in the largest font with a leading "x" for "extension"), and the current date. This may be more useful in an corporate or executive environment where the user will almost never need to know what IP address their phone is.gs_screen.xml:
<?xml version="1.0"?>
<Screen>
<IdleScreen>
<ShowStatusLine>true</ShowStatusLine>
<DisplayString font="f10" halign="Center">
<DisplayStr>Company, Inc.</DisplayStr>
<X>64</X>
<Y>0</Y>
</DisplayString>
<DisplayString font="f13h" halign="Center" a1reg="No">
<DisplayStr>$N</DisplayStr>
<X>64</X>
<Y>11</Y>
</DisplayString>
<DisplayString font="f13b" halign="Center" a1reg="Yes">
<DisplayStr>$N</DisplayStr>
<X>64</X>
<Y>11</Y>
</DisplayString>
<DisplayString font="f16h" halign="Center" a1reg="No">
<DisplayStr>x$X</DisplayStr>
<X>64</X>
<Y>23</Y>
</DisplayString>
<DisplayString font="f16b" halign="Center" a1reg="Yes">
<DisplayStr>x$X</DisplayStr>
<X>64</X>
<Y>23</Y>
</DisplayString>
<DisplayString font="f8" halign="Center">
<DisplayStr>$W, $M $D, $Y</DisplayStr>
<X>64</X>
<Y>40</Y>
</DisplayString>
</IdleScreen>
</Screen>
- acabtp
Adding Bitmaps to the XML file
Should you decide to place a custom bitmap in the SCR file theres a few things to note:
First of all, the bitmap must be a 2 color(mono) bitmap that is exactly 130x64 pixels in size. You can do this quite easily in MS Paint. Personally I used fireworks to import whatever logo I was going to use, then did a black color fill on it. After that I just copied and pasted into MS Paint and saved as a Mono BMP file. I'm not exactly sure why the image has to be exactly 130x64 but I assume Grandstream did not make a routine to check the headers of the bitmap image, either that or I'm missing a tag for the image size somewhere. If you use an image smaller than 130x64, the image will not come across properly. If you use a bigger image, the image will not come across at all.
Once you get your bitmap finished, you will need to convert the file to a Base64 string using uuencode or a similar program. Be sure to remove any headers, trailers or line feeds from the output of uuencode.
for instance:
uuencode foobar.bmp temp -m > base64.txt
then if you cat base64.txt you will get something like this:
begin-base64 644 temp
Qk0BQAAAAAAAD4AAAAoAAAAggAAAEAAAAABAAEAAAAAAAAFAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAP///wD/////////////////////wAAAAP//////////
///////////AAAAA/////////////////////8AAAAD/////////////////
////wAAAAP/////////////////////AAAAA/////////////////////8AA
AAD/////////////////////wAAAAPwAAAAA==
====
Qk0BQAAAAAAAD4AAAAoAAAAggAAAEAAAAABAAEAAAAAAAAFAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAP///wD/////////////////////wAAAAP//////////
///////////AAAAA/////////////////////8AAAAD/////////////////
////wAAAAP/////////////////////AAAAA/////////////////////8AA
AAD/////////////////////wAAAAPwAAAAA==
====
You then would need to remove the first and the last line, and then all line feeds to produce the following:
Qk0BQAAAAAAAD4AAAAoAAAAggAAAEAAAAABAAEAAAAAAAAFAAAAAAAAAAAAA ...more gibberish... AAAA==
The short way to do all that is this command:
uuencode foo.bmp temp -m | tail -n +2 | head -n -1 | tr -d '\n' > bitmap.txt
Now simply place the base 64 string (without any linefeeds or spaces) between <Bitmap> and </Bitmap> tags in your xml file
- ninthclowd
An easy way to get your .bmp into Base64 without having to download and install a port of uuencode is to just email it to yourself. View the source of the email, and you can copy out the data from the MIME container for the .bmp... it has been conveniently encoded in Base64 for you. - acabtp
Script for BMP Conversion
Here is a short script for converting a 1-bit BMP to a string suitable for insertion to an idlescreen XML file.Requires: PHP, uuencode, tr
Configuration: change $tmpdir to suit your system
Input: a file named logo.bmp in the same directory as the script
Output: a file name logo.64 in the same directory as the script
<?php
$tmpdir = "/tmp";
$execstr = "uuencode logo.bmp logo -m > ".$tmpdir."/tmp.64";
exec($execstr,$output);
$lines = file($tmpdir.'/tmp.64');
$lines_out = array();
for($a = 1; $a < count($lines) - 1; $a++) {
$lines_out$a-1 = $lines$a;
}
file_put_contents($tmpdir.'/tmp2.64',$lines_out);
$execstr = "cat ".$tmpdir."/tmp2.64 | tr -d '\012' > logo.64";
exec($execstr,$output);
?>
$tmpdir = "/tmp";
$execstr = "uuencode logo.bmp logo -m > ".$tmpdir."/tmp.64";
exec($execstr,$output);
$lines = file($tmpdir.'/tmp.64');
$lines_out = array();
for($a = 1; $a < count($lines) - 1; $a++) {
$lines_out$a-1 = $lines$a;
}
file_put_contents($tmpdir.'/tmp2.64',$lines_out);
$execstr = "cat ".$tmpdir."/tmp2.64 | tr -d '\012' > logo.64";
exec($execstr,$output);
?>
- bshep
Page Changes
I guess it was me with the overwrite...
Re: Variables and Bitmaps
Variables and Bitmaps
-ninthclowd