                      Pace Serial Message Decoder
                      ===========================

                           v0.04 2006/07/02

                            by Rick Murray

                   heyrick -at- merseymail -dot- com
                   http://www.heyrick.co.uk/digibox/


What is it?
-----------
PSMD is a program designed to interpret status messages sent out via
the serial port of any Sky Digibox manufactured by Pace.




Warning
-------
This software pokes the serial port directly, and the interrupt mask
directly. While it is a 16-bit MS-DOS program that'll work on most
machines with MS-DOS 3.3 on an 80286 with 1Mb RAM (or later); it may
well fail on NT and XP because of the hardware poking...

...sorry, I did want to write it GUI in VisualBasic, but I apparently
don't have the required licence to use MSComm functionality in my own
programs and frankly life is WAY to short to figure out what the
Windows API (starting with CreateFile on COM1) is all about. So I did
it the old fashioned way.

This means, on your latest greatest computer, there's a good chance
that it will NOT work. However if you happen to have an old heap of
junk you though was obsolete a decade ago... well, what d'ya know?!?
Dig it out of the attic, dust it off, plug it in and you too can use
this software! :-)

It should work in plain DOS or in a window under Windows 95, 98, or
ME. I can guarantee it'll do that with 98SE because it is doing so as
I type this!




How to connect it all up
------------------------
The bright spark would think "null modem lead". Well, for some reason
Pace has decided to use the wrong sort of socket on the back of the
Digibox. This, perhaps, is in order to avoid having pins of a socket
bare and accessible on the back of a piece of domestic equipment.
Whatever the reason, DO NOT FRET! Simply find yourself a suitable
serial lead for connecting to a MODEM and plug it in the only way it
will go. That's what I have - a basic 9-pin serial to 9-pin serial
modem lead.
Ye Gads! It works. The serial port must be wired up 'backwards'. I
guess in the minds of Pace, the Digibox is a DCE and not a DTE.

Unfortunately, that will not suffice. I think the Digibox monitors
the outgoing serial buffer and if nothing is seen to be taken, it
disables serial output. So plug in the lead, run PSMD, then do
something with the Digibox: change channel, press '1' then 'back up',
whatever. Soon you'll see all the stuff appear on the screen.




What if I don't have a Pace receiver?
-------------------------------------
Make sure your Digibox is on a channel. If you're stuck, switch it on
(if in standby) and tap in channel 984 (BBC 1 South). Leave it there.


Fire up HyperTerminal. For Windows 9x, this may be found in: 
  Start -> Program Files -> Accessories -> Communications

A window will appear asking for a name and icon of a new connection.
Call it something like "Digibox" and pick the icon you like the most,
at the rightmost end there should be a nifty phone-and-atom icon. I
like that one. Click "OK".

A window will appear asking for phone numbers. At the bottom you will
see a drop-down list entitled "Connect using". Choose "Direct to Com1"
(or Com2 depending on your system). Click "OK".

A scary complicated window will appear. Don't freak, just twiddle
stuff until it says:
  Bits per second: 57600
        Data bits: 8
           Parity: None
        Stop bits: 1
     Flow control: Hardware
Click "OK".

You should have an empty terminal window with a lonely blinking
cursor.

Take your trusty Sky remote and quickly press '1' and then 'back up'.

If the terminal now says something like (in between 'cut marks'):
--8<--------
015CE000101--a4

179SSCN010984SSCA018BBC 1 SouthSSDT02610.35pm Tue 27 Jun SST001410.2 5pmSSN0020'South Today'SSE0086All the top news stories, weather, spo
rt and features for the South of England.d2
--8<--------

If it says something similar, close HyperTerminal and try running
PSMD. Certainly if the first part ("015CE000101--a4") exactly matches
then you should get some luck with this software.
It can't hurt to try.


Wait! But what if you see "o^Jj;:9;NVZ}{W9;NVVZZn"?
Don't worry. Sometimes it seems HyperTerminal (or perhaps Windows?)
totally ignores what you specified in the terminal settings and used
the settings specified as 'default' for the hardware. As it is, my
serial port is - in Device Manager - set to run at 115200bps. Even
though I told HyperTerminal to use 57600bps, something is either too
stupid or too stubborn to do so!
What this junk on-screen tells you is that you are getting something
from your receiver. At the wrong speed, you don't have a hope of
making sense of it. Try using PSMD. It talks directly to the serial
hardware so whether the fault is HyperTerminal or Windows, it ain't
gonna be OUR problem! PSMD bypasses all of that.




