Saturday, September 15, 2018

POCSAG decoding in QV land...

Because I will forget all the steps it took in another five years when I have to do it again.

Eastern Connecticut has been using a proprietary public safety paging system on 152.0075 since back around 2000. This is a shared Hospital / Public Safety frequency used for paging nationwide; in cities you'll often hear continuous pages going out over this frequency as Alpha pages continue to be cheap, simple devices with more reliable reception than "smartphones."

An protocol called POCSAG written in 1976, when Post Offices ran most European telecommunication networks, is used to encode the messages and they are sent out at 512 bits per second.

A program called PDW is used to decode these messages.

My first setup was able to use the sound card to feed PDW.

I came home one day to find that computer in meltdown mode.

I was never able to get the sound card to work with the next laptop I tried, or a relatively inexpensive refurbished HP computer I bought off Amazon.

So I needed to put a Discriminator Tap on my 25+ year old PRO-2036. See

This still wasn't sufficient so I broke down and bought the USB dongle from the fellows who originally developed the software (if I understand the story correctly).

This did a great job and worked for me through 9/28/17 when I took down my setup to do some major home renovations.

When I set the kit back up this summer, it was no joy.

After fiddling for a bit, I started to suspect I just wasn't getting a "clean" enough signal. I don't know if scanners lose the sensitivity as they age, or maybe my antenna connections were getting loser. The POCSAG just didn't sound clear to me. So I went to You Do It electronics this morning and bought a new antenna...voila! I am working again!

The next problem is I am seldom actually at my desk at home.

For my own fire company (I had this setup for the phone long before there was an "official" feed from the dispatch center to text messaging) PDW can email me:

First you setup the email setting, set to "selected filters only:"
Then in the filters, you chose which filter you want to notify you.

In this case 090 = Station 90, 777 = Fire Tone

My watch desk as of now -- the PRO2036 is locked onto 152.0075 so it just does the alpha system. The other ~20 year scanner is configured for VHF-Low and UHF currently.

Now I had a condundrum:

1) I don't want to be always emailed everything;

2) I want to be able to see them easily from my easy chair (where I usually have a laptop in my lap)

3) I would like to see them from the office

4) I do not want to have them exposed to the internet

5) I don't even want to have them password-protected, because by the time traffic is reaching the web server to verify credentials you're already getting slammed, and I wouldn't expose any web server to the 'net without a first class firewall today.

Inside my house I can have the 'puter run Nginx as a high performance, relatively lightweight web server. I used NSSM as recommended to make it a service so it will run automatically on computer start up (and I seldom lose power at my house).

In nginx.conf I put the following section to point to the directory:

Now the other filter I have setup in PDW matches all capcodes. The capcodes are how pagers are addressed; and pagers can have their own unique capcode in addition to one or more group capcode allowing individuals to be alerted, or as used in public safety various groups like firefighters, ambulance staff, dive team members, etc.

With "Enable filter command file" checked it calls a command...

So whenever any capcode is decoded, the batch file c:\scripts\pdw\logParser.bat is called. I think PDW can only call .exe, .com, or .bat files (although I could be wrong):

