How to use this stuff
John "Chris" Wren, KD4DTS
jcwren@atlanta.com
12/23/97
Version 1.00


        In looking at the documentation provided with TRUNKER, I've noticed
that it's rather scarce, and there's a lot of implied knowledge.  Perhaps
with this document, we can remedy at least a little of that.

        If you are a learned soul, and find some deficencies, or know a
better way to do something, please, e-mail me and I'll incorporate it into
the next version of this document.


                            What does this thing do?

        TRUNKER is program that allows a person with two scanners and a
device called a "data slicer" to follow traffic on a trunked radio system.
It's useful for listening to what the police, fire/EMS teams, water works,
and whatever other groups using the system are up to.  Hear your tax dollars
at work ("Unit 54, be advised that complainent says the neighbors cat has
been meowing too loudly.  Dispatching 3 additional units, signal 32, TAC 3").


                 What's a trunking system, how does it work?

        Trunking systems seem to be implemented typically at the county
level.  Where I live, the system has the county police department, several
city departments, fire/EMS teams, animal control, the water works, Parks &
Recreation services, and some various other county level functions.

        Each service is assigned to a group.  As far as I know, unless there
is an equivalent of changing channels, each group can only talk to members
of their own group.  This prevents the water works guys from yakking at the
fire/EMS teams.  There are also certain groups that all radios respond to, 
such as "All county".  Through some system, users are able to talk to 
specific other users, rather than the whole group.  I don't know if in-
dividuals can talk to individuals outside of their own group or not.  I 
imagine the system is pretty flexible, and can acommodate this somehow.

        A trunking system is a radio system that has a minimum of 2 frequen-
cies, and usually more.  One channel, at any given time, is a control channel.
This channel contains digitally encoded data that specifies which of the
other channels in the system currently have conversations on them, which
frequency to use next, etc.  This data channel often rotates between up to 4
frequencies (used to "normalize" transmitter wear, I guess).

        (This part I'm unsure of).  For every output frequency the county,
there are a corresponding number of input frequencies.  Output frequencies
are in the 854-858 in my county, and the inputs are somewhere down around
814-818.

        When a user keys down, the trunking system controller selects an
output channel for that transmission, and repeats what it hears from the
input on the output frequency.  The control channel notifies other radios
that the input frequency is in use, and if they need to transmit, what 
other input frequency to use.

        The above is somewhat simplified, and certainly contains some
omissions.  Someone who *really* knows about trunked systems should fix
this.


                                What do I need?

        To really do this right, you'll need either an AR8000 scanner, or
a scanner capable of being controlled by a computer (AR3000, R7000, PCR1000,
AR2700, etc), and a radio capable of monitor 800mhz with discrimator out 
(such as a Yaesu 8100, or many other "packet ready" radios).  You'll also
need a data slicer.

        A data slicer is nothing more than a device that takes the dis-
criminator audio in, amplifies the heck out of it so it looks like a square 
wave, then converts it to RS-232 levels.  You should be able to build one of 
these in about 1/2 an hour if you're adept with a soldering iron and know 
which end of a diode is which.  There are also some commercial ones from MFJ, 
WeFax, and a few other manufacturers.

        You'll need the computer controlled scanner to listen to the audio
on the output frequencies.  The other radio listens to the control channel, 
and the data from the discriminator out goes to the data slicer.  The data 
slicer squares up the signal, and sends it to the PC via the Clear-To-Send 
pin on the serial port.

        The software decodes the data coming in from the data slicer, and
commands the computer controlled scanner to change frequency.  The software
supports a prioritization scheme that allows you, the user, to assign a
priority to each group.  As an example, I set the "All County" group to be
highest, because usually anything sent to the entire county is of some
interest.  The water works people are set to the lowest, because, frankly,
these are some of the dumbest people to ever squeeze a microphone key.  My
nearest city police are set to the second highest priority, because they're
closest to me.  If some junkie is running loose with a gun near my house, I 
want to know about it (how else to justify an Uzi with a silencer and night
vision equipment to the wife?).


                        How do I find the trunking system?

        Look for tall towers.  No, seriously, there are a couple of excellent
websites that contain lists by state and county of what frequencies are used,
what groups are assigned to whom, etc.  The two I really like are:

                http://web2.airmail.net/lblant1/trunked.htm
                http://members.aol.com/wwhitby2/trs.html

        Another method is tune through the 800 mhz band, starting around 849
megahertz or so.  Set the step for 12.5Khz.  The problem here is that if you
have to resort to searching like this, you're likely not to know what to 
listen for.  A couple of hints:  If you have the decoder software running
while you're doing this, when you hit the control channel, you'll suddenly
see frequencies appearing on the screen, and a SysId come up.  A control
channel sounds like a surging buzz.  It will also stay up continously.  If
you know what pager data sounds likes, it doesn't sound like that.

        Maybe someone will record a few seconds of it and post it as a .WAV
file so you can see what you're looking for.  This might also be a good way
to provide a test setup so you'll have known constants when putting every-
thing together.


                        What kind of computer do I need?

        This is a good question.  Experience shows that it runs on an AMD
5x86-133 in a DOS box under Windows-95 without any problem.  It also will
run but miss data on a 486-25 laptop under DOS only.  Other people says that
under Windows-3.11, don't even bother.  I have an NT system here, but as
of 12/26/97, I haven't tried it yet.

        The program supports an accuracy counter, expressed in percentage.
This indicates with what degree of success it decodes packets.  On the
5x86-133 system, I get 95 to 97% accuracy, with fairly poor reception (major
fluctuation between S1 and S3 on my Yaesu 8100, for folks who know what this
means).


                        How do I get the software running?

        The software is not complicated to get running, particularly if you
know that your hardware is already functional.  If you've just built your
own slicer, and don't know if it's working or not, well, that's beyond the
scope of this document (so far).

        The first thing to so is either boot a machine to a DOS prompt, or
under Windows-95, open a DOS box.  Make it full screen (using the ALT-ENTER
key sequence) to make it easier to read, for now.

        At the DOS prompt, you'll need to set several environment variables.
Don't panic!  It isn't voodoo.  It's just a easier way for the lazy program-
mer (that's me) to avoid writing code to parse command line arguments.

        Environment variables are nothing more than strings of text stored
in an internal area of DOS (for those of us that really know how the 
variables work, leave it alone.  We're trying to get this person running,
not teach them DOS internals!).  Every time you set a PATH statement (like
the one in your AUTOEXEC.BAT), or change your PROMPT string, you're changing
an environment variable.  See?  Nothing to it...

        To select the type of scanner you have, at the DOS prompt, type:

                SET TRACKSCAN=R7000

        Now, if you don't have an R7000, use the type of your scanner here.
(You can type TRUNKER ?) to see a list of supported scanners.  It's being
taught about more all the time).  So, if you had a AR8000, you'd type

                SET TRACKSCAN=AR8000

        You get the idea, I'm sure.  Now, you'll need to set a variable to
tell the program what COM port you have the scanner connected to (you've
connected the scanner, haven't you?  If you don't, this will never work.
And, if you don't know how to connect your scanner to the serial port, well,
post a question to USENET.  I can't explain that to you.).

                SET TRACKSCANPORT=COM1

        If you plugged your scanner into COM2, then substitute COM2 for COM1
in the line above.  The same is true for COM3 or COM4 (for those of you who
know enough to know what this means:  If you're not using an 8250 COM port,
or your multiport serial card doesn't emulate one, it won't work.  You have
to have an 8250, 16450, or 16550 type COM port).

        Now we'll need to tell the program where your data slicer is.  Same
kind of stuff here.

                SET TRACKSLICERPORT=COM2

        Again, if this isn't the COM port it's one, use the correct one.

        The next variable you'll have to either already know, or perform
an experiment to find out the correct value.  The audio out of some radios
is inverted (you be able to tell this because everything will sound upside-
down.  Heh heh heh.  Just kidding!  But seriously folks...)

                SET TRACKSLICERMODE=NORMAL

        At this point, you'll need to tune the radio that you're going to
monitor the control channel with to an active control channel.  If you don't
know what one sounds like, read whatever I wrote near the top on finding
out how to figure this out.  You should know this by this point in the
process).

        Start the program by typing:

                TRUNKER

        If the program comes up and you start seeing a list of frequencies
displayed on the screen, and the SysID field in the upper left hand corner
has a number other than 1234, you're OK.  If not, trying quitting the
program (use the 'Q' key), then type:

                SET TRACKSLICERMODE=INVERT

        This tells the program that your radio/slicer combination is inver-
ting the data, and needs to be set right.  Start the program again with:

                TRUNKER

        Hopefully now you'll start seeing data appear and a SysID number
other than 1234 come up in the corner.  If it doesn't, you've got a problem
that I can't help you with.  Post a question to alt.radio.scanner, and ask
for help.  There's a bunch of great people there, and you'll probably get
more replies than you ever expected.

        If you saw control channel data appearing, but the scanner you have
connected to the serial port isn't changing to the frequency with the asterick
beside it, you're halfway there.  This indicates your control channel radio/
slicer combination is working, but either the monitoring scanner isn't in
the correct mode, or the interface to the scanner has a problem.

        Check the dumb things first.  Many people make the mistake with the
AR8000 scanner of having it in CR/LF mode, instead of CR mode.  I have no
idea how to change this, 'cause I don't own one, but I hear people talking
about it all the time.

        If you have something like a R7000 or R7100, check the baud rates.
The factory default is 1200, but the program defaults to 9600.  You can
override the default baud rates by typing:

                SET TRACKSCANBAUD=1200

        If you don't use 1200, you can use 300, 1200, 2400, 4800, 9600,
19200, 38400, or 57600.  The R7x00's are tricky, because besides trial and
error, the only way to know what they're set to is to open them up and look
at the switches.

        If you built an interface, try figuring out another way to verify
the hardware.  No doubt you can find a control program on the 'net that
will support whatever radio you have.  

        If you know the hardware works, make sure you don't have some kind
of COM port conflict.  Remember that using standard COM port and IRQ
mappings, you can't use COM1 and COM3, or COM2 and COM4 at the same time.
This is because they share the interrupt, and most (not all) systems are not
smart enough to know how to "share" interrupts.

        Try just using COM1 and COM2, if you can.  That's nice and generic,
and very safe.  Put the slicer on COM1, the scanner on COM2, and set the
environment variables TRACKSCANPORT and TRACKSLICERPORT accordingly.  If you
can, plug another PC in the serial port the scanner should be connected to,
and see if you see any data coming off it.  Remember that you'll need a null
modem cable to reverse the transmit and receive data lines.

        If you've gone through all this, I can't help you.  Send e-mail, or
post a question to the 'net, describe your symptoms with great care and
detail, and wait for a response.  Remember, you'll only make people mad if
you post the question as "I tried to use TRUNKER and it didn't work.  What
did I do wrong?".  Tell us what you tried, what worked kinda, and what didn't
work at all.  

        
                                All in all

        Hope this helped you some.  If reading this document got you up and
running, let me know (better yet, send money!  Just kidding).  If this
document lacked something obvious that you figured out knowing would have 
helped, send e-mail.  I'll make changes.  If you didn't like the document at 
all, I don't want to hear from you.  Write your own document, and one-up
me.

        Happy trunking!

        - Chris, KD4DTS