I have a Pace receiver, but it isn't a Digibox...
-------------------------------------------------
Doesn't matter. As long as it is sufficiently modern that it has a
serial port (i.e. some sort of DIGITAL receiver, not an old analogue
one), then this software should work. Pace apparently output this
information as standard on their boxes - Cable & Wireless, Canal+,
Sky, terrestrial and cable boxes, etc etc.

Note, however, that for reasons of economy, some boxes may seem as if
they should work with PSMD but don't because there is no serial port.

It may be that a serial line convertor (i.e. the all-powerful MAX232)
and a 9-pin socket could be fitted. This is outside of the scope of
this document, and not something I'm qualified to comment on! 




How to use PSMD
---------------
1. Hook up the serial lead.
2. Run PSMD.
3. Get the Digibox to output info (press '1' then 'back up').
4. Read the screen. :-)
The purpose of the three parts of the screen should be fairly self
explanatory.

You may also press:
   F1     For help
   ?      To refresh the display
   Esc    To quit
   Alt-X  To quit



Unknown codes
-------------
If PSMD reports an unknown command, with the message:
   Command "xxxx" not recognised. Please inform me so I can update!
then please send me the corresponding raw data dump (the stuff that
appears in the top window) along with a description of what you did
to cause this command to appear. I can then extend the command
decoding routine!

Please, don't worry if you miss it (another command comes along) and
please don't try to copy down the information off the screen. I need
to know it EXACT, and there is an easier way - there is the log file!




The log file
------------
Every time you start PSMD, it creates a file called "Digibox.log"
within its own directory; this file is usually located at:
  C:\Program Files\HeyRick\psmd\Digibox.log
When you start PSMD anew, this file is destroyed and new information
written. If you wish to keep anything specific for any reason, please:
  Close PSMD (to close the current log file)
  Rename the log file to something OTHER than "Digibox.log"
  Optionally, restart PSMD.

The log file contains a raw dump - this is the stuff that should be
shown in the upper part of the screen, but it contains EVERYTHING that
is received from the Digibox, including stuff normally filtered out.

To give you an idea, here is what happened as I plugged in the
Digibox (from physically unplugged from the mains state), waited for
the EPG data to load, selected BBC 1 South, and pressed the red
button:
--8<--------
[xyman_device_register]: success, the device id 6 is registered.
[xyman_device_register]: success, the device id 7 is registered.
[xyman_device_register]: success, the device id 8 is registered.
[xyman_device_register]: success, the device id 9 is registered.
#INTPRT[RESET] starting
#INTPRT[READY] init
#INTPRT[RUNNING] running:0x2

013SYST0081ba

013SYST0080b9
074PUSP069Audio Unavailable Please check your digital satellite rece
ivere3

074PUSP069Audio Unavailable Please check your digital satellite rece
ivere3

074PUSP069Audio Unavailable Please check your digital satellite rece
ivere3

015CE000109--ac
015CE0001098-b7
041CE00010984SSDT026 6.10pm Tue 27 Jun 99
166SSCN010984SSCA018BBC 1 SouthSSDT026 6.10pm Tue 27 Jun SST00136.00pmSSN0017"BBC News"SSE0077National and international news
from the BBC, followed by Weather. [S]69
059SSCN010984SSCA018BBC 1 SouthSSDT026 6.10pm Tue 27 Jun ff
166SSCN010984SSCA018BBC 1 SouthSSDT026 6.10pm Tue 27 Jun SST00136.00pmSSN0017"BBC News"SSE0077National and international news
from the BBC, followed by Weather. [S]69

#INTPRT[RUNNING] exited, status:0x1
#INTPRT[CLEANING_UP] init
#INTPRT[LOADING] in progress
#INTPRT[LOADING] module
#INTPRT[RUNNING] running:0xffffffff
--8<--------




Can you control the Pace receiver?
----------------------------------
Apparently it is possible to send commands back via the serial line
to control the receiver - to tune to selected channels, and all sorts
of things. It may even be that you can control the receiver to do
things not even supported with the Sky setup (such as switching to a
specific audio channel). I know that, apparently, many receivers can
have the RF audio output changed from the PAL-I (UK) offset of 6.5MHz
to the PAL-B/G (Europe/Australia) offsets of 5.5MHz or 6.0MHz...

However there is a dark side to this. I would imagine that, as these
are development and test facilities, there would also be commands to
perform potentially destructive actions on the receiver. Perhaps to
'lock' the FlashROM so the box cannot be updated further. Perhaps
even to blank the FlashROM entirely so it no longer is capable of
functioning as a digital receiver (this wouldn't be a problem to the
normal Pace engineer, as they'd have the parts required to poke in
new firmware using the JTAG interface).

I will look to implementing some sort of control of the receiver, but
not until I have something solid to work from.


Until then, you may wish to Google for:
  DigDebug.exe
  LibDebug.exe
  Libby.exe

These are, more or less, the same thing. A "leaked" software package
from Pace which claims to be able to control the test functions of a
variety of digital receivers.
Note, however, that Libby starts off at 19200bps - while it appears
the 2500B talks at 57600bps. You can insert the following into the
.cfg file to force the faster speed:
--8<--------
*COMMS
57600
--8<--------

In any case, it simply doesn't work for me. I have tried the
non-destructive action "Read Bit Error Rate/Lock" (code "M00") with
every single .cfg file supplied with Libby, and - upon discovering
that they all used the same code - I forced every serial speed from
300bps to 115200bps. It simply didn't want to know.

Perhaps you'd have more luck? Perhaps...




Disclaimer
----------
This software was created as a result of basic experimentation with
a Pace BSkyB 2500B digital satellite receiver. I do not have any
technical manuals or "friends at Pace", this is all guesswork. For
that reason, I absolutely DO NOT warrant that this software will
provide a complete, comprehensive, or correct analysis of what your
receiver is doing.

Furthermore, I wish to point out that you have obtained an
experimental work 'gratuit'. Thus you must understand that I am not
able to offer any warranty with respect to the operation of the
software itself. It is supplied purely as-is, and I disclaim all
liabilities that may arise from the use of this software.

This software is copyright (c) 2006 Rick Murray. No end-used support
is offered, however I will - generally - look to making updates or
corrections if you send me a polite email.

I grant you the right to install this software on any of your
computers, networked or not. Whatever.

However, AND PLEASE PAY ATTENTION: YOU DO NOT HAVE THE RIGHT TO
                                   (RE)DISTRIBUTE THIS SOFTWARE.
It is readily available direct from my website. At this early stage
of development, I do not wish to see it on other websites,
compilation discs, etc etc. NO EXCUSES. I won't be the one catching
up with you, my legal representative will do that for me... at your
cost.

In addition, the standard common-sense things: don't poke your name
into the software and pass if off as your own (anybody with a hex
editor can do that, it doesn't impress). Don't eat it. Don't use it
on a machine that is used in life support systems. Don't sleep. Don't
be a punk rocker with flowers in your hair because no punk rocker
would ever wear flowers in their hair. And don't forget sunscreen.

This software is governed by appropriate French and European law. In
no circumstance other than pure end-user use is this software or any
issue relating to it to be sumbitted under any form of American law.

These terms are shown to you by the installer, so the INSTALLATION of
this software implies full acceptance of all of the terms.




Contacts
--------
You can write to me at:
   heyrick -at- merseymail -dot- com

Please do NOT send attachments over 32K without asking first; else
they will be automatically deleted.
Please note also that I only have Internet access once a week, usually
half an hour at the local library. So I may really wish to hear from
you and get a reply back in a few hours... the reply will languish on
my harddisc for a week waiting for my next session!

For all stuff Digibox, refer to:
  http://www.heyrick.co.uk/ricksworld/digibox/
  (the shorter links quoted in the software redirect to the above)




Thanks to
---------

Mom, Ewen Cathcart, and Pace.



Rick, 2006/07/02