This in turn runs a simple PowersHell Script (I'm a BASH guy who for the last 3-3/4 years has been a Windows guy writing almost entirely in PowersHell) that produces an HTML page:

At this point I can sit in my easy chair watching TV, surfing the net, and if I hear a page go out I can check on my local network, with the most recent page at the top:

As I said, I didn't want this open to the whole world, and I don't have a truly strong firewall. But my router I am confident enough in its ability to drop all traffic that isn't originating from my work's ISP IP addresses:

This denies almost everyone in the whole wide world from getting in.

But if I am on my work network (in the office, or say by Citrix -- which I can also do from my iPhone), I am allowed in:

To help understand the coding scheme in general use, a little bit of background is needed.

For some reason when the current radio call sign scheme was adopted in the early 1980s independent ambulance corps weren't assigned their own station numbers, and instead used the same number as the fire department of the district it was located in. For example the then Killingly-Brooklyn Ambulance Corps (then located at the American Legion Hall on Furnance St. in Danielson) used "61" the same as Danielson F.D.
At the time the fire service's Statewide Radio Committee had the following designations for EMS:
R1 -- First Responder
R2 -- Ambulance
R3 -- Medium Rescue
R4 -- Heavy Rescue
R5 -- Paramedics

R4 had already morphed from the original Civil Service "heavy" of implying ability to work collapsed building incidents into having requirements like hydraulic rescue tools and electric shock sticks.

There were few (if any) R5 resources in Eastern Connecticut when the system was adopted, but a number of services with more than 2 ambulances.

The sum of which Ambulances started being given designations as Rescue 5xx, 6xx, 7xx, etc.

That in turn has morphed into designating ambulance services as 5xx, even when affiliated with a fire department.


So let's look at this series of pages:

0561511 18:25:53 15-09-18 POCSAG-1 ALPHA 512 QVMEDIC RES63 STA561 KB1 33.88 PRI 1 Diabetic Emergency * 7 VALLEY RD * Killingly (X-STS HARTFORD PIKE / BLUMENTHAL DR ) 18:25

0630777 18:25:44 15-09-18 POCSAG-1 ALPHA 512 QVMEDIC RES63 STA561 KB1 33.88 PRI 1 Diabetic Emergency * 7 VALLEY RD * Killingly (X-STS HARTFORD PIKE / BLUMENTHAL DR ) 18:25

0561777 18:25:41 15-09-18 POCSAG-1 ALPHA 512 QVMEDIC RES63 STA561 KB1 33.88 PRI 1 Diabetic Emergency * 7 VALLEY RD * Killingly (X-STS HARTFORD PIKE / BLUMENTHAL DR ) 18:25

0561 = KB Ambulance
0630 = Dayville Fire Company (Station 63)
xxxx511 = "Ambulance Tone"
xxxx777 = "Fire Tone", or in KB's case seems to be their Paramedics tone.
For FDs the "777" is the equivelant of their Fire tone on the voice dispatch system; some larger departments have multiple tones / capcodes for Fire, EMS, Officers or other groupings that may be uniquely dispatched or need to be otherwise notified.

This isn't universal, but it holds up for most of the users of the Alpha system. (While QVEC owns the system, their are other dispatch centers that use it.)

18:25:53 15-09-18 POCSAG-1 ALPHA 512 -- this is just metadata from PDW.

Now begins what people see on their pagers / text messages:

QVMEDIC QV Medic; contract currently held by KB
RES63 Dayville Fire Co. EMS Responders
STA561 KB Ambulance

KB1 KB's 1st crew. Usually ambulances in the area have a crew either on duty or on call for their first unit; additional units may not have personnel scheduled and instead are on an "anyone available" basis
33.88 Operating Frequency
PRI 1 1 = Respond Lights & Siren; 2 = Proceed with Traffic

Diabetic Emergency * 7 VALLEY RD * Killingly (X-STS HARTFORD PIKE / BLUMENTHAL DR ) 18:25 What is the call for, location, and time.

Station numbers as far as I know nowdays...God, I first put a list up on the internet in 1998 :/

Station Number
9 Chaplin
12 Hampton
16 Scotland
24 Baltic
26 Bozrah
28 Colchester
21 Salem
27 Gardner Lake
53 Voluntown
54 Lisbon
55 Griswold
56 Jewett City (A.A. Young)
60 Williamsville
61 Danielson
561 KB Ambulance
62 Attawaugan
63 Dayville
64 East Killingly
65 South Killingly
67 Sterling
68 Oneco
70 Pomfret
71 Eastford
75 Muddy Brook
76 Woodstock
77 Bungay
79 East Putnam
81 Community
82 West Thompson
83 Quinebaug
84 Thompson Hill
85 East Thompson
90 Mortlake
91 West Wauregan (Defunct, merged with Mortlake 1995)
92 East Brooklyn
93 Canterbury
94 Moosup
95 Plainfield
594 American Legion Ambulance Fund a/k/a Moosup Ambulance
96 Atwood Hose
97 Central Village
QV Medic (Original contractor Superior Ambulance who was bought by AMR; American later got the contract; contract is now held by KB Ambulance)

Station TN, Tolland

5 Columbia
7 Mansfield
8 South Coventry
10 Hebron
11 North Coventry
13 Willington No. 1
14 Lake Chaffe (Defunct, merged with Ashford in early 80s)
15 Andover
17 Mansfield (Obsolete; upon merger kept the Mansfield name and Eagleville number)
20 Ashford
32 Mansfield Training School (defunct)
34 Bolton
38 Warehouse Point
39 Broad Brook
40 Tolland
41 Vernon
42 Crystal Lake
43 Ellington
44 West Stafford
45 Staffordville
46 Somers
47 Stafford Springs (Defunct; ceased operations July 1, 2000 per order of Selectmen; former station and territory now covered by Staffordville)
48 Vernon (Obsolete; upon merger kept Vernon name and Rockville number)
48 Tri-County Fire Police
49 Willington Hill
51 Osborn Prison (Defunct)

Station WW / Station K, Willimantic

1 Willimantic
2 North Windham
3 Windham Center
4 South Windham
6 Lebanon
25 Franklin
30 Windham Regional Dive Team
31 Eastern Connecticut Regional Fire Training School
31 Windham Community Memorial Hospital Medics

Station UC, University of Connecticut
22 University of Connecticut, Storrs Mansfield

Station WA, Putnam
78 Putnam Putnam
578 Putnam EMS Putnam

Station M, Montville
Station M uses the alpha system, but I have lost track of their station numbers of the years.

No comments: